广播消息不发送未登录用户修复

This commit is contained in:
liwei1dao 2022-08-18 10:28:31 +08:00
parent bad7c44903
commit ad390040d7

View File

@ -137,7 +137,10 @@ func (this *AgentMgrComp) SendMsgToAgents(ctx context.Context, args *pb.BatchMes
this.module.Debugf("SendMsgToAgents: agents:%v msg:%v", args.UserSessionIds, msg)
for _, v := range args.UserSessionIds {
if a, ok := this.agents.Load(v); ok {
a.(IAgent).WriteMsg(msg)
agent := a.(IAgent)
if agent.UserId() != "" { //自发送登录用户
agent.WriteMsg(msg)
}
}
}
return nil