From 1d9bfd580259fddef93195133dcfb3ec5b0092ba Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 2 Sep 2024 10:08:23 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E6=8A=80=E9=A6=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamesrv/tienlen/scenepolicy_tienlen.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 1140eb4..5e654e1 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -148,9 +148,6 @@ func (this *ScenePolicyTienLen) OnPlayerLeave(s *base.Scene, p *base.Player, rea } sceneEx.OnPlayerLeave(p, reason) s.FirePlayerEvent(p, base.PlayerEventLeave, []int64{int64(reason)}) - if s.IsCustom() && len(s.Players) == 0 { - s.Destroy(true) - } } // 玩家掉线 @@ -606,6 +603,9 @@ func (this *SceneBaseStateTienLen) OnTick(s *base.Scene) { s.RandRobotCnt() s.SetTimerRandomRobot(s.GetRobotTime()) } + if s.IsCustom() && len(s.Players) == 0 { + s.Destroy(true) + } } // 发送玩家操作情况 @@ -2570,9 +2570,6 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { sceneEx.RoundEndTime = append(sceneEx.RoundEndTime, time.Now().Unix()) sceneEx.RoundLogId = append(sceneEx.RoundLogId, sceneEx.recordId) if sceneEx.NumOfGames >= int(sceneEx.TotalOfGames) { - sceneEx.BilledList = make(map[int32]*[]*BilledInfo) - sceneEx.RoundEndTime = sceneEx.RoundEndTime[:0] - sceneEx.RoundLogId = sceneEx.RoundLogId[:0] packBilled := &tienlen.SCTienLenCycleBilled{} for snid, billedList := range sceneEx.BilledList { info := &tienlen.TienLenCycleBilledInfo{ @@ -2636,6 +2633,9 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { logger.Logger.Tracef("SCTienLenCycleBilled: %v", packBilled) s.SyncSceneState(common.SceneStateEnd) sceneEx.SaveCustomLog() + sceneEx.BilledList = make(map[int32]*[]*BilledInfo) + sceneEx.RoundEndTime = sceneEx.RoundEndTime[:0] + sceneEx.RoundLogId = sceneEx.RoundLogId[:0] } }