AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   SteamTools (https://forums.alliedmods.net/forumdisplay.php?f=147)
-   -   Steam_GroupStatusResult Forward can be called with client == -1 (https://forums.alliedmods.net/showthread.php?t=200978)

RedSword 11-15-2012 19:25

Steam_GroupStatusResult Forward can be called with client == -1
 
Hi there !

I'm testing Steam Groups forward in my whitelist plugin and I just got a problem with the fact that the "client" (first arg) value was -1.

Looking at http://hg.limetech.org/projects/stea.../extension.cpp, I feel like you shouldn't launch the forward (do we say "trigger", "execute", "launch" or "call" a forward ?) if i == -1. I guess it's logic that player that left the server doesn't have the Forward "forwarded" for them (it is what I assumed when starting to use your extension; since for example, if two clients left, it's impossible that you wouldn't know which one the forward concerns.).

Also, if you don't want to fix that, then please at least mention in the .inc that the Forwards can have a "client" arg of value "-1".

Thanks for this great SP interface,

Red

Powerlord 11-15-2012 19:44

Re: Steam_GroupStatusResult Forward can be called with client == -1
 
Quote:

Originally Posted by RedSword (Post 1838521)
And then L520 "if (i > playerhelpers->GetMaxClients())" is true (1 > 0), which makes i == -1; and then the forward is triggered.

Where would you get the idea that playerhelpers->GetMaxClients() would return 0? It'd return whatever the server's maxplayers is set to. Which on both of my TF2 servers would be 24.

RedSword 11-15-2012 19:46

Re: Steam_GroupStatusResult Forward can be called with client == -1
 
Wtf; I misread code; I'll update my main post :$.

Thanks :$.

asherkin 11-15-2012 22:06

Re: Steam_GroupStatusResult Forward can be called with client == -1
 
This is expected behaviour and documented (although only in the thread when it was added, as that part of the include doesn't have inline documentation written yet).

-1 corresponds to the value of USE_CUSTOM_STEAMID, and is informing you to use the Steam_GetCustomSteamID native to retrieve the SteamID the response is for - this'll happen in cases where SteamTools couldn't find the client on the game server (either someone did a request for a manually specified SteamID, or a client left the server before the response was received).

RedSword 11-16-2012 08:08

Re: Steam_GroupStatusResult Forward can be called with client == -1
 
I suggest you modify your .inc to inform people of this. And I had no idea native bool:Steam_GetCustomSteamID(String:renderedID[], maxlength) had an usage; thanks for the tip.

asherkin 11-16-2012 08:46

Re: Steam_GroupStatusResult Forward can be called with client == -1
 
Quote:

Originally Posted by RedSword (Post 1838753)
I suggest you modify your .inc to inform people of this.

As I said, it'll be there when that part is documented.


All times are GMT -4. The time now is 10:49.

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