Raised This Month: $32 Target: $400
 8% 

Solved STOP_IGNORING_RET_VAL warning


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-28-2018 , 16:21   STOP_IGNORING_RET_VAL warning
Reply With Quote #1

Hello,

I'm trying to retrieve steamID_2 of the player using the a command, but I always end up with a STOP_IGNORING_RET_VAL...

PHP Code:
public OnAskClientConnect(int clientchar[] ipchar[] password)
{
    
char steamId[30];
    
    
PrintToServer(">>> %N"client);
    if(
GetClientAuthId(clientAuthId_Steam2steamIdsizeof(steamId)))
    {
        
char buffer[4096];
        
char TranslatedStr[500];
        
        
Format(TranslatedStrsizeof(TranslatedStr), "%T""Connect by Clicking Link"client);
    
        
Format(buffersizeof(buffer), "%s/steam://connect/%s/%s"steamIdippassword);
        
        
PrintToServer(buffer);
        
ASteambot_SendMesssage(AS_SIMPLEbuffer);
    }
        else
        {
             
PrintToServer(">>> %s"steamId);
        }

__________________
Want to check my plugins ?

Last edited by Arkarr; 05-30-2018 at 09:42. Reason: Solved.
Arkarr is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-28-2018 , 17:39   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #2

Your issue is that GetClientAuthId is returning false, because it's being called too early to reliably get the client's actual auth id, and you are implicitly passing true to the validate parameter of it.

The contents of the steamId buffer is set that way due to so many people completely ignore the return value of GetClientAuthId. In the past, there were issues with this combined with using decl instead of new for the buffer, leading to it possible containing a different user's auth id. We did it to protect/inform them.
psychonic is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-29-2018 , 01:47   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #3

The problem is, that's it's not called too early. I know that we spoke multiple times about it, but this code is executed at amytime, for exemple,in the middle of the game. The user can only use it once he his connected to the server. I tried to do a few things like killing some bots, capturing a point, etc...

Still invalid ID.

I was trying that in TF2, and also in a local server, I connected myself to it through the public IP.
__________________
Want to check my plugins ?

Last edited by Arkarr; 05-29-2018 at 04:38.
Arkarr is offline
DJ Tsunami
DJ Post Spammer
Join Date: Feb 2008
Location: The Netherlands
Old 05-29-2018 , 05:03   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #4

When is OnAskClientConnect called? The name implies it's either a client pre-connect hook, or a hook for when the "ask connect" box is shown.
__________________
Advertisements | REST in Pawn - HTTP client for JSON REST APIs
Please do not PM me with questions. Post in the plugin thread.

Last edited by DJ Tsunami; 05-29-2018 at 05:09.
DJ Tsunami is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-29-2018 , 06:48   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #5

Quote:
Originally Posted by DJ Tsunami View Post
When is OnAskClientConnect called? The name implies it's either a client pre-connect hook, or a hook for when the "ask connect" box is shown.
Whenever a player want to get redirected to another server, so anytime, I guess...
It's called by this plugin : https://forums.alliedmods.net/showthread.php?t=255675
__________________
Want to check my plugins ?
Arkarr is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-29-2018 , 08:06   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #6

Regardless of when it's being called, if the return is false, the engine has not yet received validation from the Steam servers that the steam id the client supplied is their actual steam id.

If you don't care about that, you can pass false to the validate parameter.

Last edited by psychonic; 05-29-2018 at 08:06.
psychonic is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-29-2018 , 08:10   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #7

Quote:
Originally Posted by psychonic View Post
Regardless of when it's being called, if the return is false, the engine has not yet received validation from the Steam servers that the steam id the client supplied is their actual steam id.

If you don't care about that, you can pass false to the validate parameter.
Well, no. I want real steam client. I'll keep searching.
__________________
Want to check my plugins ?
Arkarr is offline
psychonic

BAFFLED
Join Date: May 2008
Old 05-29-2018 , 08:53   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #8

Quote:
Originally Posted by Arkarr View Post
Well, no. I want real steam client. I'll keep searching.
If your action in your forward is dependent on the client being authorized, you could keep track of that and just not fire it unless/until they are.
psychonic is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 05-29-2018 , 09:15   Re: STOP_IGNORING_RET_VAL warning
Reply With Quote #9

Quote:
Originally Posted by psychonic View Post
If your action in your forward is dependent on the client being authorized, you could keep track of that and just not fire it unless/until they are.
Yep, definitly a good solution, but the main plugin isn't mine, I just do a module for it.
__________________
Want to check my plugins ?
Arkarr 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 19:34.


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