AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Steam Group Admins (HTTP Prefetch) (https://forums.alliedmods.net/showthread.php?t=145767)

Mister_Magotchi 12-19-2010 22:42

Steam Group Admins (HTTP Prefetch)
 
2 Attachment(s)
Steam Group Admins (HTTP Prefetch)

This plugin reads all players from Steam Community group XML member lists (via HTTP), based on a config file, and adds them to the admin cache whenever the admin cache is refreshed (manually or at map start).

It should work in any game that SourceMod supports.

I've currently used it on a Windows CS:S server, a Linux CS:S server, a Windows TF2 server, and a Windows CS:GO server.

Setup:
  1. Install the cURL extension.
  2. Extract the attached ZIP archive to your game mod folder.
  3. Edit addons\sourcemod\configs\steam-group-admins-http.txt to you liking. All entries are commented out by default.
    • Steam group ID (the key name for each entry)
      • This may be found most easily by going to "Admin options" --> "Edit group profile" when viewing a group you are an admin for in the Steam Community. It can also be found by subtracting 103582791429521408 from the groupid64 if you know that. You can see the groupid64 for all the groups a player is in by tacking "?xml=1" onto the end of their Steam Community profile URL (eg http://steamcommunity.com/id/ChetFaliszek?xml=1) and viewing the XML source.
    • admin_group_name - Required
      • The name you want SourceMod to use as its admin group name. If you have already created the group with another admin config. system, this plugin will use that group. If not, this plugin will create it.
    • flags - Optional
      • Flags to add to the group. If you are using a pre-existing group name from another admin config. system, these flags will be added to all members of that group. If you already have the flags set for the group with the other system, you don't need to set them here.
    • immunity - Optional
      • If set, the group's immunity level will be set to this. If you already have the immunity set for the group via another admin config. system, setting it here may overwrite the other value, depending on the order in which the plugins work with the admin cache.
  4. Change the map or restart your server. You can alternatively manually load the plugin and then run sm_reloadadmins.
Version History:
  • 0.9.0 - 2010-12-19 - Initial release
  • 0.9.5 - 2012-02-25 - Nearly complete rewrite. Switched from Socket to cURL. Fixed intermittent crash on map change. Fixed invalid memory access errors.
  • 0.9.6 - 2012-04-23 - Added caching: XML files are now written to the SM data folder before being read, so for later admin cache reloads, if cURL can't get fresh data from Steam's servers, it still has old data to work with.
  • 0.9.7 - 2012-04-28 - Fixed minor corruption of XML cache data, and players potentially not being properly removed as admins, when users were removed from a Steam group.
  • 0.9.8 - 2013-12-28 - Changed the way API data caching works to hopefully do away with file-locking issues experienced by some. Also, no response from the API will be cached unless it contains valid group member data; this should prevent people from losing their admin rights when Steam's API is providing abnormal data.
  • 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.
  • 0.9.9b - 2014-08-26 - Hotfix to support new Steam ID format ("[U:1:########]").
Known Issues:

When manually reloading the admin cache via sm_reloadadmins, players currently authenticated as admins via this plugin will lose their admin authentication until they reconnect to the server or the map changes.

Steam Community group XML member lists are paginated after 1,000 members, so in order to prevent excessive server load and hammering of the Steam Community XML API, only the first page, and therefore only the first 1,000 listed members, are processed.

Special Thanks:

psychonic - He made the original Steam Group Admins plugin. As there is a slight delay after a user connects to the server before they are authenticated by their Steam groups, it doesn't work properly for reserved slots, and that's why I made this plugin. His plugin, however, supports groups of any size, while mine only handles groups with 1,000 members or less.

Compiling:

This plugin requires the include files for the cURL extension to compile correctly.

Download Options:
  • steam-group-admins-http-new-steamid-format.zip
    • Adds admins using the new Steam ID format ("[U:1:########]").
    • Only works in 1.7 branch of SourceMod.
    • Requires a game which uses the new format, like TF2.
  • steam-group-admins-http-old-steamid-format.zip
    • Adds admins using the old Steam ID format ("STEAM_0:#:########").
    • Only works in 1.6 branch of SourceMod.
    • Works with games that use either the new or old Steam ID formats, thanks to the 1.6 branch backward compatibility "hack" on 2014-08-21.

psychonic 12-19-2010 22:56

Re: Steam Group Admins (HTTP Prefetch)
 
You need to account for groups that have >1000 people. Even the xml version gets paginated.

The nextPageLink node has the link to the next page if applicable.

Plus, you're only mapping admin to users when the admin cache is refreshed. Users late-joining won't get admin until map change.

Mister_Magotchi 12-19-2010 23:10

Re: Steam Group Admins (HTTP Prefetch)
 
I don't want to account for groups that have > 1000 people. A non-threaded approach really shouldn't be handling that many anyway.

If a player joins the server any time after this plugin has been loaded and the admin cache has been refreshed (the map has changed or sm_reloadadmins has been run), they will get admin.

psychonic 12-19-2010 23:12

Re: Steam Group Admins (HTTP Prefetch)
 
Quote:

Originally Posted by Mister_Magotchi (Post 1375119)
I don't want to account for groups that have > 1000 people. A non-threaded approach really shouldn't handling that many anyway.

Then it should be mentioned as a limitation or 'known bug'.

Quote:

Originally Posted by Mister_Magotchi (Post 1375119)
If a player joins the server any time after this plugin has been loaded and the admin cache has been refreshed (the map has changed or sm_reloadadmins has been run), they will get admin.

Right. I should have also said " or administrative action" (pending that they had admin without having to wait :3 )

Mister_Magotchi 12-19-2010 23:17

Re: Steam Group Admins (HTTP Prefetch)
 
Thanks for the pointers. I had already done all that in the description I was writing. The reason I posted the thread before finishing the description was that I wanted to put the thread's URL in the "url" thing in the plugin source. Sorry for the confusion. I didn't expect anyone to see that since I was finished in a few more minutes from the initial post.

By the way (and I was going to ask you in IRC or something, but I didn't want to bug you), if you have any idea what I'm missing on that first "Known Issue" I list, let me know.

xX Marc Xx 12-30-2010 21:36

Re: Steam Group Admins (HTTP Prefetch)
 
Nice Nice But it is not walk... :|


If I want compielen the sp file itself does this error
fatal error 120: cannot read from file: "socket"


Plz Can you give me a ready made package for this group

http://steamcommunity.com/groups/dreist-reserver-slot
Group ID: 103582791431649758

end this frags
Quote:

"steam_groups"
{
"31649758"
{
"admin_group_name" "VIPs"
"flags" "ab"
"immunity" "0"
}
}

Mister_Magotchi 12-31-2010 02:06

Re: Steam Group Admins (HTTP Prefetch)
 
Quote:

Originally Posted by xX Marc Xx (Post 1382794)
If I want compielen the sp file itself does this error
fatal error 120: cannot read from file: "socket"

Quote:

Originally Posted by Mister_Magotchi (Post 1375108)
This plugin requires the include file for the Socket extension to compile correctly and therefore won't compile in the forums.

That config file you have looks fine, but the group ID should be 2128350 instead of 31649758. If not, then there's something I don't know about the group numbers. Just use the precompiled binary in the ZIP file, or get the Socket include file and compile it yourself.

xX Marc Xx 12-31-2010 09:35

Re: Steam Group Admins (HTTP Prefetch)
 
Oh ok the neu

steam-group-admins-http.txt is

PHP Code:

"steam_groups"
{
  
"2128350"
  
{
    
"admin_group_name" "VIPs"
    "flags" "ab"
    "immunity" "0"
  
}


Its ok????

Mister_Magotchi 12-31-2010 13:48

Re: Steam Group Admins (HTTP Prefetch)
 
It seems to be fine, but if you're only trying to give the members of that groups reserved slots, you only need the "a" flag.

xX Marc Xx 01-01-2011 12:17

Re: Steam Group Admins (HTTP Prefetch)
 
Englisch

Oh very nice everything is going perfectly ...

But please tell me how do you still have the number 2128350 ?????

Germany

Oh sehr schön es geht alles perfekt...

Aber bitte sag mir noch woher hast du die nummer 2128350 ?????


Mister_Magotchi 01-01-2011 22:09

Re: Steam Group Admins (HTTP Prefetch)
 
Did the number 2128350 work for you in your config?

I got it this way:
GroupID64 - 103582791429521408 = GroupID

Therefore:
103582791431649758 - 103582791429521408 = 2128350

This should also be the same number you see when you try to edit the group profile.

xX Marc Xx 01-03-2011 04:06

Re: Steam Group Admins (HTTP Prefetch)
 
Englisch

oh ok always

103582791431649758 - GroupID = Number

Deutsch

oh ok also immer

103582791431649758 - GroupID = Number

Minez 01-09-2011 12:10

Re: Steam Group Admins (HTTP Prefetch)
 
Hi Mister,

I would like to have a little bit more infos about your plugin please :)

1) Actually, there's a bug in psychonic's version wich causes that whenever the map is changed, the plugin or w/e does not load the admins properly and they need to reconnect to have their powers. Does your plugin fixes that?

2) If I choose to manually refresh the admin cache, all the admins wich already have their power will lose it?

Mister_Magotchi 01-09-2011 20:04

Re: Steam Group Admins (HTTP Prefetch)
 
1. This plugin doesn't have that problem. It's one of the reasons I made this plugin.

2. When you manually refresh the cache, all the admins that already have it will lose it until they reconnect to the server or the map changes. This only applies to admin stuff they got through this plugin. If they are also admin through something else, that won't be affected. It's something I'm missing in my plugin that probably all the other admin-cache plugins (including the stock ones) have taken care of, but I had trouble finding out what to do to fix it, and it wasn't a big enough deal for me to worry about for my own purposes, but if somebody knows how to fix it, feel free to let me know.

PtxDK 01-11-2011 02:18

Re: Steam Group Admins (HTTP Prefetch)
 
This plugin works perfectly, but i have an idea for an little upgrade.

Make it so there is members in the group that will be in one group, and the officers in the group also have another group, i mean most people don't give the same admin to all of the same group, it would make it the most awsome, ultimate plugin ive ever ever seen.

Like this plugin: https://forums.alliedmods.net/showth...=1#post1390989
the only problem about the linked plugin is just that it's bugged, if you change map all admins that have been add'ed by the plugin from the steamgroup have to rejoin to make it work..

EDIT: And just so you people(inclusive plugin maker) knows it, this plugin works perfectly, if you can't make it work, it's not the plugin that is bugged!

Quote:

Originally Posted by Minez (Post 1389846)
Hi Mister,

I would like to have a little bit more infos about your plugin please :)

1) Actually, there's a bug in psychonic's version wich causes that whenever the map is changed, the plugin or w/e does not load the admins properly and they need to reconnect to have their powers. Does your plugin fixes that?

2) If I choose to manually refresh the admin cache, all the admins wich already have their power will lose it?

M8, you are not using this plugin, you are using this plugin: https://forums.alliedmods.net/showthread.php?t=143410

remove the files that you have installed, and download this plugin instead, works mutch better !

Mister_Magotchi 01-11-2011 03:31

Re: Steam Group Admins (HTTP Prefetch)
 
Thank you for the compliment on my plugin.

Quote:

Originally Posted by PtxDK (Post 1391097)
Make it so there is members in the group that will be in one group, and the officers in the group also have another group...

I don't know if the Steam Community XML API provides this data. The XML member lists do not.

Also, Minez was asking me if my plugin had the same bug as Psychonic's plugin or not. He was not asking irrelevant questions.

Minez 01-11-2011 13:31

Re: Steam Group Admins (HTTP Prefetch)
 
Quote:

Originally Posted by PtxDK (Post 1391097)
M8, you are not using this plugin, you are using this plugin: https://forums.alliedmods.net/showthread.php?t=143410

Umm, I know?

Anyways, thank you for the answers, I am switching to this plugin now :)

Minez 01-18-2011 22:08

Re: Steam Group Admins (HTTP Prefetch)
 
This plugin slow down the server on map change. Actually, all players are dropped, just like a crash, but the map changes normally after 1 minute and server comes back online like if it had never crash.

Mister_Magotchi 01-18-2011 22:46

Re: Steam Group Admins (HTTP Prefetch)
 
It's never happened on my server to my knowledge.

What game are you running it on? Is it Windows, Linux, or Mac? What is in your "steam-group-admins-http.txt" file? What other details can you give me?

Danny.Domb 01-18-2011 22:54

Re: Steam Group Admins (HTTP Prefetch)
 
Quote:

Originally Posted by Mister_Magotchi (Post 1396590)
It's never happened on my server to my knowledge.

What game are you running it on? Is it Windows, Linux, or Mac? What is in your "steam-group-admins-http.txt" file? What other details can you give me?

I will answer some of the question for him, I happend to know him and when he disabled your plugin, his server stop from "crashing of map change"

Counter-Strike Source - Linux server hosted on gameservers.com

Mister_Magotchi 01-18-2011 23:02

Re: Steam Group Admins (HTTP Prefetch)
 
The plugin works fine on my Linux Counter-Strike: Source server, so that shouldn't be the issue. What are the contents of the config file?

Also, are you getting any errors in your SourceMod error logs?

musosoft 11-03-2011 16:22

Re: Steam Group Admins (HTTP Prefetch)
 
Hi, this plugin causes server crashes on map change, when connection to steam is lost (I think). Anyone else gets crashes too?

Code:

L 11/03/2011 - 20:55:09: [SM] Plugin encountered error 11: Invalid memory access
L 11/03/2011 - 20:55:09: [SM] Displaying call stack trace for plugin "steam-group-admins-http.smx":
L 11/03/2011 - 20:55:09: [SM]  [0]  Line 93, Y:\Games\Steam\steamapps\[email protected]\counter-strike source\cstrike\addons\sourcemod\scripting\steam-group-admins-http.sp::OnSocketReceive()


Mister_Magotchi 11-03-2011 16:36

Re: Steam Group Admins (HTTP Prefetch)
 
I've actually been seeing the same error on my server on map change, but the plugin still works, and it has never caused a crash that I've seen. I've been looking into the cause of that error, though.

Also, this plugin only connects to Steam in the sense that it grabs an XML file via HTTP from the Steam Community website.

Does your server crash on every map change, or does it only crash on certain map changes?

musosoft 11-04-2011 07:59

Re: Steam Group Admins (HTTP Prefetch)
 
Quote:

Originally Posted by Mister_Magotchi (Post 1589390)
Does your server crash on every map change, or does it only crash on certain map changes?

Thanks for reply, it does only on certain map changes...

Mister_Magotchi 11-04-2011 13:50

Re: Steam Group Admins (HTTP Prefetch)
 
I'll try to do some testing tonight where I make the connection fail on purpose and see what happens. Maybe I'll get that error worked out too. Again, I hadn't bothered with it too much originally, since it's been working for me non-stop since I published it.

Mister_Magotchi 11-04-2011 22:29

Re: Steam Group Admins (HTTP Prefetch)
 
I've done some testing just now (on a CS:S listen server on Windows), and I can't get mine to crash on a connection failure or put that "Invalid memory access" error in the error log. Everything works as I meant it to work.

My test:
  1. I installed a freshly downloaded development snapshot of MM:S, SM, Socket, and this plugin on my CS:S installation. I used the "steam-group-admins-http.txt" contents I use on my live server.
  2. Upon starting a server (just using " -insecure +map cs_office" as shortcut options), I immediately had the correct admin flags set for the Steam groups I'm in, according to "sm_who".
  3. I switched to a different map about 7 times in a row, checking that sm_who still showed me as admin each time. It never crashed that whole time, and it didn't log any errors.
  4. I picked a random, made-up IP address, made sure it wasn't a working host (tried pinging it, etc.), and by editing the Windows host file, I mapped "steamcommunity.com" to that IP.
  5. I changed the map in the still-running server.
  6. The new map loaded fine, but as expected, I didn't have any admin flags according to "sm_who". One error was logged for each of the groups in the "steam-group-admins-http.txt" file, like "[steam-group-admins-http.smx] Socket error for group ######"

As I don't know that I'll be able to reproduce your problem, I can't properly help you with it. There might be some difference on a dedicated server or on Linux, but again, the CS:S server I use it on normally is dedicated and Linux, and it works fine.

musosoft 11-05-2011 06:24

Re: Steam Group Admins (HTTP Prefetch)
 
Ok thanks, I will try some tests too, also I will update to latest stable plugin releases.

januto 12-31-2011 08:30

Re: Steam Group Admins (HTTP Prefetch)
 
Installed plugin, restarted server, connected, kicked with this message:"Server not able to authenticate user with Steam"

Mister_Magotchi 12-31-2011 13:47

Re: Steam Group Admins (HTTP Prefetch)
 
This plugin wouldn't/shouldn't produce that kind of error. That is actually a very common error in general, though. Also, are you sure it still happens when you have just the base install of MM:S, SourceMod, and this plugin?

chuj 02-06-2012 19:50

Re: Steam Group Admins (HTTP Prefetch)
 
Could you add function to generate admins_simple.ini from Steam Group users?

Mister_Magotchi 02-06-2012 19:54

Re: Steam Group Admins (HTTP Prefetch)
 
I am capable of it, but I won't, and I think that kind of a system might be better written in a different language (maybe a PHP/Perl script that, on cron, updates the admins.cfg or admins_simple.ini, optionally via FTP), although it's of course possible with SourceMod.

404UserNotFound 02-07-2012 01:42

Re: Steam Group Admins (HTTP Prefetch)
 
Let's say I was to make a Steam Group for my admins, and I was a member.

Seeing as I'm set as the RCON admin in admins-simple.ini, would this overwrite that setting and cause me to only be a basic admin?

Mister_Magotchi 02-07-2012 02:14

Re: Steam Group Admins (HTTP Prefetch)
 
No. The flags are additive between this and other admin plugins. In my admins.cfg, I have 3 admins in a group with the "z" (root) flag, and then they're also added to a group with lesser privileges via this plugin, and they still have the "z" flag.

chuj 02-07-2012 05:26

Re: Steam Group Admins (HTTP Prefetch)
 
I have some problems with using Sourcebans and CbaseServer Reserved Slots ( http://forums.alliedmods.net/showthr...=72322&page=93 ) and it would be great, if your plugin could write admins_simple.ini, or if someone could write a plugin that will create admins_simple.ini from admins.cfg+admin_groups.cfg.

Mister_Magotchi 02-07-2012 13:46

Re: Steam Group Admins (HTTP Prefetch)
 
Again, I have no intention of adding that functionality.

404UserNotFound 02-08-2012 00:57

Re: Steam Group Admins (HTTP Prefetch)
 
Quote:

Originally Posted by Mister_Magotchi (Post 1645867)
No. The flags are additive between this and other admin plugins. In my admins.cfg, I have 3 admins in a group with the "z" (root) flag, and then they're also added to a group with lesser privileges via this plugin, and they still have the "z" flag.

Perfect! Well thank you for creating such a wonderful plugin! :)

Mister_Magotchi 02-25-2012 05:05

Re: Steam Group Admins (HTTP Prefetch)
 
Plugin updated:
Quote:

0.9.5 - 2012-02-25 - Nearly complete rewrite. Switched from Socket to cURL. Fixed intermittent crash on map change. Fixed invalid memory access errors.
Due apparently to network or other changes on the server I use this on, I started getting the crashes people have mentioned on almost every map change, which allowed me to properly narrow it down to this plugin and fix it.

dcx2 02-26-2012 11:11

Re: Steam Group Admins (HTTP Prefetch)
 
Wow, this looks really neat.

May I make a request that's kinda-sorta based on this plugin? Would it be possible for you to create a similar plugin, but instead of making anyone in the steam group an admin, it would kick any client who attempted to connect who is not a member of the group?

The reason is that while I'm okay with my friends joining my friends-only game, I'm not okay with my friends' friends joining. Only allowing steam group members to join would solve that problem pretty easily.

Mister_Magotchi 02-26-2012 20:49

Re: Steam Group Admins (HTTP Prefetch)
 
I do not want to make a new plugin to do what you're saying, but technically, it can already be done with this.

Instructions (assuming a 24-slot server):
  1. In sourcemod.cfg:
    • Set: sm_reserve_type 0
    • Set: sm_reserved_slots 24
    • Set: sm_hide_slots 0 (unless you want the server to show as 0 slots in the server browser)
  2. Give all the members of the group you want to allow access a reserved slot (presumably with this plugin).
Anyone attempting to join your server that isn't in the group will get kicked due to a slot reservation. Note that with sm_hide_slots 0 as above, your server would still show as a connectable server in the server browser, and you may have a lot of anonymous people attempting to join it. Alternatively, you can set sm_hide_slots 1, and then your users would need to connect with "connect YOUR_SERVER_IP_OR_HOST:PORT" through the console, a custom game shortcut, a "steam:" link, etc., and the server should always show as full in the server browser. For example, if you had 9 connected, it should show 9/9. With 0 connected, it should show 0/0.

dcx2 02-27-2012 01:32

Re: Steam Group Admins (HTTP Prefetch)
 
Unfortunately, I don't think the reserve slots stuff works in L4D2. :(

I may try my hand at using your plugin as a base for writing my own.


All times are GMT -4. The time now is 14:56.

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