This commit is contained in:
aozhiwei 2024-04-07 11:33:26 +08:00
parent 1a6b36db26
commit 37a20cdc6d
3 changed files with 17 additions and 1 deletions

View File

@ -64,6 +64,9 @@ func (this *cacheMgr) AsyncSearch(sinceId int64, q string,
u := newUserProfile() u := newUserProfile()
u.accountId = pg.Rows.GetByName("account_id") u.accountId = pg.Rows.GetByName("account_id")
u.name = pg.Rows.GetByName("name") u.name = pg.Rows.GetByName("name")
u.avatarUrl = pg.Rows.GetByName("avatar")
u.head = pg.Rows.GetByName("head")
u.lastLoginTime = q5.ToInt32(pg.Rows.GetByName("last_login_time"))
this.userHash[u.accountId] = u this.userHash[u.accountId] = u
*q5.NewSliceElement(&users) = u.accountId *q5.NewSliceElement(&users) = u.accountId
@ -71,3 +74,7 @@ func (this *cacheMgr) AsyncSearch(sinceId int64, q string,
cb(0, "", lastSinceId, users) cb(0, "", lastSinceId, users)
}) })
} }
func (this *cacheMgr) internalGetUsers(accountIds []string, cb func(int32, string)) {
}

View File

@ -1,6 +1,7 @@
package cache package cache
import ( import (
"q5"
"cs" "cs"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
) )
@ -60,6 +61,11 @@ func (this *userProfile) GetLastLoginTime() int32 {
func (this *userProfile) FillMFUser(pbUser *cs.MFUser) { func (this *userProfile) FillMFUser(pbUser *cs.MFUser) {
pbUser.AccountId = proto.String(this.accountId) pbUser.AccountId = proto.String(this.accountId)
pbUser.Username = proto.String(this.name) pbUser.Username = proto.String(this.name)
pbUser.Avatar = proto.Int32(q5.ToInt32(this.avatarUrl))
pbUser.AvatarHead = proto.Int32(q5.ToInt32(this.head))
pbUser.Rank = proto.Int32(this.rank)
pbUser.OnlineStatus = proto.Int32(0)
pbUser.LastLoginTime = proto.Int32(this.lastLoginTime)
} }
func newUserProfile() *userProfile { func newUserProfile() *userProfile {

View File

@ -92,6 +92,9 @@ func (this *player) CMSearchUserByAccountId(hdr *f5.MsgHdr, msg *cs.CMSearchUser
} }
func (this *player) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *cs.CMListPendingFriendRequest) { func (this *player) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *cs.CMListPendingFriendRequest) {
rspMsg := new(cs.SMListPendingFriendRequest)
this.SendMsg(rspMsg)
/*
GetFriendMgr().AsyncGetApplyList( GetFriendMgr().AsyncGetApplyList(
0, 0,
this.GetAccountId(), this.GetAccountId(),
@ -117,7 +120,7 @@ func (this *player) CMListPendingFriendRequest(hdr *f5.MsgHdr, msg *cs.CMListPen
} }
this.SendMsg(rspMsg) this.SendMsg(rspMsg)
}) })
}) })*/
} }
func (this *player) CMListFriend(hdr *f5.MsgHdr, msg *cs.CMListFriend) { func (this *player) CMListFriend(hdr *f5.MsgHdr, msg *cs.CMListFriend) {