This commit is contained in:
aozhiwei 2024-04-07 21:27:53 +08:00
parent aef4ac3f35
commit a6724dc933
3 changed files with 12 additions and 2 deletions

View File

@ -70,7 +70,7 @@ type FriendMgr interface {
type Guild interface {
GetGuildId() string
GetGuildName() string
FillMFGuild(*cs.MFGuild)
AsyncFillMFGuild(*cs.MFGuild, func(int32, string))
}
type GuildMember interface {

View File

@ -62,7 +62,7 @@ func (this *guild) isOwner(accountId string) bool {
return this.ownerId == accountId
}
func (this *guild) FillMFGuild(pbGuild *cs.MFGuild) {
func (this *guild) AsyncFillMFGuild(pbGuild *cs.MFGuild, cb func(int32, string)) {
pbGuild.AutoId = proto.Int64(0)
pbGuild.GuildId = proto.Int64(q5.ToInt64(this.guildId))
pbGuild.Name = proto.String(this.guildName)

View File

@ -358,6 +358,16 @@ func (this *player) CMGuildInfo(hdr *f5.MsgHdr, msg *cs.CMGuildInfo) {
this.SendMsg(rspMsg.Err(1, "guild not exists"))
return
}
rspMsg.Guild = new(cs.MFGuild)
guild.AsyncFillMFGuild(rspMsg.Guild,
func (errCode int32, errMsg string) {
if errCode != 0 {
this.SendMsg(rspMsg.Err(500, "server internal error"))
return
}
this.SendMsg(rspMsg)
})
}
func (this *player) CMRecommendGuildList(hdr *f5.MsgHdr, msg *cs.CMRecommendGuildList) {