From d792e0ceb14c00fe89672d51cddb054d86730b0e Mon Sep 17 00:00:00 2001 From: kxdd <39694055+shaojiayao@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:48:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=AB=98=E6=A3=89=E8=B1=A1=E6=A3=8B?= =?UTF-8?q?=E7=9A=84=E6=AF=8F=E6=AD=A5=E6=97=B6=E9=95=BF=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E3=80=91=20https://www.tapd.cn/31044302/prong/stories/view/113?= =?UTF-8?q?1044302001000540?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamerule/chess/constants.go | 12 ++++++------ gamesrv/chess/scenepolicy.go | 10 ++++++++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/gamerule/chess/constants.go b/gamerule/chess/constants.go index 39fe5dd..9341718 100644 --- a/gamerule/chess/constants.go +++ b/gamerule/chess/constants.go @@ -10,12 +10,12 @@ const ( ) const ( - WaitStartTimeout = time.Second * 3 // 开始游戏 - HandCardTimeout = time.Second * 1 // 发牌 - PlayerOpTimeout = time.Second * 16 // 玩家操作阶段 - BilledTimeout = time.Second * 1 // 结算 - - PlayerTotalTime = time.Minute*15 + time.Second // 下棋总时长 + WaitStartTimeout = time.Second * 3 // 开始游戏 + HandCardTimeout = time.Second * 1 // 发牌 + PlayerOpTimeout = time.Second * 61 // 玩家操作阶段 + BilledTimeout = time.Second * 1 // 结算 + PlayerFirstOpTimeout = time.Second * 31 + PlayerTotalTime = time.Minute*10 + time.Second // 下棋总时长 ) // 场景状态 diff --git a/gamesrv/chess/scenepolicy.go b/gamesrv/chess/scenepolicy.go index f39d27c..27b3dc2 100644 --- a/gamesrv/chess/scenepolicy.go +++ b/gamesrv/chess/scenepolicy.go @@ -1164,8 +1164,14 @@ func (this *SceneStatePlayerOp) OnTick(s *base.Scene) { } } - if now.Sub(sceneEx.StateStartTime) > rule.PlayerOpTimeout { - f() + if sceneEx.chess.GetRound() == 1 || sceneEx.chess.GetRound() == 2 { + if now.Sub(sceneEx.StateStartTime) > rule.PlayerFirstOpTimeout { + f() + } + } else { + if now.Sub(sceneEx.StateStartTime) > rule.PlayerOpTimeout { + f() + } } curPlayer := sceneEx.seats[sceneEx.GetCurOpPos()]