tested and fixed a few issues in the flat file reader

fixed the admin_levels.cfg file

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40452
This commit is contained in:
David Anderson 2007-02-07 03:34:24 +00:00
parent 8c8b240617
commit 06fa51700f
3 changed files with 55 additions and 44 deletions

View File

@ -11,43 +11,51 @@ Levels
*/
Flags
{
"reservation" "a"
"kick" "b"
"ban" "c"
"unban" "d"
"slay" "e"
"changemap" "f"
"cvars" "g"
"config" "h"
"chat" "i"
"vote" "j"
"password" "k"
"rcon" "l"
"cheats" "m"
"custom1" "n"
"custom2" "o"
"custom3" "p"
"custom4" "q"
"custom5" "r"
"custom6" "s"
"reservation" "a" //Reserved slots
"generic" "b" //Generic admin, required for admins
"kick" "c" //Kick other players
"ban" "d" //Banning other players
"unban" "e" //Removing bans
"slay" "f" //Slaying other players
"changemap" "g" //Changing the map
"cvars" "h" //Changing cvars
"config" "i" //Changing configs
"chat" "j" //Special chat privileges
"vote" "k" //Voting
"password" "l" //Password the server
"rcon" "m" //Remote console
"cheats" "n" //Change sv_cheats and related commands
//Custom flags START
//Custom flags END
/**
* Custom flags can be used by plugins, but they can also be used to
* for you to expand on the previous groups, using Overrides.
*/
//Note - root is a magic access flag that grants all permissions.
"custom1" "o"
"custom2" "p"
"custom3" "q"
"custom4" "r"
"custom5" "s"
"custom6" "t"
/**
* Root is a magic access flag that grants all permissions.
* This should only be given to trusted administrators.
* Root users can only be targetted by other root users.
*/
"root" "z"
}
/**
* By default, commands are registered with three pieces of information:
* 1)Command Name (for example, "csdm_enable")
* 2)Command Group Name (for example, "CSDM")
* 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" "i" // Override the CSDM group
* "csdm_enable" "j" // Override the csdm_enable command
* "@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.
*/

View File

@ -35,24 +35,25 @@ LoadDefaultLetters()
}
g_FlagLetters['a'-'a'] = Admin_Reservation;
g_FlagLetters['b'-'a'] = Admin_Kick;
g_FlagLetters['c'-'a'] = Admin_Ban;
g_FlagLetters['d'-'a'] = Admin_Unban;
g_FlagLetters['e'-'a'] = Admin_Slay;
g_FlagLetters['f'-'a'] = Admin_Changemap;
g_FlagLetters['g'-'a'] = Admin_Convars;
g_FlagLetters['h'-'a'] = Admin_Config;
g_FlagLetters['i'-'a'] = Admin_Chat;
g_FlagLetters['j'-'a'] = Admin_Vote;
g_FlagLetters['k'-'a'] = Admin_Password;
g_FlagLetters['l'-'a'] = Admin_RCON;
g_FlagLetters['m'-'a'] = Admin_Cheats;
g_FlagLetters['n'-'a'] = Admin_Custom1;
g_FlagLetters['o'-'a'] = Admin_Custom2;
g_FlagLetters['p'-'a'] = Admin_Custom3;
g_FlagLetters['q'-'a'] = Admin_Custom4;
g_FlagLetters['r'-'a'] = Admin_Custom5;
g_FlagLetters['s'-'a'] = Admin_Custom6;
g_FlagLetters['b'-'a'] = Admin_Generic;
g_FlagLetters['c'-'a'] = Admin_Kick;
g_FlagLetters['d'-'a'] = Admin_Ban;
g_FlagLetters['e'-'a'] = Admin_Unban;
g_FlagLetters['f'-'a'] = Admin_Slay;
g_FlagLetters['g'-'a'] = Admin_Changemap;
g_FlagLetters['h'-'a'] = Admin_Convars;
g_FlagLetters['i'-'a'] = Admin_Config;
g_FlagLetters['j'-'a'] = Admin_Chat;
g_FlagLetters['k'-'a'] = Admin_Vote;
g_FlagLetters['l'-'a'] = Admin_Password;
g_FlagLetters['m'-'a'] = Admin_RCON;
g_FlagLetters['n'-'a'] = Admin_Cheats;
g_FlagLetters['o'-'a'] = Admin_Custom1;
g_FlagLetters['p'-'a'] = Admin_Custom2;
g_FlagLetters['q'-'a'] = Admin_Custom3;
g_FlagLetters['r'-'a'] = Admin_Custom4;
g_FlagLetters['s'-'a'] = Admin_Custom5;
g_FlagLetters['t'-'a'] = Admin_Custom6;
g_FlagLetters['z'-'a'] = Admin_Root;
}
@ -107,6 +108,8 @@ public SMCResult:ReadLevels_KeyValue(Handle:smc, const String:key[], const Strin
flag = Admin_Reservation;
} else if (StrEqual(key, "kick")) {
flag = Admin_Kick;
} else if (StrEqual(key, "generic")) {
flag = Admin_Generic;
} else if (StrEqual(key, "ban")) {
flag = Admin_Ban;
} else if (StrEqual(key, "unban")) {

View File

@ -158,7 +158,7 @@ ReadUsers()
{
InitializeUserParser();
BuildPath(Path_SM, g_Filename, sizeof(g_Filename), "configs/admims.cfg");
BuildPath(Path_SM, g_Filename, sizeof(g_Filename), "configs/admins.cfg");
/* Set states */
InitGlobalStates();