From e6105b40b0d31d79c3ca1ae3c574501bbf40c85b Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Sat, 14 Sep 2024 17:21:28 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E8=BF=9E=E5=A6=82=E6=9E=9C=E6=AF=94?= =?UTF-8?q?=E8=B5=9B=E6=B2=A1=E6=9C=89=E5=BC=80=E5=A7=8B=E5=B0=B1=E9=80=80?= =?UTF-8?q?=E8=B5=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/action_login.go | 3 ++- worldsrv/tournament.go | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/worldsrv/action_login.go b/worldsrv/action_login.go index bb29260..c12ddcc 100644 --- a/worldsrv/action_login.go +++ b/worldsrv/action_login.go @@ -212,7 +212,8 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf // lss 其它连接 lss := LoginStateMgrSington.LoginFinish(csl.GetUsername(), csl.GetPlatform(), sid, ls.acc, tagkey) player := PlayerMgrSington.GetPlayerBySnId(ls.acc.SnId) - if len(lss) > 0 && (player != nil && (player.scene != nil || player.thrscene != 0)) { + waitMatch, _ := TournamentMgr.IsMatchWaiting(player.Platform, player.SnId) + if len(lss) > 0 && (player != nil && (player.scene != nil || player.thrscene != 0 || waitMatch || TournamentMgr.IsMatching(player.SnId))) { sendSCLogin(login_proto.OpResultCode_OPRC_LoginOtherPlace) sendSCDisconnect(common.KickReason_Logining) return nil diff --git a/worldsrv/tournament.go b/worldsrv/tournament.go index ad3eee2..91fd410 100644 --- a/worldsrv/tournament.go +++ b/worldsrv/tournament.go @@ -507,8 +507,17 @@ func (this *Tournament) IsMatchWaiting(platform string, snId int32) (bool, int32 // 未使用机器人 for k, v := range this.signupPlayers[platform] { if v.signup != nil { - _, ok := v.signup[snId] - return ok, k + if _, ok := v.signup[snId]; ok { + return ok, k + } + } + } + + for k, v := range this.matches { + for _, vv := range v { + if _, ok := vv.TmPlayer[snId]; ok { + return true, k + } } }