View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 02-16-2017 , 18:48   Re: SMAC by-pass hack?
Reply With Quote #5

Quote:
Originally Posted by WebNoob View Post
So, I guess that includes Sourcebans 1.4.11 - since that plugin is the one we use to ban, and it would not ban that player (?)
It is quite old, so without looking into if that had the right things or not - it might also be doing it.

The plugin causing the output of the place where you see "STEAM_ID_STOP_IGNORING_RETVALS" is falling into the category above.


In previous SM versions, you could do like:

Code:
GetClientAuthString(client, steamID, sizeof(steamID));
and in newer:

Code:
GetClientAuthId(client, AuthId_Steam2, steamID, sizeof(steamID))
Both GetClientAuthString and GetClientAuthId have been returning the "true" boolean for a long while to indicate it retrieved a valid Steam ID, and the "false" boolean to indicate that it didn't retrieve a proper Steam ID.

It has been quite common for not just a few - but many "lazy" people to do code like:

Code:
[...]
GetClientAuthId(client, AuthId_Steam2, steamID, sizeof(steamID));
[...]
PrintToChat(client, "Hi %N. Your Steam ID is: %s", steamID);
This basically means you are requesting some data, you don't really care what you get in return, and then try to use it for your purpose anyway.

If you do that, you might end up on seeing "STEAM_ID_STOP_IGNORING_RETVALS" as Steam ID on recent versions of SourceMod.

You should do like:

Code:
[...]
if (GetClientAuthId(client, AuthId_Steam2, steamID, sizeof(steamID))) {
    [...]
    PrintToChat(client, "Hi %N. Your Steam ID is: %s", steamID);
}
This way you will only do things with the Steam ID if GetClientAuthId returns "true: I have a valid Steam ID".

SourceBans 1.4.11 does seem to use the old way, however, the latest code on GitHub seem to be using a mix of checking the return value and not checking the return value around the code.
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline