From 26db8f4b21924dbaf2efcd80a6b67ff557871e69 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Mon, 2 Sep 2024 14:55:18 +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 --- gamerule/tienlen/constants.go | 1 + gamesrv/tienlen/scenepolicy_tienlen.go | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gamerule/tienlen/constants.go b/gamerule/tienlen/constants.go index 24ff3bc..024f6a2 100644 --- a/gamerule/tienlen/constants.go +++ b/gamerule/tienlen/constants.go @@ -29,6 +29,7 @@ const ( TIenLenTianhuTimeout = time.Second * 2 // 天胡动画时长 TienLenHandNotExceedTimeLimit = time.Second * 3 //玩家没有牌可以接上家的牌,出牌时间上限 TienLenHandAutoStateTimeOut = time.Second * 1 //玩家托管出牌时间上限 + TienLenCustomWaiteStatTimeout = time.Millisecond * 1500 ) // 场景状态 diff --git a/gamesrv/tienlen/scenepolicy_tienlen.go b/gamesrv/tienlen/scenepolicy_tienlen.go index 020508a..b679abd 100644 --- a/gamesrv/tienlen/scenepolicy_tienlen.go +++ b/gamesrv/tienlen/scenepolicy_tienlen.go @@ -914,10 +914,12 @@ func (this *SceneWaitStartStateTienLen) OnTick(s *base.Scene) { } } if sceneEx.IsCustom() { - if sceneEx.CanStart() { - s.ChangeSceneState(rule.TienLenSceneStateHandCard) - } else { - s.ChangeSceneState(rule.TienLenSceneStateWaitPlayer) + if time.Now().Sub(sceneEx.StateStartTime) > rule.TienLenCustomWaiteStatTimeout { + if sceneEx.CanStart() { + s.ChangeSceneState(rule.TienLenSceneStateHandCard) + } else { + s.ChangeSceneState(rule.TienLenSceneStateWaitPlayer) + } } } }