This commit is contained in:
aozhiwei 2024-04-09 19:55:33 +08:00
parent 13dfd2647f
commit e8383f8b38
2 changed files with 6 additions and 1 deletions

View File

@ -46,6 +46,7 @@ func (this *guildMgr) loadGuild() {
p.loadFromDb(ds)
this.idHash[p.guildId] = p
this.nameHash[p.guildName] = p
this.updateGuildRank(p)
},
func (err error) {
panic(fmt.Sprintf("loadGuild dberror:%s", err))
@ -833,7 +834,9 @@ func (this *guildMgr) asyncSetApplyStatus(accountId string, guildId string, stat
func (this *guildMgr) AsyncGetGuildRank(num int32, cb func(int32, string, []string)) {
guildIds := []string{}
this.rearrangement()
for _, m := range(this.guildRankList) {
q5.AppendSlice(&guildIds, m.guildId)
}
cb(0, "", guildIds)
}

View File

@ -382,6 +382,7 @@ func (this *player) CMRecommendGuildList(hdr *f5.MsgHdr, msg *cs.CMRecommendGuil
func (this *player) CMGetTopGuildsByTotalStars(hdr *f5.MsgHdr, msg *cs.CMGetTopGuildsByTotalStars) {
rspMsg := new(cs.SMGetTopGuildsByTotalStars)
q5.NewSlice(&rspMsg.Guilds, 0, 50)
GetGuildMgr().AsyncGetGuildRank(
0,
func (errCode int32, errMsg string, guildIds []string) {
@ -416,6 +417,7 @@ func (this *player) CMGetTopGuildsByTotalStars(hdr *f5.MsgHdr, msg *cs.CMGetTopG
this.SendMsg(rspMsg.Err(1, "server internal error"))
return
}
q5.AppendSlice(&rspMsg.Guilds, pbGuild)
doNextFunc()
})
}