重连如果比赛没有开始就退赛

This commit is contained in:
sk 2024-09-14 17:21:28 +08:00
parent a647da01aa
commit e6105b40b0
2 changed files with 13 additions and 3 deletions

View File

@ -212,7 +212,8 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf
// lss 其它连接 // lss 其它连接
lss := LoginStateMgrSington.LoginFinish(csl.GetUsername(), csl.GetPlatform(), sid, ls.acc, tagkey) lss := LoginStateMgrSington.LoginFinish(csl.GetUsername(), csl.GetPlatform(), sid, ls.acc, tagkey)
player := PlayerMgrSington.GetPlayerBySnId(ls.acc.SnId) 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) sendSCLogin(login_proto.OpResultCode_OPRC_LoginOtherPlace)
sendSCDisconnect(common.KickReason_Logining) sendSCDisconnect(common.KickReason_Logining)
return nil return nil

View File

@ -507,10 +507,19 @@ func (this *Tournament) IsMatchWaiting(platform string, snId int32) (bool, int32
// 未使用机器人 // 未使用机器人
for k, v := range this.signupPlayers[platform] { for k, v := range this.signupPlayers[platform] {
if v.signup != nil { if v.signup != nil {
_, ok := v.signup[snId] if _, ok := v.signup[snId]; ok {
return ok, k return ok, k
} }
} }
}
for k, v := range this.matches {
for _, vv := range v {
if _, ok := vv.TmPlayer[snId]; ok {
return true, k
}
}
}
// 使用机器人了 // 使用机器人了
if v, ok := this.singleSignupPlayers[snId]; ok { if v, ok := this.singleSignupPlayers[snId]; ok {