diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-09-20 03:31:54 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-27 20:59:19 +0100 |
commit | 46d4e2fa8378eed414c07eb161a19b772c474735 (patch) | |
tree | d075a9e3b907399fd4216a2f03e020959c4301a6 /src/server/scripts/Commands | |
parent | 3fd2eb126cbed36292fa5defc024c2b93e8d8671 (diff) |
1eca51b follow-up, nuke `command`.`permission` from orbit; it was only duplicating data already stored in the core.
(cherry picked from commit 991dc8e050777b5e33ff22b008ab2125bae22437)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r-- | src/server/scripts/Commands/cs_gm.cpp | 36 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_misc.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/Commands/cs_reload.cpp | 13 |
3 files changed, 15 insertions, 36 deletions
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 17b7889b64a..54078045b85 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -50,7 +50,8 @@ public: { "ingame", HandleGMListIngameCommand, rbac::RBAC_PERM_COMMAND_GM_INGAME, Console::Yes }, { "list", HandleGMListFullCommand, rbac::RBAC_PERM_COMMAND_GM_LIST, Console::Yes }, { "visible", HandleGMVisibleCommand, rbac::RBAC_PERM_COMMAND_GM_VISIBLE, Console::No }, - { "", HandleGMCommand, rbac::RBAC_PERM_COMMAND_GM, Console::No }, + { "on", HandleGMOnCommand, rbac::RBAC_PERM_COMMAND_GM, Console::No }, + { "off", HandleGMOffCommand, rbac::RBAC_PERM_COMMAND_GM, Console::No }, }; static ChatCommandTable commandTable = { @@ -222,30 +223,19 @@ public: return true; } - //Enable\Disable GM Mode - static bool HandleGMCommand(ChatHandler* handler, Optional<bool> enableArg) + static bool HandleGMOnCommand(ChatHandler* handler) { - Player* _player = handler->GetSession()->GetPlayer(); - - if (!enableArg) - { - handler->GetSession()->SendNotification(_player->IsGameMaster() ? LANG_GM_ON : LANG_GM_OFF); - return true; - } - - if (*enableArg) - { - _player->SetGameMaster(true); - handler->GetSession()->SendNotification(LANG_GM_ON); - _player->UpdateTriggerVisibility(); - } - else - { - _player->SetGameMaster(false); - handler->GetSession()->SendNotification(LANG_GM_OFF); - _player->UpdateTriggerVisibility(); - } + handler->GetPlayer()->SetGameMaster(true); + handler->GetPlayer()->UpdateTriggerVisibility(); + handler->GetSession()->SendNotification(LANG_GM_ON); + return true; + } + static bool HandleGMOffCommand(ChatHandler* handler) + { + handler->GetPlayer()->SetGameMaster(false); + handler->GetPlayer()->UpdateTriggerVisibility(); + handler->GetSession()->SendNotification(LANG_GM_OFF); return true; } }; diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 7985a1ad5bb..c89360972f2 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -701,6 +701,8 @@ public: static bool HandleHelpCommand(ChatHandler* handler, Tail cmd) { Trinity::ChatCommands::SendCommandHelpFor(*handler, cmd); + if (cmd.empty()) + Trinity::ChatCommands::SendCommandHelpFor(*handler, "help"); return true; } diff --git a/src/server/scripts/Commands/cs_reload.cpp b/src/server/scripts/Commands/cs_reload.cpp index 9efb9155dce..eac2eb77640 100644 --- a/src/server/scripts/Commands/cs_reload.cpp +++ b/src/server/scripts/Commands/cs_reload.cpp @@ -89,7 +89,6 @@ public: { "autobroadcast", rbac::RBAC_PERM_COMMAND_RELOAD_AUTOBROADCAST, true, &HandleReloadAutobroadcastCommand, "" }, { "battleground_template", rbac::RBAC_PERM_COMMAND_RELOAD_BATTLEGROUND_TEMPLATE, true, &HandleReloadBattlegroundTemplate, "" }, { "character_template", rbac::RBAC_PERM_COMMAND_RELOAD_CHARACTER_TEMPLATE, true, &HandleReloadCharacterTemplate, "" }, - { "command", rbac::RBAC_PERM_COMMAND_RELOAD_COMMAND, true, &HandleReloadCommandCommand, "" }, { "conditions", rbac::RBAC_PERM_COMMAND_RELOAD_CONDITIONS, true, &HandleReloadConditions, "" }, { "config", rbac::RBAC_PERM_COMMAND_RELOAD_CONFIG, true, &HandleReloadConfigCommand, "" }, { "conversation_template", rbac::RBAC_PERM_COMMAND_RELOAD_CONVERSATION_TEMPLATE, true, &HandleReloadConversationTemplateCommand, "" }, @@ -204,7 +203,6 @@ public: HandleReloadAccessRequirementCommand(handler, ""); HandleReloadMailLevelRewardCommand(handler, ""); - HandleReloadCommandCommand(handler, ""); HandleReloadReservedNameCommand(handler, ""); HandleReloadTrinityStringCommand(handler, ""); HandleReloadGameTeleCommand(handler, ""); @@ -410,17 +408,6 @@ public: return true; } - static bool HandleReloadCommandCommand(ChatHandler* handler, char const* /*args*/) - { - TC_LOG_INFO("misc", "Reloading .command information..."); - Trinity::ChatCommands::LoadCommandMap(); - handler->SendGlobalGMSysMessage("DB table `command` reloaded."); - - // do not log this invocation, otherwise we might crash (the command table we used to get here is no longer valid!) - handler->SetSentErrorMessage(true); - return false; - } - static bool HandleReloadOnKillReputationCommand(ChatHandler* handler, char const* /*args*/) { TC_LOG_INFO("misc", "Re-Loading creature award reputation definitions..."); |