From 824b161a466df4df69fdc496431eeae8b9b7dae0 Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Fri, 27 Sep 2024 09:16:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B1=A1=E6=A3=8B=E8=B0=83=E8=AF=95=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gamerule/chess/constants.go | 1 + gamesrv/chess/scenepolicy.go | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/gamerule/chess/constants.go b/gamerule/chess/constants.go index 9341718..e7af063 100644 --- a/gamerule/chess/constants.go +++ b/gamerule/chess/constants.go @@ -39,6 +39,7 @@ const ( PlayerOpStep //6,计步操作(1 开始,0结束) PlayerOpDraw //7,求和 1请求求和 2拒绝求和 3同意求和 PlayerOpNextPlay //8,再来一局 + PlayerOpWin //9,胜利 // 人机对战操作 PlayerOpAISwitch //9,ai开关 0关闭 1开启 diff --git a/gamesrv/chess/scenepolicy.go b/gamesrv/chess/scenepolicy.go index 9e24ec8..95084c5 100644 --- a/gamesrv/chess/scenepolicy.go +++ b/gamesrv/chess/scenepolicy.go @@ -1130,6 +1130,20 @@ func (this *SceneStatePlayerOp) OnPlayerOpNormal(s *base.Scene, p *base.Player, case rule.PlayerOpTest: // 测试 强制同步给所有的玩家 returnFunc(chesstitians.OpResultCode_OPRC_Sucess) return true + case rule.PlayerOpWin: + if common.Config.IsDevMode { + for _, seat := range sceneEx.seats { + if seat != nil { + if seat.GetSnId() == playerEx.GetSnId() { + sceneEx.winSnId = seat.GetSnId() + break + } + } + } + returnFunc(chesstitians.OpResultCode_OPRC_Sucess) + } + return true + } return true }