获取随机在线玩家数据bug
This commit is contained in:
parent
a60a40d760
commit
9dd2ae45cf
@ -33,5 +33,8 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.GourmetGetListRe
|
|||||||
this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet)
|
this.module.modelGourmet.CalculationGourmet(session.GetUserId(), _gourmet)
|
||||||
session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet})
|
session.SendMsg(string(this.module.GetType()), GourmetGetListResp, &pb.GourmetGetListResp{Data: _gourmet})
|
||||||
|
|
||||||
|
// this.GetRandUser(session, &pb.GourmetGetRandUserReq{
|
||||||
|
// People: 10,
|
||||||
|
// })
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -50,8 +50,8 @@ func (this *apiComp) GetRandUser(session comm.IUserSession, req *pb.GourmetGetRa
|
|||||||
if len(onlineList) > int(req.People) {
|
if len(onlineList) > int(req.People) {
|
||||||
randArr := utils.Numbers(0, len(onlineList), int(req.People))
|
randArr := utils.Numbers(0, len(onlineList), int(req.People))
|
||||||
for _, v := range randArr {
|
for _, v := range randArr {
|
||||||
if szUid[v] != "" {
|
if onlineList[v].Uid != "" {
|
||||||
randOnlineUsers = append(randOnlineUsers, szUid[v])
|
randOnlineUsers = append(randOnlineUsers, onlineList[v].Uid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // 数量不足 则有多少给多少
|
} else { // 数量不足 则有多少给多少
|
||||||
|
Loading…
Reference in New Issue
Block a user