diff --git a/Server/src/SOR.Game/Handlers/GameLobbyReadyHandler.cs b/Server/src/SOR.Game/Handlers/GameLobbyReadyHandler.cs index 9eb0c99..0879e71 100644 --- a/Server/src/SOR.Game/Handlers/GameLobbyReadyHandler.cs +++ b/Server/src/SOR.Game/Handlers/GameLobbyReadyHandler.cs @@ -232,11 +232,14 @@ internal sealed class GameLobbyReadyHandler : GameHandlerBase, IMessageHandler // If the lobby specifies a board template, load it and build a snapshot JSON string // that will be embedded in the rule snapshot so in-flight games are unaffected by later edits. + // Fallback chain: lobby override → admin custom-default ruleset → none. + var effectiveTemplateId = lobby.BoardTemplateIdOverride ?? dbDefaults?.BoardTemplateId; + string? boardTemplateJson = null; - if (lobby.BoardTemplateIdOverride.HasValue) + if (effectiveTemplateId.HasValue) { var tmpl = await _gameDb.BoardTemplates - .FindAsync(new object[] { lobby.BoardTemplateIdOverride.Value }, ct); + .FindAsync(new object[] { effectiveTemplateId.Value }, ct); if (tmpl is not null) { var tileOpts = new JsonSerializerOptions(JsonSerializerDefaults.Web);