Skip to content

Commands and Identity

Tsu edited this page Jun 5, 2026 · 2 revisions

This page covers the config that changes commands, chat presentation, nametags, and Stratum identity.

Source of Truth

  • 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

Command Root

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:

  • status
  • health
  • reload
  • preflight
  • packets
  • performance / perf
  • timings
  • players / player
  • chunks, entities, queues
  • violations
  • access
  • chat
  • pregen
  • 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));

Chat

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).

Theme

StratumServerTheme renders themed text for join/leave/welcome/disconnect flows.

Each output path is guarded by config toggles under StratumThemeConfig:

  • StyleJoinLeaveMessages
  • StyleWelcomeMessages
  • StyleDisconnectScreens

Example gate:

if (!theme.Enabled || !theme.StyleJoinLeaveMessages)
{
	return null;
}

Nametags

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.

Identity

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.

Related References

Clone this wiki locally