Steam Server Browser
If your game is on Steam, implementing Steam’s server browser protocol gives players a built-in way to find and join servers without leaving the Steam client. It also enables third-party tools (GameTracker, Battlemetrics, etc.) to index and monitor your game’s servers.
A2S Query Protocol
Section titled “A2S Query Protocol”The Steam server browser uses the A2S query protocol to retrieve information from game servers. It’s a simple UDP request/response protocol with three main query types:
| Query | Response | Purpose |
|---|---|---|
| A2S_INFO | Server info (name, map, players, max players, game) | Overview for the server list |
| A2S_PLAYER | List of connected players with play time | Player detail view |
| A2S_RULES | Server configuration key/value pairs | Server settings for filters |
Your server needs to listen for these queries on a UDP port (typically the game port +1) and respond with correctly formatted packets.
Implementing the Query Responder
Section titled “Implementing the Query Responder”The A2S protocol is well-documented by Valve. Each query type has a specific request byte and an expected response format.
At minimum, implement A2S_INFO. This is what the Steam server browser and third-party tools query most frequently. It should return:
- Server name
- Current map
- Game directory / game name
- Number of connected players
- Maximum players
- Server type (dedicated, listen)
- OS (Linux, Windows)
- Password protection status
- VAC security status
A2S_PLAYER and A2S_RULES add depth (player list, server settings) and are worth implementing but lower priority.
Rate Limiting
Section titled “Rate Limiting”A2S queries come from the internet. Your query responder should:
- Rate-limit responses per source IP (e.g., max 1 response per second per IP)
- Not allocate significant resources per query (keep responses pre-built or cached)
- Ignore malformed packets silently
Without rate limiting, your query port can be used for UDP amplification attacks.
Server Browser Tags and Filtering
Section titled “Server Browser Tags and Filtering”A2S_INFO responses include a tags field (also called “game tags” or “sv_tags”). This is a comma-separated string that the Steam client uses for filtering.
Use tags to expose:
- Game mode (pvp, pve, creative)
- Modded vs. vanilla
- Server difficulty
- Region identifier
- Any other attribute players might filter by
Example: pvp,modded,hard,us-east
Keep tags concise and consistent. Document the tag vocabulary for your game so third-party tools and hosting platforms can set them correctly.
Master Server Registration
Section titled “Master Server Registration”For your servers to appear in the Steam server browser, they must register with Steam’s master server. This happens automatically if your server uses the Steamworks Game Server API (SteamGameServer_Init).
The Steamworks Game Server API also provides:
- VAC (Valve Anti-Cheat) integration
- Player authentication via Session Tickets
- Server-side Steamworks API access (stats, achievements)
If your server already initializes Steamworks for other features, master server registration comes with it. If not, you need to initialize the Game Server API at startup.
Requirements for Master Server Listing
Section titled “Requirements for Master Server Listing”- Your game must have a Steam App ID
- The server must call
SteamGameServer()->SetProduct()and other metadata setters - The server must call
SteamGameServer()->LogOnAnonymous()to connect to Steam - The server must call
SteamGameServer()->SetAdvertiseServerActive(true)to stay listed
Servers that fail to send heartbeats are delisted after a timeout.
Dedicated Server App ID
Section titled “Dedicated Server App ID”If you distribute your server via SteamCMD create a separate App ID for the dedicated server tool. The server’s Game Server API should use your game’s main App ID for listing, but the dedicated server tool itself can have its own App ID for distribution purposes.
Testing
Section titled “Testing”- Use an online A2S query tool to verify your server responds correctly
- https://gamedig.github.io/ is a popular Node.js library for querying game servers, including A2S, and offers a CLI for testing
- Check that your server appears in the Steam server browser under your game
- Verify filtering works with your tags
- Test with the server behind NAT and on non-default ports