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

Admin flag and group assigment


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-29-2015 , 10:40   Admin flag and group assigment
Reply With Quote #1

Ok so, I was wondering if there is something special that I have to do to get the sourcemod admin system to update the admin cache for a client.

I've created a group with override flags giving allow,
I then do the following:

FindAdminByIdentity else CreateAdmin (using steam2 / AUTHMETHOD_STEAM)
I then run through the groups I want to give them, and do AdminInheritGroup

They get the groups, and if i check their groups with GetAdminGroupCount/GetAdminGroup it shows them int the group, also the groupcmdoverrides are there, but they fail the checkcommandaccess checks on the flags in the group.

I have tried returning Plugin_Handled in OnClientPreAdminCheck, and then:

RunAdminCacheChecks(client);
NotifyPostAdminCheck(client);

This however, does not give them access still, so what am I doing wrong here

If I reload the admin cache with sm_reloadadmins, it will work then...
I have a OnRebuildAdminCache where I rebuild the groups/groupcmdoverrides on AdminCache_Groups and then recreate/assign the admins again on AdminCache_Admins.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-29-2015 , 11:13   Re: Admin flag and group assigment
Reply With Quote #2

Given that sm_reloadadmins runs DumpAdminCache, maybe you should try that?

Edit: Having said that, OnClientPostAdminFilter is there to modify user permissions during the connection phase.

Edit 2: Maybe it'd just be easier if you posted code or at least sample code similar to what you've got.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 04-29-2015 at 11:18.
Powerlord is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 04-29-2015 , 17:17   Re: Admin flag and group assigment
Reply With Quote #3

Its a bit hard to debug because sm_dump_admincache causes the server to crash... it does this on all my windows servers.. On all sm branches.

Basically, the plugin does this:
Fetches groups from mysql when the plugin loads, and it creates the groups and sets command overrides for those groups.

Then, when each admin loads, ot creates/assigns an identity, and if they are supposed to belong to said group, it places them in it. I'm not sure dumping thr cache every time a client connects to the server would be the proper thing to do.. If need be, I suppose I could call that for admin part each time it loads an admin in need of assigning a group... But I think there should be a simpler way.

Handle on preadmincheck should allow all groups to be assigned after the admin identity is created, so once i notify post admin check, all plugins that use onclientpostadmincheck will work correctly with these overrides.

I'll work on it more to orrow and post some bits if it doesn't work. It's just rather odd.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram 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 02:59.


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