1
This commit is contained in:
parent
e603d1b9b2
commit
211cf4b785
3
server/imserver_new/cache/cachemgr.go
vendored
3
server/imserver_new/cache/cachemgr.go
vendored
@ -31,6 +31,7 @@ func (this *CacheMgr) GetUserProfile(accountId string) common.UserProfile {
|
|||||||
func (this *CacheMgr) PreLoad(accountIds []string) {
|
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)) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ type CacheMgr interface {
|
|||||||
PreLoadUser([]string)
|
PreLoadUser([]string)
|
||||||
AsyncGetUsers([]string, func(bool))
|
AsyncGetUsers([]string, func(bool))
|
||||||
GetUserProfile(string) UserProfile
|
GetUserProfile(string) UserProfile
|
||||||
Search(int64, string, func(int64, []string))
|
Search(int64, string, func(int32, string, int64, []string))
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChatMgr interface {
|
type ChatMgr interface {
|
||||||
|
@ -54,8 +54,12 @@ func (this *player) CMPing(hdr *f5.MsgHdr, msg *cs.CMPing) {
|
|||||||
func (this *player) CMSearchUser(hdr *f5.MsgHdr, msg *cs.CMSearchUser) {
|
func (this *player) CMSearchUser(hdr *f5.MsgHdr, msg *cs.CMSearchUser) {
|
||||||
GetCacheMgr().Search(msg.GetSinceId(),
|
GetCacheMgr().Search(msg.GetSinceId(),
|
||||||
msg.GetUsername(),
|
msg.GetUsername(),
|
||||||
func (sinceId int64, accountIds []string) {
|
func (errCode int32, errMsg string, sinceId int64, accountIds []string) {
|
||||||
rspMsg := new(cs.SMSearchUser)
|
rspMsg := new(cs.SMSearchUser)
|
||||||
|
if errCode != 0 {
|
||||||
|
this.SendMsg(rspMsg.Err(1, "internal server error"))
|
||||||
|
return
|
||||||
|
}
|
||||||
rspMsg.SinceId = proto.Int64(sinceId)
|
rspMsg.SinceId = proto.Int64(sinceId)
|
||||||
q5.NewSlice(&rspMsg.Users, 0, int32(len(accountIds)))
|
q5.NewSlice(&rspMsg.Users, 0, int32(len(accountIds)))
|
||||||
for _, accountId := range(accountIds) {
|
for _, accountId := range(accountIds) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user