From 30c7bef4457a321877e3d43d8ed11df42ad3f358 Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 7 Mar 2026 11:26:56 -0500 Subject: [PATCH] Add PlayerOneAccountId to GameStateDto; fix placement row detection Client had no way to know if it was P1 or P2, so _valid_placement_tiles always chose row bh-1. Now the DTO exposes playerOneAccountId so the client can correctly pick row 0 (P1) or row bh-1 (P2). Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Server/src/SOR.Game/GameEngine.cs | 1 + Server/src/SOR.Game/GameMessages.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/Server/src/SOR.Game/GameEngine.cs b/Server/src/SOR.Game/GameEngine.cs index caa266b..d40eb91 100644 --- a/Server/src/SOR.Game/GameEngine.cs +++ b/Server/src/SOR.Game/GameEngine.cs @@ -892,6 +892,7 @@ public static class GameEngine SessionId : state.SessionId, Phase : state.Phase.ToString(), ActivePlayerAccountId : state.ActivePlayerAccountId, + PlayerOneAccountId : state.PlayerOneAccountId, TurnNumber : state.TurnNumber, StateVersion : state.NextActionSequence, Players : players, diff --git a/Server/src/SOR.Game/GameMessages.cs b/Server/src/SOR.Game/GameMessages.cs index df68b70..f98fa24 100644 --- a/Server/src/SOR.Game/GameMessages.cs +++ b/Server/src/SOR.Game/GameMessages.cs @@ -200,6 +200,7 @@ public sealed record GameStateDto( Guid SessionId, string Phase, // Placement | Draw | Main | End | GameOver string ActivePlayerAccountId, + string PlayerOneAccountId, // used by client to determine placement row int TurnNumber, int StateVersion, // monotonic; use for client mismatch detection IEnumerable Players,