diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 7ded74f..266232d 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -1632,6 +1632,9 @@ func (this *SceneBilledStateTienLen) CanChangeTo(s base.SceneState) bool { func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) { this.SceneBaseStateTienLen.OnEnter(s) this.BroadcastRoomState(s, this.GetState()) + defer func() { + s.SetGaming(false) + }() //在这里执行结算 if sceneEx, ok := s.GetExtraData().(*TienLenSceneData); ok { @@ -2810,8 +2813,6 @@ func (this *SceneBilledStateTienLen) OnLeave(s *base.Scene) { if len(sceneEx.tianHuSnids) != sceneEx.GetGameingPlayerCnt() { //非和局 sceneEx.lastWinSnid = sceneEx.winSnids[0] } - sceneEx.SetGaming(false) - hasLeave := false //剔除下线玩家 for i := 0; i < sceneEx.GetPlayerNum(); i++ { @@ -2899,7 +2900,7 @@ func (this *SceneBilledStateTienLen) OnTick(s *base.Scene) { n := len(sceneEx.tianHuSnids) newTime += time.Duration(n) * rule.TIenLenTianhuTimeout - if sceneEx.IsCustom() { + if sceneEx.IsCustom() && sceneEx.NumOfGames >= int(sceneEx.TotalOfGames) { newTime += time.Second * 20 }