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

Admins Overrides File and Usage Partially Not Working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MjrNuT
SourceMod Donor
Join Date: Feb 2008
Location: Under the Beaming CA Sun
Old 10-05-2010 , 12:49   Admins Overrides File and Usage Partially Not Working
Reply With Quote #1

I am using this file to grant a few commands to non-admin.

One of them is for core sm_votemap, and 2 of them are for a 3rd party plugin.

Prior to Polycount (SM 1.3.4) the overrides worked as expected. Non-admins were able to access the 3 commands.

I have now upgraded to the latest (as of last night 10/4 pm) 1.4.0 dev. branch. Everything on the server runs, so far, w/o problems with exception of the overrides.

sm_votemap still works fine, however not for the 3rd party plugin. I have broached this with the plugin author, but also thought to ask if there was maybe a change in checks just to cover this side of things??

Let me know of any other info needed.

Thanks
__________________
Flames and Ash Gaming
Addon: SM v1.4.0-dev MM 1.8.5-dev
Plugins: Advertisements, Webshortcuts, spray tracer, SBans, RTD, gScramble Balance, misc
MjrNuT is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-05-2010 , 13:02   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #2

Could you show those overrides ?
Bacardi is offline
MjrNuT
SourceMod Donor
Join Date: Feb 2008
Location: Under the Beaming CA Sun
Old 10-05-2010 , 13:11   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #3

Quote:
Originally Posted by Bacardi View Post
Could you show those overrides ?
yes sir

Quote:
Overrides
{
/**
* By default, commands are registered with three pieces of information:
* 1)Command Name (for example, "csdm_enable")
* 2)Command Group Name (for example, "CSDM")
* 3)Command Level (for example, "changemap")
*
* You can override the default flags assigned to individual commands or command groups in this way.
* To override a group, use the "@" character before the name. Example:
* Examples:
* "@CSDM" "b" // Override the CSDM group to 'b' flag
* "csdm_enable" "bgi" // Override the csdm_enable command to 'bgi' flags
*
* Note that for overrides, order is important. In the above example, csdm_enable overwrites
* any setting that csdm_enable previously had.
*
* You can make a command completely public by using an empty flag string.
*/

"sm_scrim" "" //Allow anyone to use "sm_scrim"
"sm_match" "" //Allow anyone to use "sm_match"
"sm_votemap" "" //Allow anyone to use "sm_votemap"
}
__________________
Flames and Ash Gaming
Addon: SM v1.4.0-dev MM 1.8.5-dev
Plugins: Advertisements, Webshortcuts, spray tracer, SBans, RTD, gScramble Balance, misc
MjrNuT is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-05-2010 , 15:52   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #4

I guess... can't override RegConsoleCmd

Code:
    // Start a match with a quick shortcut
    RegConsoleCmd("sm_match", Command_MatchModMatch);
    
    // Start a scrim with a quick shortcut
    RegConsoleCmd("sm_scrim", Command_MatchModScrim);
But it have coded to regonize admin priviledge, it's cvar from configuration file
//"Admin flag required for access to MatchMod commands."
"matchmod_adminflag" "a"


I think when you updated MMS and SM, your lose your old configuration files. Or something have to happened.

*second edit
Are you sure you have own modified plugin about this ?
There is lot of commands behind that cvar matchmod_adminflag... be carefull if you try change them public command

Last edited by Bacardi; 10-05-2010 at 15:59.
Bacardi is offline
MjrNuT
SourceMod Donor
Join Date: Feb 2008
Location: Under the Beaming CA Sun
Old 10-05-2010 , 16:16   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #5

Hey Bacardi,

Thanks much for taking some time to look at this.

I have not edited the plugin at all.

When I updated, all I did was:

delete previous, gamedata and extension directory completely.

Upload fresh gamedata and extension folders. Upload with overwrite on the translation files. NO changes to anything related to files in configs directory or the plugin specific cvars (exception for matchmod_adminflag "b").

Yes, many other commands are actually accessible to non-admins, but those 2 are not, which I wanted to easily make available.

I'm trying to help determine if this on SM side, plugin side, or my own side.
__________________
Flames and Ash Gaming
Addon: SM v1.4.0-dev MM 1.8.5-dev
Plugins: Advertisements, Webshortcuts, spray tracer, SBans, RTD, gScramble Balance, misc
MjrNuT is offline
Hawkeye-
Senior Member
Join Date: Jan 2009
Old 10-05-2010 , 16:57   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #6

Since it's relevant, The way MatchMod evaluates the commands..

RegConsoleCommand

then inside each command (in this case sm_scrim)

Code:
public Action:Command_MatchModScrim(client, args) {

	new String:access[8];
	GetConVarString(g_cvar_adminflag,access,8);

	if (client == 0 || GetUserFlagBits(client)&ReadFlagString(access) > 0 || GetUserFlagBits(client)&ADMFLAG_ROOT > 0) {
I am not certain if this is still valid, so if I should modify the routine I can, just curious what is the recommended way to handle it.
Hawkeye- is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-05-2010 , 17:35   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #7

This have to be impossible, you override console command what is not admin command...

When execute that command, it check client before it do something forward.
Quote:
if (client == 0 || GetUserFlagBits(client)&ReadFlagString(access ) > 0 || GetUserFlagBits(client)&ADMFLAG_ROOT > 0)
client 0 = Server console or Rcon
GetUserFlagBits(client)&ReadFlagString(access ) > 0 = clients what have same flag as in that cvar matchmod_adminflag "a"
GetUserFlagBits(client)&ADMFLAG_ROOT > 0 = Root Admin, flag z

*Hawkeye- is faster

coming out of my ears...


But I tried to modified this plugin. I don't know how other way you could make these to public command.

I change sm_match and sm_crits to admin commands to flag "b"
Now your override works what you have show. (sm_match "")

Have to disable extension <autoupdate>, I didn't find that.

*edit
deleted
__________________
Do not Private Message @me

Last edited by Bacardi; 01-28-2011 at 02:48. Reason: too late
Bacardi is offline
MjrNuT
SourceMod Donor
Join Date: Feb 2008
Location: Under the Beaming CA Sun
Old 10-07-2010 , 15:48   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #8

Hey Bacardi,

So forgive me in that I may be missing something, but you edited the plugin and hardcoded the b flag for sm_match and sm_crits, in order for the overrides to work (my version)?
__________________
Flames and Ash Gaming
Addon: SM v1.4.0-dev MM 1.8.5-dev
Plugins: Advertisements, Webshortcuts, spray tracer, SBans, RTD, gScramble Balance, misc
MjrNuT is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 10-07-2010 , 18:44   Re: Admins Overrides File and Usage Partially Not Working
Reply With Quote #9

Quote:
Originally Posted by MjrNuT View Post
Hey Bacardi,

So forgive me in that I may be missing something, but you edited the plugin and hardcoded the b flag for sm_match and sm_crits, in order for the overrides to work (my version)?
Yes I change those two commands to Admin commands, flag "b"
and remove admin check.
This way you get overrides works.
__________________
Do not Private Message @me
Bacardi 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 06:18.


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