象棋调试功能

This commit is contained in:
sk 2024-09-27 09:16:22 +08:00
parent 8e25bb52b4
commit 824b161a46
2 changed files with 15 additions and 0 deletions

View File

@ -39,6 +39,7 @@ const (
PlayerOpStep //6,计步操作(1 开始0结束)
PlayerOpDraw //7,求和 1请求求和 2拒绝求和 3同意求和
PlayerOpNextPlay //8,再来一局
PlayerOpWin //9,胜利
// 人机对战操作
PlayerOpAISwitch //9,ai开关 0关闭 1开启

View File

@ -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
}