DocsHostingMaster servers

How servers get listed

How a server gets listed

The server signs its listing

A server's network key, kept in its own folder, signs its game address. The same key proves who it is when a player connects, so a listing can't send players to a different machine. A listing is good for 3 minutes, and the server renews it long before then.

It reports to masters

Every 30 seconds, a dedicated server sends the listing to the three default masters and to the masters its host added under [master] peers, and every 5 seconds to the master on its own machine. A game hosted online from the game reports to the masters on that player's list.

It registers its game socket

From its game port, the server registers with the UDP side of up to four masters that answered it, every 20 seconds. Each master's copy of the listing names that master, so any of them can introduce players to it.

The master checks that it's there

A couple of seconds after a server's first report, the master asks the server itself on its game port, as a browser does, and lists it once it answers with the key that signed the listing. A server that doesn't answer within 5 seconds isn't listed, and its reports aren't looked at again for two minutes.

Masters share it

Every 60 seconds, each master swaps listings with the masters it knows, so a listing that reached one master reaches the others.

The browser finds it

When a player opens the Server Browser or refreshes it, the browser reads the masters, then asks the server what it's playing.

A server that stops drops off every list within 3 minutes of its last renewal. A hidden server reports nowhere: players reach it only by Direct Connect.

The answer to a report tells the server the address the master saw. A server with no public_address is listed at that address, and its copy for each master is signed by that master's clock, so a wrong clock on the server's machine doesn't hide it.

What a master lists

A master only lists servers that are really there, at the address they give:

  • A server reports from its own address. A master takes a listing only when the report came from the IP address the listing names, so nobody can announce servers at somebody else's address. A server whose reports leave from another address than its public_address, such as a machine with several addresses, or a report over IPv6 for a game listed by IPv4, isn't listed by that master. Other masters still pass servers on.
  • A server answers the master. A server the master can't reach, directly or through its UDP side, isn't listed. A new server shows up a couple of seconds after its first report.
  • Four servers per address. A master lists at most four servers at one IP address, the four that answered first, and takes at most four listings from one sender. Hosts behind one public address share its four. A host with more servers on one address asks the master's operator to be let through; see keep servers off your list.
  • A machine's own master lists all of its servers, without asking them and without the limit of four.

Player counts

What a server says it's playing is the server's own word, and that includes how many players it has. So the masters count players themselves, and the Server Browser shows no more players on a server than the masters counted.

  • Each playing game says where it plays. Within 2 seconds of joining, every 20 seconds after that and once more as it leaves, a player's game tells the UDP side of each master on its list which server it's on and how many players are at that PC. Nothing else: no names. A game that crashes still counts for 60 seconds.
  • A master counts by address. One address vouches for at most 4 players on a server, and plays on at most 4 servers at once, so a host can't fill its servers from its own machines. More than 4 players behind one address on one server, such as a LAN party listed online, count as 4. A master keeps the counts in memory only.
  • The browser shows the lower number. A row shows the server's own count or the most one of its masters counted, whichever is lower. Only the masters on the browser's own list count for this. The count of the server a player has selected is asked again every 5 seconds, so it follows joins and leaves without a refresh.
  • Where nothing is counted, the server's word stands: a game on the player's own network, a hidden server kept as a favorite, a server only a master without counts lists.

A server needs the game's current version to be counted: an older one shows no players in the browser, whatever it says. Nothing changes in a server's own console or settings. For a time when players' games can't reach a master, its operator can start it with --trust-unwitnessed: a server it counted nobody on is then listed with the count the server itself reports, and a server with at least one counted player keeps the counted number.