feat: add game.ai.create_match handler for AI-vs-AI spectatable matches

Adds GameAiMatchHandler (game.ai.create_match) that creates a spectatable
AI-vs-AI match without a human lobby. Resolves AI accounts and decks,
builds a minimal CustomLobby with AiSlotsJson, creates a GameSession, and
publishes GameStartedEvent so AiPlayerSessionManager starts both polling loops.
Client receives { sessionId, player1Name, player2Name } and sends game.spectate
to watch via the existing spectator infrastructure.

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-04-13 12:55:29 -04:00
co-authored by Claude Happy
parent 365db851e2
commit f6e1086709
3 changed files with 193 additions and 0 deletions
+13
View File
@@ -4,6 +4,19 @@ namespace SOR.Game;
/// <summary>Host adds an AI player to a custom lobby.</summary>
public sealed record GameAddAiRequest(Guid LobbyId, int Difficulty, string Strategy);
/// <summary>Create a spectatable AI-vs-AI match.</summary>
public sealed record GameAiMatchRequest(
int Difficulty1,
string Strategy1,
int Difficulty2,
string Strategy2);
/// <summary>Response after creating an AI-vs-AI match. Client sends game.spectate to watch.</summary>
public sealed record GameAiMatchResponse(
Guid SessionId,
string Player1Name,
string Player2Name);
public sealed record GameAddAiResponse(Guid AiAccountId, string AiDisplayName, int SeatIndex);
/// <summary>Host removes an AI player from a custom lobby.</summary>