上传pvp代码

This commit is contained in:
liwei1dao 2023-02-10 19:30:29 +08:00
parent a433192d2f
commit 423e11387c

View File

@ -87,11 +87,13 @@ func (this *Pvp) CreatePvp(red, blue *pb.PvpUserInfo, ptype pb.PvpType) (battleI
// readytimer: timewheel.Add(time.Second*60, this.readyTimeOut, battleId),
}
if battle.RedSession, ok = this.GetUserSession(red.Uid); ok {
if battle.RedSession, ok = this.GetUserSession(red.Uid); !ok {
code = pb.ErrorCode_BattleUserOff
return
}
if battle.BlueSession, ok = this.GetUserSession(blue.Uid); ok {
if battle.BlueSession, ok = this.GetUserSession(blue.Uid); !ok {
code = pb.ErrorCode_BattleUserOff
return
}
this.lock.Lock()
this.battles[battle.Id] = battle