This commit is contained in:
wh_zcy 2023-02-08 14:13:35 +08:00
parent a76c281e49
commit b0b9f0865c
3 changed files with 11 additions and 3 deletions

View File

@ -4,5 +4,5 @@ Website = "http://legu.cc"
Icon = "app.png" Icon = "app.png"
Name = "RobotGUI" Name = "RobotGUI"
ID = "cc.legu.app" ID = "cc.legu.app"
Version = "1.2.8" Version = "1.2.9"
Build = 38 Build = 39

View File

@ -2,6 +2,7 @@ package friend
import ( import (
"go_dreamfactory/comm" "go_dreamfactory/comm"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/pb" "go_dreamfactory/pb"
"go_dreamfactory/utils" "go_dreamfactory/utils"
@ -30,6 +31,10 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
return return
} }
this.moduleFriend.Debug("在线玩家数",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "count", Value: len(cuList)})
recommend := 5 //推荐数量 recommend := 5 //推荐数量
//过滤 //过滤
var newList []*pb.CacheUser var newList []*pb.CacheUser
@ -59,6 +64,9 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
} }
newList = append(newList, v) newList = append(newList, v)
} }
this.moduleFriend.Debug("过滤后的玩家数",
log.Field{Key: "uid", Value: session.GetUserId()},
log.Field{Key: "count", Value: len(newList)})
var randOnlineUsers []string var randOnlineUsers []string
if len(newList) > recommend { if len(newList) > recommend {
@ -79,7 +87,6 @@ func (this *apiComp) Randlist(session comm.IUserSession, req *pb.FriendRandlistR
var userList []*pb.FriendBase var userList []*pb.FriendBase
for _, uid := range randOnlineUsers { for _, uid := range randOnlineUsers {
target := this.moduleFriend.modelFriend.GetFriend(uid) target := this.moduleFriend.modelFriend.GetFriend(uid)
if target == nil { if target == nil {
continue continue

View File

@ -189,6 +189,7 @@ func (this *User) CrossUserOnlineList() ([]*pb.CacheUser, error) {
if err := model.GetList(comm.RDS_EMPTY, &cache); err != nil { if err := model.GetList(comm.RDS_EMPTY, &cache); err != nil {
return nil, err return nil, err
} }
this.Debug("在线玩家数FromDB", log.Field{Key: "count", Value: len(cache)})
return cache, nil return cache, nil
// reply := &pb.UserOnlineResp{} // reply := &pb.UserOnlineResp{}