【高棉象棋的每步时长优化】

https://www.tapd.cn/31044302/prong/stories/view/1131044302001000540
This commit is contained in:
kxdd 2024-04-17 14:48:40 +08:00
parent c6799597c3
commit d792e0ceb1
2 changed files with 14 additions and 8 deletions

View File

@ -10,12 +10,12 @@ const (
) )
const ( const (
WaitStartTimeout = time.Second * 3 // 开始游戏 WaitStartTimeout = time.Second * 3 // 开始游戏
HandCardTimeout = time.Second * 1 // 发牌 HandCardTimeout = time.Second * 1 // 发牌
PlayerOpTimeout = time.Second * 16 // 玩家操作阶段 PlayerOpTimeout = time.Second * 61 // 玩家操作阶段
BilledTimeout = time.Second * 1 // 结算 BilledTimeout = time.Second * 1 // 结算
PlayerFirstOpTimeout = time.Second * 31
PlayerTotalTime = time.Minute*15 + time.Second // 下棋总时长 PlayerTotalTime = time.Minute*10 + time.Second // 下棋总时长
) )
// 场景状态 // 场景状态

View File

@ -1164,8 +1164,14 @@ func (this *SceneStatePlayerOp) OnTick(s *base.Scene) {
} }
} }
if now.Sub(sceneEx.StateStartTime) > rule.PlayerOpTimeout { if sceneEx.chess.GetRound() == 1 || sceneEx.chess.GetRound() == 2 {
f() if now.Sub(sceneEx.StateStartTime) > rule.PlayerFirstOpTimeout {
f()
}
} else {
if now.Sub(sceneEx.StateStartTime) > rule.PlayerOpTimeout {
f()
}
} }
curPlayer := sceneEx.seats[sceneEx.GetCurOpPos()] curPlayer := sceneEx.seats[sceneEx.GetCurOpPos()]