Feat: game explorer, action log result capture, session purge
DB / Server:
- Added ResultJson (jsonb, nullable) to GameActionLog entity + EF migration
- Updated SaveStateAsync to accept resultJson (optional, default null)
- All 11 action handlers now serialize GameEngine.ToDto() result into the log
Admin — GameSessionsPage:
- Session IDs are now clickable links → /game/sessions/{id}
- "Abandon All Active" bulk button (previous)
- "Purge All" button (SuperAdmin only, JS confirm) — hard-deletes all sessions
and action logs via cascade
Admin — GameSessionDetailPage (/game/sessions/{id}):
- Session header: status badge, P1/P2 display names (click to copy GUID)
- Info cards: Player 1, Player 2, Created timestamp, Duration/WinCondition
- Action log table: seq#, time, actor name (click to copy GUID), action type
- Expandable Payload (JSON) and Result (JSON) per row
- Actor display names resolved from SorIdentityDbContext
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:
@@ -37,12 +37,13 @@ internal sealed class GameEndTurnHandler : GameHandlerBase, IMessageHandler
|
||||
var state = GameEngine.Deserialize(session.StateJson!);
|
||||
var newState = GameEngine.EndTurn(state, actorId);
|
||||
|
||||
var dto = GameEngine.ToDto(newState, actorId);
|
||||
await SaveStateAsync(_gameDb, session, newState, actorId, "game.end_turn",
|
||||
JsonSerializer.Serialize(req), ct);
|
||||
JsonSerializer.Serialize(req), ct, JsonSerializer.Serialize(dto));
|
||||
|
||||
await PushStateToPlayersAsync(_clientPush, session, newState, ct);
|
||||
|
||||
return ServerMessage.Reply("game.end_turn.ack", message.Seq,
|
||||
new GameEndTurnResponse(GameEngine.ToDto(newState, actorId)));
|
||||
new GameEndTurnResponse(dto));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user