From affd251b10bf43f6ccb54fa43bf98d85087d8509 Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 14 Apr 2026 20:39:31 -0400 Subject: [PATCH] feat(admin): add hex grid controls and block same-AI match creation AiMatchPage: - Add Grid Type dropdown (Square / Hexagon) and HexSides input (shown only when Hexagon selected) to the Board section, wired to GridType and HexSides in GameRules. - Add SameAi computed property: true when both players share the same difficulty + strategy (i.e. resolve to the same account GUID). - Show a warning banner and disable the Create button when SameAi, preventing the broken game state that occurs when a player is matched against itself. AiMatchService: - Server-side guard: throw ArgumentException if id1 == id2 so the broken state is impossible even if the UI check is bypassed. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- .../Components/Pages/Ai/AiMatchPage.razor | 29 ++++++++++++++++++- Server/src/SOR.Ai/Lobby/AiMatchService.cs | 5 ++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Server/src/SOR.Admin/Components/Pages/Ai/AiMatchPage.razor b/Server/src/SOR.Admin/Components/Pages/Ai/AiMatchPage.razor index eece5bb..68f9cb7 100644 --- a/Server/src/SOR.Admin/Components/Pages/Ai/AiMatchPage.razor +++ b/Server/src/SOR.Admin/Components/Pages/Ai/AiMatchPage.razor @@ -58,6 +58,12 @@ + @if (SameAi) + { +
+ Both players resolve to the same AI account. Change the difficulty or strategy for one player. +
+ } @@ -132,6 +138,20 @@ +
+ + +
+ @if (_rules.GridType == "Hexagon") + { +
+ + +
+ }