Home Guides Install the sboxlist plugin

How to install the sboxlist plugin and set up vote rewards

Updated

Install the sboxlist plugin, connect it to your server and set up vote rewards.

sboxlist plugin 1.0.0 (MIT license): Download sboxlist-library-1.0.0.zip (the C# library, for Libraries/sboxlist/) · Download pterodactyl-egg-sbox.json (Pterodactyl egg) · Server Toolkit page (config builder) · Source and PROTOCOL.md on GitHub ↗ · s&box Workshop (prioxystudios.sboxlist) ↗

What the plugin does

The plugin does two things. Every minute it tells sboxlist that your server is up, with its player count and map. Every 15 seconds it asks whether anyone voted, and pays the reward: right away if the player is online, otherwise the next time they join.

It is an open-source C# library (prioxystudios.sboxlist, version 1.0.0, MIT license) for s&box dedicated servers and hosted lobbies. s&box compiles it into your game package when you publish, and it only uses API calls that the s&box code whitelist allows.

Where to get it:

  • Download sboxlist-library-1.0.0.zip and unpack it into <your-project>/Libraries/sboxlist/, so sboxlist.sbproj and Code/ sit directly in that folder. The zip holds the full C# source, docs/DEVELOPER-WIKI.md and PROTOCOL.md. The source is also on GitHub: github.com/priqxy/sboxlist-plugin.
  • Or add prioxystudios.sboxlist in the s&box Editor's Library Manager. It goes into your .sbproj, so a dedicated server that starts +game myorg.mygame runs it.
  • For Pterodactyl, import the egg: pterodactyl-egg-sbox.json. It is set up for SteamCMD app 1892930, streams the live console and shuts down cleanly with ^C.
  • The Server Toolkit page builds sboxlist.json, GamemodeVoteRewards.cs, CustomVoteHud.razor and the startup flags for you. It never asks for your secret.

1. Install

You need no C# for the built-in chat, toast and console rewards.

  1. Add the library. Either add prioxystudios.sboxlist in the Editor's Library Manager, or unzip sboxlist-library-1.0.0.zip into <your-project>/Libraries/sboxlist/. Check that 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.
  4. Press Play and run sbl_hmac_selftest in the console. It checks the RFC 4231 vector and the protocol v1 signature vector, and should print PASS for both.
  5. Save the scene. If your dedicated server downloads your game from sbox.game, publish it.

Optional:

  • Add SboxlistToastHud to the same GameObject to show toast rewards as a card in the top right, without writing your own Razor UI (DisplaySeconds = 6; SuppressDefaultChat = true hides the duplicate chat line).
  • If you use chat rewards through Sandbox.Platform.Chat, open Project Settings -> Platform (ProjectSettings/Platform.config) in the Editor and turn on Chat Enabled and Chat Show UI.

On the host, SboxlistService runs the heartbeat, the vote polls, the acknowledgments and the payouts when a player joins, and remembers up to 2,000 vote IDs so no vote is paid twice. On clients it does nothing.

2. Connect your server

The plugin needs to know which server it is and how to sign its requests. That goes in one file, sboxlist.json.

  1. Claim your server. The claim guide shows how.
  2. On your servers page, click New server secret and copy the secret. The page shows it only once.
  3. Start the server once. The console prints a line that begins with [sboxlist] config file path. That is where the file goes: <server-root>/data/<org>/<game>/sboxlist.json on a dedicated server, /home/container/data/<org>/<game>/sboxlist.json in Pterodactyl, and <sbox-root>/data/local/<ident>#local/sboxlist.json for an unpublished project in the Editor.
  4. Save sboxlist.json at that path, with your server ID and your secret filled in. The secret page and the Setup check page both give you a copy with your server ID already in it; it looks like the example below.
  5. In the server console, run sbl_reload and then sbl_status. It should say online.
  6. On your server's Setup check page, click Send a test vote.
{
  "sites": [
    {
      "siteId": "sboxlist.com",
      "baseUrl": "https://sboxlist.com/api",
      "serverId": "YOUR-SERVER-UUID-FROM-SBOXLIST",
      "token": "sbs_YOUR_ONE_TIME_SERVER_SECRET",
      "auth": "hmac",
      "rewards": true
    }
  ],
  "debug": false
}

Also good to know:

  • No file? In a container you can pass the same settings as startup flags instead: leave out sboxlist.json and add +sbl_base_url "https://sboxlist.com/api" +sbl_server_id <UUID> +sbl_token sbs_... to the sbox-server command line. This works for one site.
  • Console commands on the host: sbl_status (site status, last HTTP code and counters), sbl_reload (reloads sboxlist.json and keeps the list of paid votes), sbl_hmac_selftest (checks the signing offline), sbl_heartbeat (sends a heartbeat now), sbl_info (checks that the clock is within ±300 s), sbl_test_reward (a built-in [ConCmd] to test console rewards) and sbl_debug 1 (logs every request, never your secret).
  • sites is a JSON array, so one server can report to sboxlist.com and to other protocol-v1 lists at the same time, each with its own queue and backoff (15 s to 300 s).

Do I need to open a port?

No. The plugin only makes outgoing HTTPS requests (443/tcp) to "https://sboxlist.com/api". Your game port (+port 27015/udp) and query port (+net_query_port 27016/udp) stay as they are, and the plugin 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 or Traefik), or run your own protocol-v1 endpoint for another list, keep the raw body and the x-sbl-* headers intact. An Nginx example:

# Example Nginx reverse-proxy block for a custom HTTPS protocol-v1 endpoint
location /api/v1/ {
    proxy_pass http://127.0.0.1:8080/api/v1/;
    proxy_http_version 1.1;
    proxy_pass_request_headers on;
    proxy_pass_request_body on;
    # Never return 301/302 redirects on POST /api/v1/* routes
}

Three rules for the proxy:

  • Use https:// with a domain name in baseUrl: s&box blocks raw IP literals and private/loopback IP ranges in Http.RequestAsync (http://localhost is allowed only on ports 80, 443, 8080, 8443 or when launched with -allowlocalhttp for local testing).
  • Do not issue 301, 302, or 303 HTTP redirects on /api/v1/* routes: .NET HTTP clients convert redirected POST requests into GET requests and strip authentication headers. Point baseUrl directly at the final https:// endpoint.
  • Pass the raw UTF-8 JSON body and x-sbl-* headers (x-sbl-server, x-sbl-timestamp, x-sbl-nonce, x-sbl-protocol, x-sbl-signature) through your reverse proxy unmodified so the SHA-256 body digest inside x-sbl-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 dedicated server that starts it (+game myorg.mygame) runs SboxlistService, with nothing extra to mount on the server. An unpublished local .sbproj project works too, from the Editor or on a local dedicated server.

Where sboxlist.json goes:

  • Never place sboxlist.json or your sbs_ secret inside Assets/, Code/, a .scene, a .prefab, or a published Workshop package; anything inside your project assets is downloadable by clients.
  • Always keep sboxlist.json inside FileSystem.Data (<server-root>/data/<org>/<game>/sboxlist.json) on your dedicated server disk, which stays strictly on the host machine.

Player names in reward messages

Players voting on sboxlist can identify themselves either by signing in with Steam (identityKind == "steam", matched by their 17-digit SteamID64) or by typing their in-game name (identityKind == "name", 1 to 32 characters, matched against Connection.DisplayName). If a Steam player’s Connection.DisplayName is longer than 32 Unicode characters, SboxlistService automatically sends a SteamID-only join (playerName: null, steamId: "7656119...") so Steam votes still pay out reliably.

Names come in through placeholders in rules without code ({name} and {steamid}), through roleplay character names you look up in C# (reward.Player / vote.OnlinePlayer), and through your own currency or item names in the What to give (payload) field on your server's Rewards page.

How each one works:

  • Placeholder {name} in chat and toast rules: replaced automatically with the player’s live Connection.DisplayName (or the typed voter name).
  • Placeholders {steamid} and {name} in console ([ConCmd]) rules: {steamid} is allowed for Steam voters (17 digits); {name} is allowed for Name voters, wrapped automatically in double quotes ("PlayerName"), and refused if the name contains quotes, ;, backticks, backslashes, or control characters.
  • Custom RP character names in C#: inside OnVoteReceived(VoteInfo vote) or OnVoteReward(RewardInfo reward), read vote.OnlinePlayer or reward.Player (Sandbox.Connection) to look up the player’s custom DarkRP/roleplay character name in your own database before broadcasting to chat.
  • Currency and item names (payload): on your server's Rewards page, choose Currency or Item and type any name (1..200 characters, such as darkrp_cash, vip_tokens, gems or weapon_katana) into What to give, then match reward.Payload in C#.

Built-in rewards and console commands

On your server's Rewards page you can combine up to 20 rules across five reward types: Chat message, Toast, Console command, Currency and Item. A rule fires on every vote (every_vote, daily), on every 7 days in a row (streak_7d) or on every 30 days in a row (streak_30d).

A Console command rule can run your own C# game commands ([ConCmd]); s&box blocks engine and Protected commands. Define a [ConCmd] in your game project and use {steamid} (for Steam voters) or {name} (for Name voters) together with {amount} (1..1,000,000):

using Sandbox;

public static class VoteConsoleCommands
{
    // Dashboard rule 1 (Steam voters): rp_give_vote_cash {steamid} {amount}
    [ConCmd( "rp_give_vote_cash" )]
    public static void GiveVoteCash( string steamId, int amount )
    {
        if ( !Networking.IsHost ) return;
        Log.Info( $"Crediting {amount} cash to SteamID {steamId}" );
    }

    // Dashboard rule 2 (Name voters): rp_give_name_bonus {name} {amount}
    [ConCmd( "rp_give_name_bonus" )]
    public static void GiveNameBonus( string playerName, int amount )
    {
        if ( !Networking.IsHost ) return;
        Log.Info( $"Crediting {amount} cash to player {playerName}" );
    }
}

Rewards in C#: money, items and vote parties

For wallets, saved inventories, roleplay character names or server-wide Vote Parties, implement Sboxlist.ISboxlistListener on any Component or GameObjectSystem in the active scene. It uses s&box’s own ISceneEvent<T> dispatch, so hot-reloading C# in the Editor leaves no stale event handlers behind.

When a currency or item reward cannot be given (the player’s backpack is full, or an item name was mistyped on the Rewards page), call reward.Refuse(reason). The library sends ok: false with your message (up to 200 characters) in POST /v1/votes/ack, and the reason shows up in the log on your owner pages:

using Sandbox;

public sealed class GamemodeVoteRewards : Component, Sboxlist.ISboxlistListener
{
    private int _partyCounter;
    private const int PartyGoal = 10;

    public void OnVoteReceived( Sboxlist.VoteInfo vote )
    {
        if ( vote.IsTest ) return;

        // Resolve custom RP character name if online, or fall back to DisplayName / voter name
        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}/{PartyGoal} to Vote Party)"
        );

        if ( _partyCounter >= PartyGoal )
        {
            _partyCounter = 0;
            Sboxlist.SboxlistPlayerMessages.BroadcastToast( "VOTE PARTY UNLOCKED! Everyone online gets +500 XP!" );
        }
    }

    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
            Sboxlist.SboxlistPlayerMessages.SendTo( reward.Player, "chat", $"You received {reward.Amount}x Starter Crate!" );
            return;
        }

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

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

Your own HUD or chatbox

If your game mode replaces Sandbox.Platform.Chat (which fades lines out after 8 seconds) with its own Razor chatbox or reward cards, implement Sboxlist.ISboxlistNotificationListener on the client, in any .razor PanelComponent or C# HUD component.

Every message to one voter (IsBroadcast == false) and every Vote Party announcement to the whole server (IsBroadcast == true) arrives in OnVoteNotification. Set notification.Handled = true to stop the default Platform.Chat line, then send "chat" notices to your own chatbox and show "toast" cards with a sound:

@using System.Collections.Generic
@using Sandbox
@using Sandbox.UI
@inherits PanelComponent
@implements Sboxlist.ISboxlistNotificationListener

<root>
    @foreach ( var item in _activeToasts )
    {
        <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 ToastItem
    {
        public string Text;
        public bool IsBroadcast;
        public RealTimeUntil ExpiresIn;
    }

    private readonly List<ToastItem> _activeToasts = new();

    public void OnVoteNotification( Sboxlist.VoteNotification notification )
    {
        notification.Handled = true; // Suppress default 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" );
        _activeToasts.Add( new ToastItem { Text = notification.Text, IsBroadcast = notification.IsBroadcast, ExpiresIn = 7.0f } );
        StateHasChanged();
    }

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

Pterodactyl checklist

To run sbox-server (Steam App 1892930) in Docker or Pterodactyl Wings, import pterodactyl-egg-sbox.json and check these four things on the host:

  • Expose x86-64-v3 (SSE4.2 + AVX2) CPU flags on your hypervisor VM (Proxmox CPU type host). Default kvm64 virtual CPUs crash Source 2 native libraries on boot with SIGILL (exit code 132).
  • In Pterodactyl’s ghcr.io/pterodactyl/games:source image, invoke env HOME=/home/container TMPDIR=/home/container/.tmp TERM=xterm LD_LIBRARY_PATH=/home/container/bin/linuxsteamrt64:/home/container/linux64:/home/container ./sbox-server ... directly without ; or && so /entrypoint.sh streams live console output.
  • Set startup completion detection to "done": "game.load success" and the Pterodactyl Stop Command to ^C (SIGINT) for clean sub-second shutdowns.
  • Use distinct UDP ports for +port (default 27015) and +net_query_port (default 27016), and pass +net_game_server_token so Steam lists your server publicly.

Quick reference

SettingValue
Packageprioxystudios.sboxlist (1.0.0, MIT license)
Downloads/downloads/sboxlist-library-1.0.0.zip and /downloads/pterodactyl-egg-sbox.json
Ports to openNone for the plugin (outgoing HTTPS on 443/tcp); 27015 and 27016 UDP for the game
Reverse proxy and NATWorks behind NAT and Docker; no 301/302 redirects on your own HTTPS baseUrl
WorkshopCompiled into your sbox.game package; sboxlist.json stays on the server disk in FileSystem.Data
Server hookSboxlist.ISboxlistListener (OnVoteReward and OnVoteReceived)
Client UI hookSboxlist.ISboxlistNotificationListener (Razor HUD and chatbox)
Console commandssbl_status, sbl_reload, sbl_hmac_selftest, sbl_debug

Tool: Config builder.