View Single Post
psychonic

BAFFLED
Join Date: May 2008
Old 10-24-2016 , 18:36   Re: [CSGO] Sourcemod Not Getting Steamid
Reply With Quote #16

Quote:
Originally Posted by hlstriker View Post
I don't believe it was ever safe to get a client's steamid until OnClientAuthorized was called (paired with IsClientAuthorized). Code written otherwise has always been invalid.
It depends what the purpose is.

While not officially "safe", it was previously always fine to grab a client's unvalidated SteamID as early as in OnClientConnect. You just had to keep in mind that using it to grant any special privileges was a bad idea. One thing it was however useful for, was the opposite, keeping people out of a server if they didn't match a whitelist, without taking up a slot for long. That apparently changed, at least in CS:GO, and at least for some but not all users/cases. It's not always available that early now (although I still can't reproduce that case).

If you want the validated id, useful for granting any sort of admin access or privilege, you always want to wait for the client to be fully authorized.

All that aside, the return of GetClientAuthId or the old GetClientAuthString should have always be checked (just as it's always been documented) if you don't know whether or not IsClientAuthorized would pass, (which would be them getting past OnClientAuthorized). This even includes the early, unvalidated uses.

Last edited by psychonic; 10-24-2016 at 18:37.
psychonic is offline