Raised This Month: $12 Target: $400
 3% 

[CSGO] Sourcemod Not Getting Steamid


Post New Thread Reply   
 
Thread Tools Display Modes
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-16-2016 , 06:50   Re: [CSGO] Sourcemod Not Getting Steamid
Reply With Quote #11

After previous update, players steamid is not "valid" when connected, it come much later. This maybe lead error/bug on old or plugins which check player steamid too early
STEAM_ID_PENDING
__________________
Do not Private Message @me

Last edited by Bacardi; 10-16-2016 at 06:51.
Bacardi is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 10-18-2016 , 02:00   Re: [CSGO] Sourcemod Not Getting Steamid
Reply With Quote #12

Quote:
Originally Posted by Bacardi View Post
After previous update, players steamid is not "valid" when connected, it come much later. This maybe lead error/bug on old or plugins which check player steamid too early
STEAM_ID_PENDING
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.
hlstriker is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-18-2016 , 03:06   Re: [CSGO] Sourcemod Not Getting Steamid
Reply With Quote #13

Indeed.
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.
__________________
Do not Private Message @me
Bacardi is offline
404UserNotFound
BANNED
Join Date: Dec 2011
Old 10-24-2016 , 18:29   Re: [CSGO] Sourcemod Not Getting Steamid
Reply With Quote #14

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.
That leads me to a question...Would someone care to enlighten me on the process of what gets called when, when a client connects. I know there's a whole bunch of different client connection-related things you can use, for example:

  1. OnClientAuthorized
  2. OnClientConnect
  3. OnClientConnected
  4. OnClientPreAdminCheck
  5. OnClientPostAdminCheck
  6. OnClientPutInServer


If I was to want to put those forwards in order of when they're called during a client connecting, what order would they be in?
404UserNotFound is offline
psychonic

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

OnClientConnect, followed by OnClientConnected will always be first.

OnClientAuthorized and OnClientPutInServer will be next, but not necessarily in that order. It's indeterminate.

Then, OnClientPreAdminCheck, followed by OnClientPostAdminCheck.
psychonic is offline
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
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 10-24-2016 , 21:32   Re: [CSGO] Sourcemod Not Getting Steamid
Reply With Quote #17

Quote:
Originally Posted by psychonic View Post
OnClientConnect, followed by OnClientConnected will always be first.

OnClientAuthorized and OnClientPutInServer will be next, but not necessarily in that order. It's indeterminate.

Then, OnClientPreAdminCheck, followed by OnClientPostAdminCheck.
Well, there is one more you left out, but it (OnClientPostAdminFilter) is intended to be used by plugins that change admin permissions.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
psychonic

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

Quote:
Originally Posted by Powerlord View Post
Well, there is one more you left out, but it (OnClientPostAdminFilter) is intended to be used by plugins that change admin permissions.
It wasn't meant to be an exhaustive list, just ordering the ones he asked about.
psychonic is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 17:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode