From f0f2831ba0652a20f2298f98e8d7843c4db379a8 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 10 Oct 2024 18:03:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=94=E8=B5=9B=E5=9C=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- worldsrv/tournament.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/worldsrv/tournament.go b/worldsrv/tournament.go index a51bf06..2aae9c9 100644 --- a/worldsrv/tournament.go +++ b/worldsrv/tournament.go @@ -2059,17 +2059,17 @@ func (this *Tournament) OnHourTimer() { } } for sortId := range this.players { + has := false for _, tm := range this.matches { - if _, ok := tm[sortId]; !ok { - for _, v := range this.players[sortId] { - if v != nil { - logger.Logger.Errorf("比赛异常,比赛已经不存在了 %v", v.tm) - } - break - } - this.StopMatch(0, sortId) + if _, ok := tm[sortId]; ok { + has = true + break } } + if !has { + logger.Logger.Errorf("比赛异常,比赛已经不存在了 %v", sortId) + delete(this.players, sortId) + } } }