上传捕羊大赛邀请逻辑优化
This commit is contained in:
parent
eb5ae6d13b
commit
e40f849605
@ -50,6 +50,16 @@ func (this *apiComp) Invite(session comm.IUserSession, req *pb.ParkourInviteReq)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ok = false
|
||||||
|
for _, v := range info.Member {
|
||||||
|
if v.Uid == session.GetUserId() {
|
||||||
|
ok = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
info.Member = append(info.Member, &pb.DBRaceMember{Uid: tuser.Uid, Name: tuser.Name, Avatar: tuser.Avatar, Mount: info.Dfmount, Hp: mount.Hp})
|
||||||
|
}
|
||||||
|
|
||||||
if tinfo, err = this.module.parkourComp.queryinfo(req.Uid); err != nil {
|
if tinfo, err = this.module.parkourComp.queryinfo(req.Uid); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
@ -62,15 +72,6 @@ func (this *apiComp) Invite(session comm.IUserSession, req *pb.ParkourInviteReq)
|
|||||||
code = pb.ErrorCode_ConfigNoFound
|
code = pb.ErrorCode_ConfigNoFound
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ok = false
|
|
||||||
for _, v := range info.Member {
|
|
||||||
if v.Uid == session.GetUserId() {
|
|
||||||
ok = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if !ok {
|
|
||||||
info.Member = append(info.Member, &pb.DBRaceMember{Uid: tuser.Uid, Name: tuser.Name, Avatar: tuser.Avatar, Mount: info.Dfmount, Hp: mount.Hp})
|
|
||||||
}
|
|
||||||
|
|
||||||
//目标是否在线
|
//目标是否在线
|
||||||
if !this.module.ModuleUser.IsOnline(req.Uid) {
|
if !this.module.ModuleUser.IsOnline(req.Uid) {
|
||||||
|
Loading…
Reference in New Issue
Block a user