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 <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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<PlayerStateDto> Players,
|
||||
|
||||
Reference in New Issue
Block a user