DreamWeave: declare the Dereth network on the Network tab

ServerChatTab gains an optional ServerChatNetwork (kind, command);
BuildSectionsJson writes "network" inside the entry only when set.
DreamWeave sets ("dereth", "derethnetwork").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-11-15 10:23:30 -08:00
commit 24e0ec3683
4 changed files with 26 additions and 4 deletions

View file

@ -56,10 +56,15 @@ internal sealed record ServerSalvage(string Bench, int Material, string Effect,
/// <param name="GlobalRoom">The engine discovers which Global room is live and writes its prefix as the pattern.</param>
internal sealed record ServerChatRule(string Action, string When, string Mode, string Pattern, bool GlobalRoom = false);
/// <summary>The cross-world network a chat tab fronts: "dereth" with the server command that joins and sends (without the slash).</summary>
internal sealed record ServerChatNetwork(string Kind, string Command);
/// <summary>A default chat tab the server declares: a named tab with its rules, optionally pinned.</summary>
/// <param name="Id">Stable id within this server (lowercase letters, digits, dashes); owns the tab's rules.</param>
/// <param name="GlobalRoomFallback">The Global room used until one is discovered: "General", "Trade", "LFG" or "Roleplay".</param>
internal sealed record ServerChatTab(string Id, string Name, bool Pinned, string GlobalRoomFallback, ServerChatRule[] Rules);
/// <param name="Network">The network the tab fronts (join, status and sends go through its command); null = none.</param>
internal sealed record ServerChatTab(string Id, string Name, bool Pinned, string GlobalRoomFallback, ServerChatRule[] Rules,
ServerChatNetwork? Network = null);
internal sealed class ServerPackInfo
{

View file

@ -228,7 +228,10 @@ internal sealed class ServerPackModel
sb.Append(",\"pattern\":").Append(Q(rule.Pattern));
sb.Append(",\"globalRoom\":").Append(rule.GlobalRoom ? "true" : "false").Append('}');
}
sb.Append("]}");
sb.Append(']');
if (tab.Network != null)
sb.Append(",\"network\":{\"kind\":").Append(Q(tab.Network.Kind)).Append(",\"command\":").Append(Q(tab.Network.Command)).Append('}');
sb.Append('}');
}
sb.Append(']');
}