View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 11-02-2019 , 01:08   Re: SourceMod API GetClientAuthId Function
Reply With Quote #4

Both the very old GetClientAuthString (since SM 1.0.0.1946) and (since SM 1.6.0) has always been a boolean.

So now you also have the chance to change and do things properly from your end, with some superior code like:

PHP Code:
if (!GetClientAuthId(targetAuthId_Steam2steamidsizeof(steamid)))
{
    
/* User probably not authenticated yet or Steam network (or connectivity to it) is temporarily down... Print "try again later" message? */
    
return Plugin_Handled;

PHP Code:
if (GetClientAuthId(targetAuthId_Steam2steamidsizeof(steamid)))
{
    
/* YAY, WE HAVE A STEAM ID, LET'S CONTINUE! */
}
else
{
    
/* User probably not authenticated yet or Steam network (or connectivity to it) is temporarily down... Print "try again later" message? */
    
return Plugin_Handled;

Even with the older GetClientAuthString, you should also have had done that kind of thing as well, checking the actual return values before you blindly use the data.
__________________
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