From 423e11387cf875d0b628f3d4593ffb003ce60ab2 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Fri, 10 Feb 2023 19:30:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pvp=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pvp/module.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/pvp/module.go b/modules/pvp/module.go index a38ec7c83..e7c110739 100644 --- a/modules/pvp/module.go +++ b/modules/pvp/module.go @@ -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