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

Steam Group Admins (HTTP Prefetch)


Post New Thread Reply   
 
Thread Tools Display Modes
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 05-26-2013 , 00:56   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #81

I don't want to make it do that, but you're welcome to do as you please with the code.
Mister_Magotchi is offline
cushycush
Junior Member
Join Date: Oct 2012
Old 12-22-2013 , 17:05   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #82

Magotchi, wanted to thank you for the plugin, this is a great option and a life saver for those who do not run Source 2009 servers.

For those of you who are wondering it works, and admin.cfg or admin-groups.cfg is not changed by this plugin, instead use sm_who in rcon to check if it worked or not.

It works great ty again
cushycush is offline
markg
Senior Member
Join Date: Jan 2009
Old 12-27-2013 , 11:01   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #83

I have been using this plugin for quite a while with very good results.

lately however it stopped working for me.

im getting the following in the logs coincident with server map change (which I believe would be the expected time) (note I replaced the last couple digits with xx):

2013 - 06:13:25: [admin\steam-group-admins-http.smx] Error replacing cache with fresh XML content temp. file. Steam Group ID: 34241XX
L 12/27/2013 - 06:13:25: [admin\steam-group-admins-http.smx] Error reading XML data from local cached file for Steam group ID: 34241XX.
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error replacing cache with fresh XML content temp. file. Steam Group ID: 40999XX
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error reading XML data from local cached file for Steam group ID: 40999XX.
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error replacing cache with fresh XML content temp. file. Steam Group ID: 40321XX
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error reading XML data from local cached file for Steam group ID: 40321XX.
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error replacing cache with fresh XML content temp. file. Steam Group ID: 39040XX
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error reading XML data from local cached file for Steam group ID: 39040XX.
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error replacing cache with fresh XML content temp. file. Steam Group ID: 41503XX
L 12/27/2013 - 06:13:26: [admin\steam-group-admins-http.smx] Error reading XML data from local cached file for Steam group ID: 41503XX.
L 12/27/2013 - 07:15:15: Error log file session closed.

I checked the data/steam_group_admins_http directory, and there is a single temp.xml file, with a time stamp roughly map change time, but with only one steam group id included, 41503XX. but that group has errors also, see above.

any ideas?
markg is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 12-27-2013 , 11:52   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #84

The biggest problem in general that anybody ever mentions about this plugin is exactly what you're describing, and it comes down to file locking. Sadly, I've never figured out an elegant solution.

Basically, after it downloads the data to temp.xml, it deletes the <groupid>.xml file and then renames temp.xml to <groupid>.xml. Sometimes either the <groupid>.xml is locked and its deletion fails, or the temp.xml is locked and renaming it fails.

I've only ever had this happen on Windows, and for me, it was only on a CS:GO server. Linux is pretty forgiving about letting you mess around with in-use files. That's not to say it doesn't work on Windows; I've been using it for years now on a Windows server.

As for why the file gets locked for some people/servers and not for others, I'm not sure; for all I know, it could even be antivirus software scanning it or something. The moment the data is successfully written to temp.xml, I immediately close the handle to it and then try to rename it, so something is locking it in the meantime, or I'm not successfully closing the game's access to the file.

I have some ideas, including one involving randomly-named temp files, copying instead of renaming, and cleaning old temp files; hopefully there's something I can do that doesn't mean rewriting the whole thing. It's a good plugin, and I hate to see people having issues with it.

Last edited by Mister_Magotchi; 12-27-2013 at 13:33.
Mister_Magotchi is offline
markg
Senior Member
Join Date: Jan 2009
Old 12-28-2013 , 00:16   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #85

just to help you troubleshoot;

this is on a vps, windows 2008 R2, running Team Fortress 2, with NO antivirus software whatsoever.

I can also get you whatever other info that might help - just ask.

[edit] I just remoted in and tried to delete the temp file, got an error message:
"The action can't be completed because the file is open in srcds.exe
Close the file and try again."

if I stop the server I can erase the file (no surprise there), and then on restart it recreates the temp file, then the other xml files.
so the locking file thing isn't consistent, but when it does lock, that's it until server restart.

Last edited by markg; 12-28-2013 at 19:54.
markg is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 12-28-2013 , 21:40   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #86

I've updated the plugin to hopefully fix these issues (and another longstanding issue).

Now, it does the following:
  1. For each Steam group, it downloads the XML memberlist for the group.
  2. If the XML contains the text "<steamID64>", the memberlist data is written to <groupid>.xml directly.
    • If not, the data from Steam's API was probably some sort of error message, meaning Steam's API isn't working correctly. Previously I only checked that there wasn't a connection error or some kind of error code from the API, but I've found that in some cases, like if the API server was overloaded (like on Christmas day this year), the data the API provided was erroneous, and therefore people were losing their admin privileges. Previously, at this point, the data from Steam would have been in temp.xml. Now, it's directly already in the <groupid>.xml file, and only if it was a valid member list.
  3. Regardless of whether the previous step was successful or not, the member lists are now read from the local cache files (<groupid>.xml).
    • Previously in this step I would have had to delete the current <groupid>.xml file and then rename temp.xml to <groupid>.xml, and that's where the file locking issue was coming into play. My hope here is that the same systems where temp.xml couldn't be renamed or where <groupid>.xml couldn't be deleted don't also have a problem with the plugin directly writing to an already-existing <groupid>.xml, because that's what happens now.

EDIT:
I accidentally left a debugging line in there which logged some raw XML data to the SourceMod log. Fixed.

Last edited by Mister_Magotchi; 12-28-2013 at 23:25.
Mister_Magotchi is offline
markg
Senior Member
Join Date: Jan 2009
Old 12-30-2013 , 08:50   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #87

installed, ill let you know how it goes

Thanks!!
markg is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 12-30-2013 , 10:08   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #88

Please do. Since I don't ever see the problem on my current servers, I'm interested to get feedback on it.

Last edited by Mister_Magotchi; 12-30-2013 at 16:06. Reason: mistake
Mister_Magotchi is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 12-30-2013 , 23:43   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #89

I've updated the plugin:
Quote:
0.9.9 - 2013-12-30 - Made SteamID64 to Steam ID conversion more future-proof, fixed calculation error which may have affected a small percentage of Steam IDs, cleaned up and better-documented code.
Mister_Magotchi is offline
Mister_Magotchi
SourceMod Donor
Join Date: Dec 2006
Location: Nampa, Idaho
Old 08-27-2014 , 01:06   Re: Steam Group Admins (HTTP Prefetch)
Reply With Quote #90

I've updated the plugin:
Quote:
0.9.9b - 2014-08-26 - Hotfix to support new Steam ID format ("[U:1:########]").
The version supporting the old Steam ID format is still available ("steam-group-admins-http-old-steamid-format.zip"). I'm not sure yet what games besides TF2 are using the new format or the best way to detect which format is being used, so in the meantime, both versions will be available.
Mister_Magotchi 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 17:27.


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