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