This commit is contained in:
aozhiwei 2024-04-15 11:19:43 +08:00
parent ac609a53c6
commit 11ff251eb2
3 changed files with 16 additions and 1 deletions

View File

@ -179,6 +179,10 @@ func (this *cacheMgr) AsyncSearch(sinceId int64, q string, pbUsers *[]*cs.MFUser
})
}
func (this *cacheMgr) AsyncRecommendList(int32, string, *[]*cs.MFUser, func(int32, string)) {
}
func (this *cacheMgr) getUser(accountId string) *userProfile {
if val, ok := this.userHash[accountId]; ok {
return val

View File

@ -108,6 +108,7 @@ type CacheMgr interface {
AsyncGetUsersAndFillMFUser([]string, *[]*cs.MFUser, func(int32, string))
AsyncGetUsersAndFillMFGuildMember([]string, *[]*cs.MFGuildMember, func(int32, string))
AsyncSearch(int64, string, *[]*cs.MFUser, func(int32, string, int64))
AsyncRecommendList(int32, string, *[]*cs.MFUser, func(int32, string))
}
type DbLogMgr interface {

View File

@ -324,7 +324,17 @@ func (this *player) CMInviteFriendMsg(hdr *f5.MsgHdr, msg *cs.CMInviteFriendMsg)
func (this *player) CMRecommendList(hdr *f5.MsgHdr, msg *cs.CMRecommendList) {
rspMsg := new(cs.SMRecommendList)
this.SendMsg(rspMsg)
GetCacheMgr().AsyncRecommendList(
msg.GetType(),
this.GetAccountId(),
&rspMsg.Users,
func (errCode int32, errMsg string) {
if errCode != 0 {
this.SendMsg(rspMsg.Err(500, "server internal error"))
return
}
this.SendMsg(rspMsg)
})
}
func (this *player) CMSendChatMsg(hdr *f5.MsgHdr, msg *cs.CMSendChatMsg) {