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:
dingo
2026-03-09 09:33:40 -04:00
co-authored by Claude Happy
parent 60697460cb
commit 4fa4c21b6e
18 changed files with 376 additions and 25 deletions
@@ -62,7 +62,8 @@ internal abstract class GameHandlerBase
string actorId,
string actionType,
string? payloadJson,
CancellationToken ct)
CancellationToken ct,
string? resultJson = null)
{
var seqNum = state.NextActionSequence++; // increment before serialize so the saved JSON reflects the consumed number
session.StateJson = GameEngine.Serialize(state);
@@ -72,6 +73,7 @@ internal abstract class GameHandlerBase
ActorAccountId = Guid.Parse(actorId),
ActionType = actionType,
PayloadJson = payloadJson,
ResultJson = resultJson,
SequenceNumber = seqNum,
OccurredAt = DateTimeOffset.UtcNow,
});