This commit is contained in:
aozhiwei 2024-03-23 09:02:36 +08:00
parent e603d1b9b2
commit 211cf4b785
3 changed files with 8 additions and 3 deletions

View File

@ -31,6 +31,7 @@ func (this *CacheMgr) GetUserProfile(accountId string) common.UserProfile {
func (this *CacheMgr) PreLoad(accountIds []string) {
}
func (this *CacheMgr) Search(sinceId int64, q string, cb func(int64, []string)) {
func (this *CacheMgr) Search(sinceId int64, q string,
cb func(int32, string, int64, []string)) {
}

View File

@ -73,7 +73,7 @@ type CacheMgr interface {
PreLoadUser([]string)
AsyncGetUsers([]string, func(bool))
GetUserProfile(string) UserProfile
Search(int64, string, func(int64, []string))
Search(int64, string, func(int32, string, int64, []string))
}
type ChatMgr interface {

View File

@ -54,8 +54,12 @@ func (this *player) CMPing(hdr *f5.MsgHdr, msg *cs.CMPing) {
func (this *player) CMSearchUser(hdr *f5.MsgHdr, msg *cs.CMSearchUser) {
GetCacheMgr().Search(msg.GetSinceId(),
msg.GetUsername(),
func (sinceId int64, accountIds []string) {
func (errCode int32, errMsg string, sinceId int64, accountIds []string) {
rspMsg := new(cs.SMSearchUser)
if errCode != 0 {
this.SendMsg(rspMsg.Err(1, "internal server error"))
return
}
rspMsg.SinceId = proto.Int64(sinceId)
q5.NewSlice(&rspMsg.Users, 0, int32(len(accountIds)))
for _, accountId := range(accountIds) {