Reliable player disconnect check
Posted: Tue Jun 26, 2018 6:10 pm
I'm trying to find some way to reliably listen for a player disconnecting from the server, and get either their SteamID or (base)client pointer. Every single way I've found so far has at least one issue, I'll list the ones I remember:
To be clear I would like to capture every time a user is no longer connected to the server in any way after passing CBaseServer::CheckChallengeType and then capture either SteamID or (base)client object/pointer.
- OnClientDisconnect listener: Fires when the client deactivates (on map changes)
OnClientDisconnect listener and checking CBaseClient::IsConnected: IsConnected is always True, also tried delaying by one tick, same result.
player_disconnect event: Doesn't fire when the client disconnects early before a certain point, for example due to not having the current map.
To be clear I would like to capture every time a user is no longer connected to the server in any way after passing CBaseServer::CheckChallengeType and then capture either SteamID or (base)client object/pointer.