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

Steam IDs for a Roleplay plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Chief149
Member
Join Date: Sep 2010
Old 02-05-2016 , 21:57   Steam IDs for a Roleplay plugin
Reply With Quote #1

So I have been working on an RP plugin for a while which is currently live on it's server. Not trying to advertise so I won't mention which server, but I have a question regarding steam IDs.

It seems that getting the client steam ID crashes some clients. It's odd because it doesn't always crash people's clients. Sometimes it does, and sometimes it doesn't.

I use GetClientAuthId(Client, AuthId_Steam2, targetBuffer, sizeof(targetBuffer))
to get the steam ID of my players as they join.

My plugin is designed in such a way that it can be unloaded and reloaded without having to restart the server or map. It makes it easy for me to update the plugin without causing a whole lot of disturbance in the game play. The plugin also saves the player's job states that way when it's back online, the players haven't lost anything. Problem is that when the plugin reloads everyone, GetClientAuthd causes most (not all) clients to crash. Additionally, some new players who join have the same deal happen to them. It's quite random.

So GetClientAuthId is called for one of two reasons, and is only called once per player. If the plugin loads, and players are already in game, then it calls that function for each online player to get their steam id and store it. It's also called in the OnClientPostAdminCheck forward because OnClientAuthorized ALWAYS crashes clients.

In console I get something about the steam authorization timing out. It's error code 6 basically.
STEAMAUTH Client <NAME> received failure code 6

So I am wondering, is the fact that I am getting the player's Steam2 ID in hl2dm causing the problem? I was thinking of either getting the Steam3 ID or using the
GetSteamAccountID(Client, true) function and using an integer to identify players rather than a string.

If anyone has any info regarding this phenomenon then please pitch in!
The thing I do want to know about GetSteamAccountID(int, bool) is does it give a unique integer for every client. This is used to identify each player in the server, therefore I need a guarantee that GetSteamAccountID would give every different person a different integer value. I suspect this is the case, but I would like confirmation on this.

Sorry for the long post. Just wanted to include as many details as possible. This has had me stumped ever since the problem started happening when Valve started releasing hl2dm updates for the first time in years.
Chief149 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-06-2016 , 07:45   Re: Steam IDs for a Roleplay plugin
Reply With Quote #2

This is not technically possible - GetClientAuthId (or any of the related functions) could never, ever, ever cause a client crash, your issues are elsewhere.

The failure code 6 stuff is a symptom of the client crashing and a complete red herring, it's just Steam telling the server they're no longer playing the game so couldn't possibly be playing on the server.

You are probably doing something once you have the SteamID that is causing the client's to crash, such as setting a bad model. Can't really help you without the ENTIRE source code.
__________________
asherkin is offline
Chief149
Member
Join Date: Sep 2010
Old 02-06-2016 , 16:51   Re: Steam IDs for a Roleplay plugin
Reply With Quote #3

Quote:
Originally Posted by asherkin View Post
This is not technically possible - GetClientAuthId (or any of the related functions) could never, ever, ever cause a client crash, your issues are elsewhere.
I have tested it. My code doesn't do anything to a player until the OnClientPostAdminCheck gets called. Once called, the plugin checks to see if the database is connected. Basically it just sees if the MySQL handle is INVALID_HANDLE or not. If it is INVALID_HANDLE then nothing else happens. If the handle is valid, then we proceed to:
GetClientAuthId(Client, AuthId_Steam2, targetBuffer, sizeof(targetBuffer))
And then the rest of the stuff starts happening.

When I add logging commands into my code (literally a Log command between each line of code in the OnPlayerPostAdminCheck forward), I could then confirm for certain that the GetClientAuthId function was the one crashing the client.

When I tried replacing OnPlayerPostAdminCheck with OnClientAuthorized, it would crash the client before executing even the first line of code of my OnClientAuthorized function.

Quote:
Originally Posted by asherkin View Post
The failure code 6 stuff is a symptom of the client crashing and a complete red herring, it's just Steam telling the server they're no longer playing the game so couldn't possibly be playing on the server.
This part makes sense.

Quote:
Originally Posted by asherkin View Post
You are probably doing something once you have the SteamID that is causing the client's to crash, such as setting a bad model. Can't really help you without the ENTIRE source code.
For the time being, the plugin is exclusive to the server it is on. There will be a public release of it's core in the future, but any servers that wish to run the plugin will have to make their own modules for the plugin if they wish to have much of anything. Not to mention the plugin and modules combined make up over 20K lines of code. Also, the plugin is being designed to run accross multiple games, but the only engine-dependent thing done by the plugin when players have their stats loaded is their player models are set, but I have either switch statements or if statements to make sure only engine-compatible models are used for the current game engine. Even if I did use a bad model on accident, the players would just be walking error signs. Been there done that!

Also, Valve didn't update HL2DM for over a year. Then a few months ago they began releasing updates again, and ever since then they have been releasing updates fairly regularly. And we all know what happens when Valve tries to update or create something. HINT: It's never a good thing. It wasn't until those updates started up again that this error began even existing.

Last edited by Chief149; 02-06-2016 at 16:56.
Chief149 is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 02-06-2016 , 18:21   Re: Steam IDs for a Roleplay plugin
Reply With Quote #4

You are going to at least need to provide a reproducible test case, sounds like that shouldn't be too bad from what you're saying about OnClientAuthorized.
__________________
asherkin is offline
Reply



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 16:16.


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