Ali Şahan Yalçın
DocsDedicated server browser

More features

Dedicated server browser

Listing dedicated servers, and querying their players and settings.

This is for dedicated servers: a machine running your game with no player on it. It is a different thing from lobbies, which is where player hosted games live.

If your game is player hosted, you want sessions instead. Nothing on this page applies.

Listing servers

Call Refresh Server List on the SteamForge Server Browser subsystem with a list type:

TypeWhat it queries
InternetValve's master server list. Everything, and the slowest.
LANA broadcast on the local network. Fast, and works with no Steam connection.
FriendsServers friends are on right now
FavoritesThe player's starred servers, shared with Steam's own browser
HistoryServers the player connected to recently
SpectatorServers running in spectator mode

Results arrive one at a time on On Server Found, not as a finished array. On Server List Complete fires when the refresh ends.

INFO: Adding rows as they arrive is the point. An internet refresh can take a long time, and a browser that shows nothing until it finishes looks broken for the entire wait.

Get Servers returns everything found so far, Is Refreshing Servers says whether one is running, and Cancel Server List Refresh stops it.

Filters

Refresh Server List takes a map of filter keys, applied by Valve's master server before results are sent:

KeyMatches
mapServers on one map
gamedirOne game directory
secureAnti cheat secured servers
notfullServers with room
noplayersEmpty servers
gametagsandServers carrying all of these tags

Filtering at the master server rather than locally is the difference between a browser that lists your game's servers and one that downloads every server on Steam first.

What a result carries

Each Steam Server Info arrives populated:

FieldMeaning
Name, Map Name, Game DescriptionWhat to show in a row
Address, Query PortWhere it is, and what to pass to the query nodes
Ping MsLatency, or -1 if it never answered
Players, Max Players, Bot PlayersOccupancy
Password Protected, SecureWhether a password is needed, and whether anti cheat is on
Friends PlayingHow many of the player's friends are on it
Game TagsWhatever the server published, for your own filtering
RespondedFalse for a server on the list that did not answer the query
WARNING: Check Responded. A server on the master list that never answered still produces a result, with a ping of -1 and empty fields. Showing those as normal rows gives players servers that cannot be joined.

Asking one server for more

Three queries, each taking an address and query port from a result:

NodeAnswers onGives you
Request Server PlayersOn Server Players ReceivedWho is on it, with score and time connected
Request Server RulesOn Server Rules ReceivedThe server's published key and value settings
Request Server FriendsOn Server Friends ReceivedWhich of the player's friends are on it

Ping Server re-pings a single server and answers on On Server Pinged, which is what a Refresh button on one row should call rather than refreshing the whole list.

Cancel Server Query stops an outstanding query.

INFO: Query these on demand, when a player selects a row. Firing three queries per server as results arrive means hundreds of outstanding queries during an internet refresh, and Steam will drop them.

Where to go next

Networking, for talking to a server once connected.