diff --git a/src/RynthCore.Engine/UI/Sections/SectionManifest.cs b/src/RynthCore.Engine/UI/Sections/SectionManifest.cs index 95942d5..86a4f55 100644 --- a/src/RynthCore.Engine/UI/Sections/SectionManifest.cs +++ b/src/RynthCore.Engine/UI/Sections/SectionManifest.cs @@ -68,7 +68,8 @@ // "pattern": "...", "globalRoom": false } ] } ]. // "server" and "id" are ids (the owner key is "server/id"); "action" is copy // or move; "globalRoomFallback" is General, Trade, LFG or Roleplay (the -// room a "globalRoom": true rule matches until chat shows another). An +// room a "globalRoom": true rule matches until chat shows another; absent: +// Roleplay, the room the Dereth Network README names as usual). An // entry with a bad field is dropped and reported in the parse error (the // other keys still parse); at most MaxChatTabs entries of MaxChatRules // rules each. Engines before this ignore the key. @@ -341,7 +342,7 @@ internal static class SectionManifestParser string name = Text(Str(e, "name"), MaxLabelLength); if (name.Length == 0) { why = "missing name"; return null; } string fallback = Str(e, "globalRoomFallback").Trim(); - string room = fallback.Length == 0 ? "General" : GlobalRooms.FirstOrDefault(r => r.Equals(fallback, StringComparison.OrdinalIgnoreCase)) ?? string.Empty; + string room = fallback.Length == 0 ? "Roleplay" : GlobalRooms.FirstOrDefault(r => r.Equals(fallback, StringComparison.OrdinalIgnoreCase)) ?? string.Empty; if (room.Length == 0) { why = "globalRoomFallback is not General, Trade, LFG or Roleplay"; return null; } var rules = new List(); foreach (JsonElement r in Array(e, "rules")) diff --git a/tools/SectionsTests/Program.cs b/tools/SectionsTests/Program.cs index 0d66f61..aa3a9d2 100644 --- a/tools/SectionsTests/Program.cs +++ b/tools/SectionsTests/Program.cs @@ -613,6 +613,8 @@ internal static class Program Check(t.Rules[0].Action == "copy" && t.Rules[0].When == "type:3" && t.Rules[0].Pattern == "^x" && !t.Rules[0].GlobalRoom, "rule 0 fields"); Check(SectionManifestParser.Parse("DW", """{ "contributions": [] }""", out _).ChatTabs.Length == 0, "no chatTabs key = empty array"); + var noFallback = SectionManifestParser.Parse("DW", """{ "chatTabs": [ { "server": "dw", "id": "a", "name": "A", "rules": [] } ] }""", out _); + Check(noFallback.ChatTabs.Length == 1 && noFallback.ChatTabs[0].GlobalRoomFallback == "Roleplay", "absent globalRoomFallback = Roleplay"); // Each reject drops the entry, reports it in error, and still parses the other keys. string section = """ "sections": [ { "id": "quests", "label": "Quests", "order": 150 } ] """;