This commit is contained in:
aozhiwei 2024-04-12 13:56:46 +08:00
parent aba2372e43
commit dfe96fcd1f

View File

@ -619,6 +619,39 @@ func (this *player) CMSetMemberLevel(hdr *f5.MsgHdr, msg *cs.CMSetMemberLevel) {
return
}
this.SendMsg(rspMsg)
{
pbGuilds := []*cs.MFGuildMember{}
GetCacheMgr().AsyncGetUsersAndFillMFGuildMember(
[]string{
this.GetAccountId(),
msg.GetMemberAccountId(),
},
&pbGuilds,
func (errCode int32, errMsg string) {
if errCode == 0 && len(pbGuilds) > 1 {
{
if pbGuilds[0].GetLevel() == constant.GuildMemberLevelLeader {
notifyMsg := new(cs.SMSetMemberLevelNotify)
notifyMsg.GuildId = proto.Int64(q5.ToInt64(guildId))
notifyMsg.Name = proto.String(guildName)
notifyMsg.MemberLevel = proto.Int32(pbGuilds[0].GetLevel())
notifyMsg.AccountId = proto.String(pbGuilds[0].GetAccountId())
notifyMsg.Username = proto.String(pbGuilds[0].GetUsername())
GetGuildMgr().NotifyGuildMsg(guildId, notifyMsg)
}
}
{
notifyMsg := new(cs.SMSetMemberLevelNotify)
notifyMsg.GuildId = proto.Int64(q5.ToInt64(guildId))
notifyMsg.Name = proto.String(guildName)
notifyMsg.MemberLevel = proto.Int32(pbGuilds[1].GetLevel())
notifyMsg.AccountId = proto.String(pbGuilds[1].GetAccountId())
notifyMsg.Username = proto.String(pbGuilds[1].GetUsername())
GetGuildMgr().NotifyGuildMsg(guildId, notifyMsg)
}
}
})
}
})
}