Why is my player count wrong when the server is full?

Post Reply
User avatar
Edge100x
Founder
Founder
Posts: 12945
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Why is my player count wrong when the server is full?

Post by Edge100x »

Rust has two query bugs that come into play with large, busy servers.
  1. Rust bundles the number of queued/connecting clients in with the number who are actually in the game, and wraps that number around zero in query output.

    This means that if there are, for instance, 250 players connected and another 20 players queued and waiting to play, it calculates 270 as the player count.

    In the Steam query protocol, the number of connected players is represented with an octet (8-bit byte) in all output forms, including A2S_INFO. This means that it can be a number between 0 and 255. When the calculated player count is over 255, Rust wraps the number back around to 0 -- so those 270 players would be returned as 15 to anyone querying the server.

    To correct these problems, the Rust developers should not include queued clients in output, and/or return 255 if the number of clients is over 255.
  2. Rust breaks the Steam protocol and returns any A2S_PLAYER response as a single chunk. As a result, if there are enough players in the server, the response will not fit into an MTU-sized packet and UDP fragments have to be used. UDP fragments are dropped by default by most sane firewalls (for reasons that we won't get into here), including ours, meaning that these responses disappear and aren't received by our system.

    To correct this problem, the Rust developers need to change the mechanism that response to A2S_PLAYER queries to properly chunk up the data into smaller datagrams that will allow the total response to fit within 1400 bytes (per the protocol specifications). 1400 bytes is small enough that the chunks will fit inside a standard ethernet frame, with an additional buffer that allows for further tunneling headers to be added without fragmentation being required.

    (As a side note, this one is a mistake that Minecraft also makes.)
Post Reply