登录判断玩家是否在比赛场

This commit is contained in:
sk 2024-09-18 10:58:29 +08:00
parent df5de58f46
commit 97a6d363e7
1 changed files with 4 additions and 1 deletions

View File

@ -212,7 +212,10 @@ 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)
waitMatch, _ := TournamentMgr.IsMatchWaiting(player.Platform, player.SnId)
waitMatch := false
if player != nil {
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)