DreamWeave: declare the Dereth Network chat tab

ServerPackInfo gains ChatTabs (ServerChatTab / ServerChatRule records);
BuildSectionsJson writes "chatTabs" after "windows" only when non-empty.
DreamWeave declares the pinned Network tab: tells from name@world
speakers (in and out) plus the discovered Global room. Needs the RynthCore
chatTabs manifest parser (branch chat/server-tabs).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daniel Wallace 2026-11-15 08:28:04 -08:00
commit ac555572c7
4 changed files with 104 additions and 2 deletions

View file

@ -205,8 +205,34 @@ internal sealed class ServerPackModel
sb.Append('}');
// The server's own windows (ServerWindows, ServerPackWindows.cs, 2026-11-07).
if (windows != null) sb.Append(ServerPackWindows.Json(windows, info.Id, frameless));
sb.Append("]}");
return sb.ToString();
sb.Append(']');
// The server's default RynthChat tabs; an engine without chatTabs support ignores the key.
if (info.ChatTabs.Length > 0)
{
sb.Append(",\"chatTabs\":[");
for (int i = 0; i < info.ChatTabs.Length; i++)
{
ServerChatTab tab = info.ChatTabs[i];
sb.Append(i == 0 ? "" : ",").Append("{\"server\":").Append(Q(info.Id));
sb.Append(",\"id\":").Append(Q(tab.Id));
sb.Append(",\"name\":").Append(Q(tab.Name));
sb.Append(",\"pinned\":").Append(tab.Pinned ? "true" : "false");
sb.Append(",\"globalRoomFallback\":").Append(Q(tab.GlobalRoomFallback));
sb.Append(",\"rules\":[");
for (int j = 0; j < tab.Rules.Length; j++)
{
ServerChatRule rule = tab.Rules[j];
sb.Append(j == 0 ? "" : ",").Append("{\"action\":").Append(Q(rule.Action));
sb.Append(",\"when\":").Append(Q(rule.When));
sb.Append(",\"mode\":").Append(Q(rule.Mode));
sb.Append(",\"pattern\":").Append(Q(rule.Pattern));
sb.Append(",\"globalRoom\":").Append(rule.GlobalRoom ? "true" : "false").Append('}');
}
sb.Append("]}");
}
sb.Append(']');
}
sb.Append('}'); return sb.ToString();
}
/// <summary>