-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commands and Identity
This page covers the config that changes commands, chat presentation, nametags, and Stratum identity.
- Config model:
sources/VintagestoryLib/Vintagestory.Server/StratumConfig.cs(Commands,Chat,Theme,Nametags) - Command runtime:
sources/VintagestoryLib/Vintagestory.Server/CmdStratum.cs,CmdStratumEssentials.cs,CmdStratumStaffCommands.cs,StratumCommandText.cs - Presentation/runtime helpers:
sources/VintagestoryLib/Vintagestory.Server/StratumChatFormatter.cs,StratumServerTheme.cs,StratumNametags.cs - Identity wiring:
sources/VintagestoryLib/Vintagestory.Server/ServerSystemStratum.cs
CmdStratum registers the root command:
server.api.commandapi.Create(StratumInfo.Id)
.WithAlias("serverinfo")
.WithDesc("Show Stratum server information")
...
.RequiresPrivilege(Privilege.controlserver)
.HandleWith(HandleStratum);HandleStratum routes subcommands including:
statushealthreloadpreflightpackets-
performance/perf timings-
players/player -
chunks,entities,queues violationsaccesschatpregen-
get,set,save
Status output comes from HandleStatus() and is composed with StratumCommandText:
output.Append(StratumCommandText.Row("Packet limits", "enabled=" + (config.PacketLimits.Enabled ? "on" : "off") + ", drop=" + (config.PacketLimits.DropViolations ? "on" : "off") + ", window=" + config.PacketLimits.WindowSeconds + "s"));
output.Append(StratumCommandText.Row("Performance", "chunkSending=" + (config.Performance.ChunkSending.Enabled ? "on" : "off") + ", chunkGeneration=" + (config.Performance.ChunkGeneration.Enabled ? "on" : "off") + ", pregen=" + (config.Performance.Pregen.Enabled ? "on" : "off") + ", entityTicking=" + (config.Performance.EntityTicking.Enabled ? "on" : "off") + ", autosaveSmoothing=" + (config.Performance.AutoSave.Enabled ? "on" : "off") + ", blockTicks=" + (config.Performance.BlockTicks.Enabled ? "on" : "off")));
output.Append(StratumCommandText.Row("Client mod policy", "enabled=" + (config.ClientModPolicy.Enabled ? "on" : "off") + ", strictWhitelist=" + (config.ClientModPolicy.StrictWhitelist ? "on" : "off") + ", allowExtras=" + config.ClientModPolicy.AllowModIds.Count));StratumChatFormatter is the runtime formatter for role tags and URL linkification.
Message body linkification gate:
if (!config.Chat.Enabled || !config.Chat.LinkifyUrls)
{
return message;
}Role-prefix formatting gate:
if (!config.Chat.Enabled || !config.Chat.RolePrefixesEnabled || player?.Role == null)
{
return false;
}StratumChatConfig also includes chat-rate controls (MinIntervalMs, DropDuplicates, DuplicateWindowMs, ExemptCommands) and info command text (RulesText, DiscordUrl, WebsiteUrl, MotdText).
StratumServerTheme renders themed text for join/leave/welcome/disconnect flows.
Each output path is guarded by config toggles under StratumThemeConfig:
StyleJoinLeaveMessagesStyleWelcomeMessagesStyleDisconnectScreens
Example gate:
if (!theme.Enabled || !theme.StyleJoinLeaveMessages)
{
return null;
}StratumNametags applies server-side nametag customization through join/disconnect hooks.
It can:
- prepend role tag text from
Chat.RolePrefixes - inject vanilla entitlement color codes by role
On join it calls Refresh(player), which applies prefix and entitlement injection according to StratumNametagsConfig.
It also exposes RefreshFor(IServerPlayer) for role-change refresh without reconnect.
Stratum also stamps its identity into World.Config during ServerSystemStratum.OnBeginRunGame:
server.World.Config.SetBool(StratumInfo.Id, true);
server.World.Config.SetString(StratumInfo.Id + "Version", StratumInfo.Version);
server.World.Config.SetString(StratumInfo.Id + "BaseGameVersion", StratumInfo.BaseGameVersion);That is the intended detection surface for both server and client mods.