Jump to content

Query returning incorrect player number / TCAdmin not handling "uninitialized user" leak


Recommended Posts

Posted (edited)

TCAdmin version: 2.0.117.0
OS: Windows Server 2019

Steam server query docs: 

Some games do not properly handle disconnects. This leads Steam to believe some users are still online, when in reality they aren't: The number that `A2S_INFO` returns isn't accurate. Whenever the server restarts these "junk players" are cleared, but in the meantime it messes up some of TCAdmin's features.

Some of the issues this presents:
- The "If Players Are Connected" setting for scheduled tasks often won't work
- The server is stopped when slots monitoring is enabled whenever it reaches max capacity (and exceeds it according to TCAdmin)

An example of a game that does this is Squad. Whenever a player connects to a server, Steam registers an uninitialized player, whose name will be filled in once the player has finished loading. However if that player times out during loading, this entry will remain and an "uninitialized player" is leaked.

This can be worked around however. When querying `A2S_PLAYER`, you get an array of all connected users. This array may include some unnamed entries, which are the "uninitialized users" that are either currently connecting, or were actually disconnected long ago.

How this may look, whenever we query A2S_PLAYER:

[
    {'index': 0, 'name': '', 'kills': 0, 'time': 525896.6875},
    {'index': 0, 'name': '', 'kills': 0, 'time': 421503.875},
    {'index': 0, 'name': '', 'kills': 0, 'time': 412463.6875},
    {'index': 0, 'name': '[BWCC] B@NG', 'kills': 0, 'time': 13713.1494140625},
    {'index': 0, 'name': '[BWCC] ♆︎ hydro', 'kills': 0, 'time': 6419.0048828125},
    {'index': 0, 'name': 'PAHE The Happy One', 'kills': 0, 'time': 2346.917236328125}
]

(TCAdmin thinks 6 players are online, when in reality only 3 are)

The solution is to count the number of entries that have a name, instead of simply getting the number of online players from the `A2S_INFO` query.

Edited by Abusify
Link to comment
Share on other sites

This is interesting - but it might be possible to abuse it.

What happens if a player with an empty name joins the server?

----

Moved to 'Feature and Module Ideas' instead of 'Bugs' as this isn't actually a bug in TCAdmin - it's working as expected.
Your suggestion is noted, though!

Link to comment
Share on other sites

I just tested a few ways of setting a blank name on Steam and then tried joining an ARK server.
In some cases, the 'name' field would report back as "< blank >". In other cases, it would report back as my SteamID instead.
 

Your suggestion will most likely be implemented into the "Half Life 2 new (UTF-8)" query protocol. If that should not happen (if we find an issue with this way of checking the player count), we're going to post an example for a custom query script that will do the same.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Who's Online   0 Members, 0 Anonymous, 4 Guests (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use