Home Guides Tools Server Toolkit

Server Toolkit

The sboxlist plugin is a free, open-source C# library (prioxystudios.sboxlist, MIT license) for s&box servers. It shows your server's live status on sboxlist and can pay vote rewards in game. It only makes outgoing HTTPS requests, so you do not need to open a port.

Live statusYour server reports its players, map and uptime every minute and gets the Plugin-Verified label.
No open portsWorks behind a router, in Docker and on Valve SDR Relay. A Pterodactyl egg is included.
Vote rewardsGive voters money or items with a few lines of C#. Players who voted while offline get theirs when they join.

Download

Or add it in the s&box Editor's Library Manager with this package ID:

Package ID
prioxystudios.sboxlist

Jump to: Install · Connect your server · Config builder · Rewards · Player names · Console commands · How it works · Questions · Missing something?

Install

s&box compiles the library into your game package. You need no C# for the built-in chat, toast and console rewards.

Three ways to add it

Your setupWhat to useHow it reaches your server
Editor Library Managerprioxystudios.sboxlistAdd the library to your .sbproj, add SboxlistService to your startup scene and publish to sbox.game. Any server that starts +game org.ident runs it.
The .zip filesboxlist-library-1.0.0.zipUnpack it into <your-project>/Libraries/sboxlist/ so sboxlist.sbproj and Code/ sit directly in that folder. Works for published and for local, unpublished projects.
Linux, Docker or Pterodactylpterodactyl-egg-sbox.jsonImport the Pterodactyl egg for sbox-server (SteamCMD App 1892930), start your game package, and put sboxlist.json in /home/container/data/<org>/<game>/sboxlist.json.
  1. Add the library in one of the three ways above. If you unzipped it, check that Libraries/sboxlist/sboxlist.sbproj sits directly in that folder, not one level deeper.
  2. Open the .scene your server starts with.
  3. Create an empty GameObject (SboxlistHost, for example) and add the SboxlistService component. On the host it runs the heartbeats, the vote polls and the payouts when a player joins; on clients it does nothing.
  4. Press Play and run sbl_hmac_selftest in the console. It checks the RFC 4231 vector and the protocol v1 vector, and should print PASS for both.
  5. Save the scene. If your dedicated server downloads your game from sbox.game, publish it.

Optional, without C#: on SboxlistService in the Inspector you can turn on AnnounceVotesInChat, and set VotePartyGoal (25, for example) and VotePartyConsoleCommand. Add SboxlistToastHud to the same GameObject for reward cards in the top right (DisplaySeconds = 6, with a SuppressDefaultChat toggle). If you use chat rewards through Sandbox.Platform.Chat, open Project Settings -> Platform and turn on Chat Enabled and Chat Show UI.

Connect your server

  1. Claim your server on sboxlist: put the one-time sbl-CODE in your +hostname. The claim guide has the steps.
  2. Open your server in your owner pages, click New server secret and copy the sbs_ secret. The page shows it only once.
  3. Start the server once and read the console line [sboxlist] config file path: .... On a dedicated server the path is <server-root>/data/<org>/<game>/sboxlist.json, in Pterodactyl /home/container/data/<org>/<game>/sboxlist.json, and for a local project in the Editor <sbox-root>/data/local/<ident>#local/sboxlist.json.
  4. Save the sboxlist.json from the config builder at that path. In a container without a file, pass +sbl_base_url "https://sboxlist.com/api" +sbl_server_id "<UUID>" +sbl_token "sbs_..." on your sbox-server startup line instead.
  5. Run sbl_reload and then sbl_status in the server console. It should say online and heartbeat accepted.
  6. Click Send a test vote on your server's Setup check page.

Config builder

Fill in the form to get your sboxlist.json and, if you want it, the C# for rewards. The builder never asks for your server secret; you paste your real sbs_ secret only on your own server.

Or start from a preset:

sboxlist.json

Save this file on your server disk at <server-root>/data/<org>/<game>/sboxlist.json, never in Assets/ or a published Workshop package. Replace sbs_PASTE_YOUR_SERVER_SECRET_HERE with the server secret from your owner pages, then run sbl_reload.

JSON (FileSystem.Data)
{
  "sites": [
    {
      "siteId": "sboxlist.com",
      "baseUrl": "https://sboxlist.com/api",
      "serverId": "00000000-0000-4000-8000-000000000000",
      "token": "sbs_PASTE_YOUR_SERVER_SECRET_HERE",
      "auth": "hmac",
      "rewards": true
    }
  ],
  "debug": false
}

C# rewards

Put this file in your game project's Code/ folder. If it uses Sboxlist.ISboxlistListener, add GamemodeVoteRewards to a GameObject in your startup scene.

C# (Code/)
using Sandbox;

public sealed class GamemodeVoteRewards : Component, Sboxlist.ISboxlistListener
{
    private int _partyCounter;

    protected override void OnStart()
    {
        // Optional: let built-in chat/toast & SboxlistService announcements use your RP character names automatically
        Sboxlist.SboxlistPlayerMessages.CustomNameResolver = GetCustomCharacterName;
    }

    public void OnVoteReceived( Sboxlist.VoteInfo vote )
    {
        if ( vote.IsTest ) return;
        var voterName = GetCustomCharacterName( vote.OnlinePlayer )
            ?? vote.OnlinePlayer?.DisplayName
            ?? (vote.IdentityKind == "name" ? vote.IdentityKey : "A player");
        _partyCounter++;
        Sboxlist.SboxlistPlayerMessages.BroadcastChat(
            $"[Vote] {voterName} voted on {vote.SiteId}! ({_partyCounter}/10 to Vote Party)"
        );
        if ( _partyCounter >= 10 )
        {
            _partyCounter = 0;
            Sboxlist.SboxlistPlayerMessages.BroadcastToast( "VOTE PARTY UNLOCKED! Bonus reward for everyone online!" );
        }
    }

    public void OnVoteReward( Sboxlist.RewardInfo reward )
    {
        if ( reward.Player is null )
        {
            reward.Refuse( "player disconnected before payout" );
            return;
        }

        reward.Handled = true;
        var recipientName = GetCustomCharacterName( reward.Player ) ?? reward.Player.DisplayName;
        if ( reward.Kind == "currency" && reward.Payload == "darkrp_cash" )
        {
            // Credit reward.Player with reward.Amount in your wallet component
            Sboxlist.SboxlistPlayerMessages.SendTo( reward.Player, "toast", $"{recipientName}: +{reward.Amount} darkrp_cash" );
            return;
        }
        if ( reward.Kind == "item" && reward.Payload == "starter_crate" )
        {
            // Grant item to reward.Player inventory (or call reward.Refuse("inventory full") on failure)
            Sboxlist.SboxlistPlayerMessages.SendTo( reward.Player, "chat", $"Received {reward.Amount}x starter_crate!" );
            return;
        }

        reward.Refuse( $"unsupported reward {reward.Kind}:{reward.Payload}" );
    }

    // Also fires if you set VotePartyGoal > 0 directly on the SboxlistService component in the Editor Inspector:
    public void OnVoteParty( Sboxlist.VotePartyInfo party )
    {
        Log.Info( $"Vote Party reached ({party.TargetVotes} votes, {party.TotalVotes} total)!" );
    }

    private string GetCustomCharacterName( Connection player )
    {
        if ( player is null ) return null;
        // Look up player.SteamId in your DarkRP / Roleplay character table and return their IC name:
        return null;
    }
}

HUD file (CustomVoteHud.razor)

Put CustomVoteHud.razor in Code/UI/ and add it to your HUD ScreenPanel. It hides the default 8-second Platform.Chat lines (notification.Handled = true), sends chat notices to your own chatbox and shows reward cards with a sound.

Razor (CustomVoteHud.razor)
@using System.Collections.Generic
@using Sandbox
@using Sandbox.UI
@inherits PanelComponent
@implements Sboxlist.ISboxlistNotificationListener

<root>
    @foreach ( var item in _toasts )
    {
        <div class="vote-toast @(item.IsBroadcast ? "broadcast" : "")">
            <span class="badge">@(item.IsBroadcast ? "PARTY" : "REWARD")</span>
            <span class="message">@item.Text</span>
        </div>
    }
</root>

@code
{
    private sealed class ToastEntry
    {
        public string Text;
        public bool IsBroadcast;
        public RealTimeUntil ExpiresIn;
    }

    private readonly List<ToastEntry> _toasts = new();

    public void OnVoteNotification( Sboxlist.VoteNotification notification )
    {
        notification.Handled = true; // Suppress default 8s Platform.Chat fallback
        if ( notification.Kind == "chat" )
        {
            // Forward into your custom Roleplay / gamemode chatbox:
            Log.Info( $"[CustomChat] {notification.Text}" );
            return;
        }
        Sound.Play( "ui.button.over" );
        _toasts.Add( new ToastEntry { Text = notification.Text, IsBroadcast = notification.IsBroadcast, ExpiresIn = 7.0f } );
        StateHasChanged();
    }

    protected override void OnUpdate()
    {
        if ( _toasts.RemoveAll( x => x.ExpiresIn ) > 0 ) StateHasChanged();
    }
}

Startup flags instead of a file

Rather not use a sboxlist.json file, for one site? Pass these ConVars on your sbox-server command line:

Shell
+sbl_base_url "https://sboxlist.com/api" +sbl_server_id "00000000-0000-4000-8000-000000000000" +sbl_token "sbs_PASTE_YOUR_SERVER_SECRET_HERE"

Rewards

You can set up to 20 reward rules per server. A rule fires on every vote (every_vote), on a 7-day streak (streak_7d) or on a 30-day streak (streak_30d). Chat and toast rewards need no code. For money and items, implement Sboxlist.ISboxlistListener on the host, and call reward.Refuse(reason) when a payout fails. For your own HUD or chatbox, implement Sboxlist.ISboxlistNotificationListener on the client.

Reward kindNeeds C#?Example What to give (payload)What happens on your server
chatNoThanks for voting, {name}!A host-only RPC to the voter (Rpc.FilterInclude), shown through Platform.Chat or your own listener.
toastNoVote reward: +{amount} coinsA card in the top right through SboxlistToastHud or your own .razor ISboxlistNotificationListener.
console[ConCmd]rp_give_vote_cash {steamid} {amount}Runs your C# [ConCmd] on the host through ConsoleSystem.Run. Test it right away with the built-in sbl_test_reward {steamid} {amount}.
currencyYesdarkrp_cashCalls Sboxlist.ISboxlistListener.OnVoteReward. Call reward.Refuse(reason) if the payout fails, and the reason shows up in your owner pages.
itemYesstarter_crateCalls Sboxlist.ISboxlistListener.OnVoteReward with reward.Player, reward.Payload and reward.Amount.

Player names in reward messages

NameWhere you set itHow it works
Voter names ({name} and {steamid})The vote page and the placeholders in your reward rulesPlayers vote with Steam (17-digit {steamid}) or by typing their in-game name (1–32 characters, {name}). When a voter is online on the server, {steamid} and {name} fall back to their Connection.SteamId and Connection.DisplayName, so one [ConCmd] console rule works for Steam and Name voters. In console rules, {name} is wrapped in double quotes ("PlayerName") and refused if it contains ;, quotes, backticks, backslashes or control characters. If a Steam player's DisplayName is longer than 32 Unicode characters, SboxlistService sends a SteamID-only join (playerName: null) so Steam votes still pay out.
Roleplay character namesC#: Sboxlist.ISboxlistListener or CustomNameResolverSet Sboxlist.SboxlistPlayerMessages.CustomNameResolver = player => ... once at startup (or read vote.OnlinePlayer / reward.Player inside ISboxlistListener), and the built-in chat, toast and Vote Party messages show the player's character name.
Currency and item namesWhat to give (payload) on your Rewards pageEnter any name (1–200 characters, such as darkrp_cash, vip_tokens, gems, starter_crate or weapon_katana) and match reward.Payload inside OnVoteReward.

Console commands

CommandWhat it does on the host
sbl_statusPrints the library version (1.0.0), the config file path, Vote Party progress, the connection state per site (online / STOPPED), the last HTTP code and the vote and reward counters.
sbl_votePrints the link to your server's vote page. In C#, call SboxlistService.Instance?.SendVoteLink(player) from your !vote chat command.
sbl_reloadReloads sboxlist.json from FileSystem.Data without a restart, and keeps the list of votes already paid.
sbl_hmac_selftestChecks the RFC 4231 and protocol v1 HMAC-SHA256 test vectors offline (prints PASS).
sbl_heartbeatSends a signed heartbeat on the next server frame.
sbl_infoAsks the optional GET /v1/info endpoints and checks the host clock (it must stay within ±300 s of UTC).
sbl_test_rewardA safe built-in [ConCmd] (sbl_test_reward {steamid} {amount}) to test console reward rules before you write C#.
sbl_debug 1Logs outgoing JSON bodies and HTTP status codes (sbl_debug 0 turns it off). It never logs your sbs_ secret.

How it works

PartRoute and intervalWhat happens on your server
HeartbeatsPOST /v1/heartbeat (every 60 s)Reports the player count, max slots, map, game package and uptime, signed with RFC 2104 HMAC-SHA256 (x-sbl-signature) and a single-use nonce (±300 s replay window).
Vote polls and acksPOST /v1/votes/poll (every 15 s) + /v1/votes/ackFetches new Steam and Name votes, remembers up to 2,000 vote IDs so a retry never pays twice, fires OnVoteReceived for Vote Parties, and confirms delivery.
Online and offline rewardsPOST /v1/rewards/joinPays voters who are online right away (reason: "vote"), and voters who were offline the next time they finish joining your server (Component.INetworkListener.OnActive, reason: "join").
Code whitelist and several sites0 SB1000 violationsUses only whitelisted SHA256.HashData, Guid.NewGuid and Http.RequestAsync. Each entry in sites has its own queue and backoff timer (15 s to 300 s).

Questions

Do I need to open a port?

No. The plugin only makes outgoing HTTPS requests (443/tcp) to sboxlist.com. Your game port (27015/udp) and Steam query port (27016/udp) stay as they are.

Does it work behind NAT, Docker, DDoS protection or a reverse proxy?

Yes. Your server starts every request itself, so it works behind home NAT, CGNAT, Docker bridge networks, Pterodactyl Wings and DDoS-filtered VPS firewalls.

If you send the requests through your own HTTPS reverse proxy (Nginx, Caddy, Cloudflare, Traefik) or add another protocol-v1 site to sites, three rules apply: (1) baseUrl uses https:// with a domain name (s&box blocks raw IP addresses; http://localhost is only for local testing), (2) never answer /api/v1/* routes with a 301, 302 or 303 redirect (a redirected POST turns into a GET and loses its auth headers), and (3) pass all x-sbl-* headers and the raw UTF-8 JSON body through unchanged, so the SHA-256 body signature stays valid.

Does my game need to be on the Workshop?

No. The library is compiled into your game package. If you publish the game on sbox.game, every server that runs it has the plugin. A local, unpublished .sbproj project works too.

Never put sboxlist.json or your sbs_ secret in Assets/, Code/, a .scene, a .prefab or a published Workshop package. Keep sboxlist.json on your server's own disk in FileSystem.Data (<server-root>/data/<org>/<game>/sboxlist.json).

What happens when a player votes while offline?

The vote counts on the leaderboard right away and the reward waits. When the player next joins your server, SboxlistService pays it (through Component.INetworkListener.OnActive and POST /v1/rewards/join): chat, toast, console, currency or item.

The install guide has the same steps with more detail, the C# examples and a Pterodactyl checklist. To build your server's launch command, use the server configurator.

Missing something?

Open an issue on GitHub or send us a message. Say which game mode you run and what you need.