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.