Skip to content

About

Superuser: A powerful administration library for s&box.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Repository files navigation

Superuser

Administration for s&box dedicated servers.

github

This library gives an s&box game a complete administration layer of commands, permissions, moderation, audit and storage, running inside the game's own dedicated server process. Players reach it through the console, slash commands in chat, or an optional in-game moderation menu.

The Superuser admin menu in game: active bans and mutes with time left, recent chat, commands, the audit log and About

Add the local library to your game, then one Superuser Bootstrap to its network scene:

notpointless.chomnr_sbox_superuser

Engine support: verified on s&box 26.10.13a
Release notes


Guide

Please see docs for a tutorial, reference material, and example code.


Overview

Every request carries the engine's own record of who sent it. The host decides what that player may do, records the attempt before acting, runs the command and replies privately to the sender. Nothing about a player's authority is taken from the message itself.

Superuser does not know what a "player" means in your game. Gameplay commands come from your code, registered as modules with their own permission keys; the library supplies routing, authorization, the audit trail and storage around them. Two sample games with nothing in common, one built on pawns and one on a roster, use it unchanged.


Example

A command returns a result. Superuser checks the caller's permission and sends the reply privately.

[AdminCommand( Name = "ping", Description = "Reply with Pong!", Permission = "example.ping",
	ModuleId = "example.ping", ExecutionPolicy = CommandExecutionPolicy.ReadOnly )]
public static CommandResult Ping( CommandContext context )
{
	return new CommandResult( CommandStatus.Success, "Pong!" );
}

This method belongs to the complete ping module. Follow the tutorial to register it, then enter /admin ping in the chatbox or admin ping in the console.


Details

  • Commands use one dispatcher for the console, platform chat, your own chat backend and the admin menu. Typed arguments, private replies, retries by request ID. Reference.

  • Permissions are exact keys on groups and players, denied until granted. Owners are configured by the host; policy changes are owner-only, and owners cannot punish each other. Reference.

  • Moderation covers kick, ban, warnings, mute, voice gag and staff notes, with persistent history and original UTC expiry kept across restarts.

  • Audit records every attempt before it runs and its outcome after. An outcome that cannot be confirmed is Unknown, never success.

  • Storage is versioned and recoverable, local by default, replaceable with your own backend. Reference.

  • Prefixes put a styled, animated tag in front of names, for groups or single players, in the chat box and anywhere your UI asks. Effects are short scripts written and previewed in the menu, with World at War presets. On by default. Guide.

  • Modules load themselves from the game's Code/Superuser/Modules folder, add their own windows to the admin menu, and get the same in-game documentation pages: overview, guides, generated commands and permissions. Two examples. Reference.

  • The Superuser facade is the whole public API: dispatch commands, check permissions, register modules, select storage and request private admin views. Reference.


Admin menu

Add Superuser Admin Menu on clients and press P. Disable it to use your own interface; console and chat keep working.

WindowWhat it does
PlayersSearch and warnings; clicking a player opens their restrictions, history, notes and recent chat in a separate window
Bans & mutesEvery active restriction across all players, with time left and revoke buttons
ChatThe last 100 public messages, kept in server memory only
CommandsAny permitted command, including your game's own, from a generated form
ActivityThe audit log, filtered by command, actor and outcome
PermissionsOwners edit groups, members and permission entries
PrefixesCreate, style and assign prefixes; write effects in the built-in code editor
DocumentationEvery module's guides, commands and permissions

Windows can be pinned to stay on screen while you play; layout and pins survive a restart. Reference.


License

Licensed under the MIT license.

Bundled ImGui code keeps its own MIT license. See third-party notices.

About

Superuser: A powerful administration library for s&box.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages