From 28f9317698aec3eb8480e6682af3c4c65a98707c Mon Sep 17 00:00:00 2001 From: Nay Date: Mon, 2 Sep 2013 13:25:07 +0100 Subject: Core/RBAC: Move cast and characters commands to RBAC (using individual permissions) --- src/server/game/Accounts/RBAC.h | 26 ++++++++++++++-- src/server/scripts/Commands/cs_cast.cpp | 18 ++++++------ src/server/scripts/Commands/cs_character.cpp | 44 ++++++++++++++-------------- 3 files changed, 55 insertions(+), 33 deletions(-) (limited to 'src') diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h index 901465fd16d..492a7197cfe 100644 --- a/src/server/game/Accounts/RBAC.h +++ b/src/server/game/Accounts/RBAC.h @@ -166,8 +166,30 @@ enum RBACPermissions RBAC_PERM_COMMAND_ACCOUNT_SET_SEC = 264, RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_EMAIL = 265, RBAC_PERM_COMMAND_ACCOUNT_SET_SEC_REGMAIL = 266, - // 6 reserved for cast (267-272) - // 18 reserved for character (273-290) + RBAC_PERM_COMMAND_CAST = 267, + RBAC_PERM_COMMAND_CAST_BACK = 268, + RBAC_PERM_COMMAND_CAST_DIST = 269, + RBAC_PERM_COMMAND_CAST_SELF = 270, + RBAC_PERM_COMMAND_CAST_TARGET = 271, + RBAC_PERM_COMMAND_CAST_DEST = 272, + RBAC_PERM_COMMAND_CHARACTER = 273, + RBAC_PERM_COMMAND_CHARACTER_CUSTOMIZE = 274, + RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION = 275, + RBAC_PERM_COMMAND_CHARACTER_CHANGERACE = 276, + RBAC_PERM_COMMAND_CHARACTER_DELETED = 277, + RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE = 278, // Not in DB - console + RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST = 279, + RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE = 280, + RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD = 281, // Not in DB - console + RBAC_PERM_COMMAND_CHARACTER_ERASE = 282, // Not in DB - console + RBAC_PERM_COMMAND_CHARACTER_LEVEL = 283, + RBAC_PERM_COMMAND_CHARACTER_RENAME = 284, + RBAC_PERM_COMMAND_CHARACTER_REPUTATION = 285, + RBAC_PERM_COMMAND_CHARACTER_TITLES = 286, + RBAC_PERM_COMMAND_LEVELUP = 287, + RBAC_PERM_COMMAND_PDUMP = 288, + RBAC_PERM_COMMAND_PDUMP_LOAD = 289, + RBAC_PERM_COMMAND_PDUMP_WRITE = 290, RBAC_PERM_COMMAND_CHEAT = 291, RBAC_PERM_COMMAND_CHEAT_CASTTIME = 292, RBAC_PERM_COMMAND_CHEAT_COOLDOWN = 293, diff --git a/src/server/scripts/Commands/cs_cast.cpp b/src/server/scripts/Commands/cs_cast.cpp index 02a3aec9e82..cbcbbd214b3 100644 --- a/src/server/scripts/Commands/cs_cast.cpp +++ b/src/server/scripts/Commands/cs_cast.cpp @@ -37,18 +37,18 @@ public: { static ChatCommand castCommandTable[] = { - { "back", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCastBackCommand, "", NULL }, - { "dist", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCastDistCommand, "", NULL }, - { "self", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCastSelfCommand, "", NULL }, - { "target", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCastTargetCommad, "", NULL }, - { "dest", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCastDestCommand, "", NULL }, - { "", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleCastCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "back", RBAC_PERM_COMMAND_CAST_BACK, false, &HandleCastBackCommand, "", NULL }, + { "dist", RBAC_PERM_COMMAND_CAST_DIST, false, &HandleCastDistCommand, "", NULL }, + { "self", RBAC_PERM_COMMAND_CAST_SELF, false, &HandleCastSelfCommand, "", NULL }, + { "target", RBAC_PERM_COMMAND_CAST_TARGET, false, &HandleCastTargetCommad, "", NULL }, + { "dest", RBAC_PERM_COMMAND_CAST_DEST, false, &HandleCastDestCommand, "", NULL }, + { "", RBAC_PERM_COMMAND_CAST, false, &HandleCastCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "cast", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", castCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "cast", RBAC_PERM_COMMAND_CAST, false, NULL, "", castCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } diff --git a/src/server/scripts/Commands/cs_character.cpp b/src/server/scripts/Commands/cs_character.cpp index d9baa5d56c3..185ce458b61 100644 --- a/src/server/scripts/Commands/cs_character.cpp +++ b/src/server/scripts/Commands/cs_character.cpp @@ -39,39 +39,39 @@ public: { static ChatCommand pdumpCommandTable[] = { - { "load", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandlePDumpLoadCommand, "", NULL }, - { "write", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandlePDumpWriteCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "load", RBAC_PERM_COMMAND_PDUMP_LOAD, true, &HandlePDumpLoadCommand, "", NULL }, + { "write", RBAC_PERM_COMMAND_PDUMP_WRITE, true, &HandlePDumpWriteCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand characterDeletedCommandTable[] = { - { "delete", RBAC_PERM_CONSOLE_COMMANDS, true, &HandleCharacterDeletedDeleteCommand, "", NULL }, - { "list", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleCharacterDeletedListCommand, "", NULL }, - { "restore", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleCharacterDeletedRestoreCommand, "", NULL }, - { "old", RBAC_PERM_CONSOLE_COMMANDS, true, &HandleCharacterDeletedOldCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "delete", RBAC_PERM_COMMAND_CHARACTER_DELETED_DELETE, true, &HandleCharacterDeletedDeleteCommand, "", NULL }, + { "list", RBAC_PERM_COMMAND_CHARACTER_DELETED_LIST, true, &HandleCharacterDeletedListCommand, "", NULL }, + { "restore", RBAC_PERM_COMMAND_CHARACTER_DELETED_RESTORE, true, &HandleCharacterDeletedRestoreCommand, "", NULL }, + { "old", RBAC_PERM_COMMAND_CHARACTER_DELETED_OLD, true, &HandleCharacterDeletedOldCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand characterCommandTable[] = { - { "customize", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCharacterCustomizeCommand, "", NULL }, - { "changefaction", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCharacterChangeFactionCommand, "", NULL }, - { "changerace", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCharacterChangeRaceCommand, "", NULL }, - { "deleted", RBAC_PERM_GAMEMASTER_COMMANDS, true, NULL, "", characterDeletedCommandTable }, - { "erase", RBAC_PERM_CONSOLE_COMMANDS, true, &HandleCharacterEraseCommand, "", NULL }, - { "level", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, &HandleCharacterLevelCommand, "", NULL }, - { "rename", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCharacterRenameCommand, "", NULL }, - { "reputation", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCharacterReputationCommand, "", NULL }, - { "titles", RBAC_PERM_GAMEMASTER_COMMANDS, true, &HandleCharacterTitlesCommand, "", NULL }, - { NULL, 0, false, NULL, "", NULL } + { "customize", RBAC_PERM_COMMAND_CHARACTER_CUSTOMIZE, true, &HandleCharacterCustomizeCommand, "", NULL }, + { "changefaction", RBAC_PERM_COMMAND_CHARACTER_CHANGEFACTION, true, &HandleCharacterChangeFactionCommand, "", NULL }, + { "changerace", RBAC_PERM_COMMAND_CHARACTER_CHANGERACE, true, &HandleCharacterChangeRaceCommand, "", NULL }, + { "deleted", RBAC_PERM_COMMAND_CHARACTER_DELETED, true, NULL, "", characterDeletedCommandTable }, + { "erase", RBAC_PERM_COMMAND_CHARACTER_ERASE, true, &HandleCharacterEraseCommand, "", NULL }, + { "level", RBAC_PERM_COMMAND_CHARACTER_LEVEL, true, &HandleCharacterLevelCommand, "", NULL }, + { "rename", RBAC_PERM_COMMAND_CHARACTER_RENAME, true, &HandleCharacterRenameCommand, "", NULL }, + { "reputation", RBAC_PERM_COMMAND_CHARACTER_REPUTATION, true, &HandleCharacterReputationCommand, "", NULL }, + { "titles", RBAC_PERM_COMMAND_CHARACTER_TITLES, true, &HandleCharacterTitlesCommand, "", NULL }, + { NULL, 0, false, NULL, "", NULL } }; static ChatCommand commandTable[] = { - { "character", RBAC_PERM_GAMEMASTER_COMMANDS, true, NULL, "", characterCommandTable }, - { "levelup", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleLevelUpCommand, "", NULL }, - { "pdump", RBAC_PERM_ADMINISTRATOR_COMMANDS, true, NULL, "", pdumpCommandTable }, - { NULL, 0, false, NULL, "", NULL } + { "character", RBAC_PERM_COMMAND_CHARACTER, true, NULL, "", characterCommandTable }, + { "levelup", RBAC_PERM_COMMAND_LEVELUP, false, &HandleLevelUpCommand, "", NULL }, + { "pdump", RBAC_PERM_COMMAND_PDUMP, true, NULL, "", pdumpCommandTable }, + { NULL, 0, false, NULL, "", NULL } }; return commandTable; } -- cgit v1.2.3