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 + } } }