From 210d423de631cc04deaf0e875eac5b1f63c3616c Mon Sep 17 00:00:00 2001 From: dingo Date: Mon, 13 Apr 2026 13:03:45 -0400 Subject: [PATCH] refactor: move AI match creation to admin-only Blazor page Removes game.ai.create_match WebSocket handler (no longer accessible to clients) and replaces it with AiMatchService injected directly into a new admin Blazor page at /ai/matches. Admin portal gains NATS publish capability (SOR.Networking.Nats project reference + AddNats) so AiMatchService can emit GameStartedEvent to trigger AiPlayerSessionManager. AiDeckResolver is made public for admin injection. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../SOR.Admin/Components/Layout/NavMenu.razor | 5 + .../Components/Pages/Ai/AiMatchPage.razor | 167 ++++++++++++++++++ Server/src/SOR.Admin/Program.cs | 14 ++ Server/src/SOR.Admin/SOR.Admin.csproj | 1 + Server/src/SOR.Ai/Lobby/AiDeckResolver.cs | 2 +- Server/src/SOR.Ai/Lobby/AiMatchService.cs | 150 ++++++++++++++++ Server/src/SOR.Ai/ServiceRegistration.cs | 4 +- Server/src/SOR.Game/GameMessages.cs | 13 -- 8 files changed, 341 insertions(+), 15 deletions(-) create mode 100644 Server/src/SOR.Admin/Components/Pages/Ai/AiMatchPage.razor create mode 100644 Server/src/SOR.Ai/Lobby/AiMatchService.cs diff --git a/Server/src/SOR.Admin/Components/Layout/NavMenu.razor b/Server/src/SOR.Admin/Components/Layout/NavMenu.razor index 282d077..4682e41 100644 --- a/Server/src/SOR.Admin/Components/Layout/NavMenu.razor +++ b/Server/src/SOR.Admin/Components/Layout/NavMenu.razor @@ -188,6 +188,11 @@ Neural Model +