aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2020-09-20 03:31:54 +0200
committerTreeston <treeston.mmoc@gmail.com>2020-09-20 03:31:54 +0200
commit991dc8e050777b5e33ff22b008ab2125bae22437 (patch)
tree4bc988c6b4c4e38c08e44c6b676b83a8911bb25b /src/server/scripts/Commands
parent1eca51b417678b9a48b28552925d5694105f82bb (diff)
1eca51b follow-up, nuke `command`.`permission` from orbit; it was only duplicating data already stored in the core.
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp36
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
-rw-r--r--src/server/scripts/Commands/cs_reload.cpp13
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 a2206d37737..c7aea3765f1 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 =
{
@@ -220,30 +221,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 c4bad133ddf..5e386d53474 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -695,6 +695,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 5b7dc280a56..84b22033d80 100644
--- a/src/server/scripts/Commands/cs_reload.cpp
+++ b/src/server/scripts/Commands/cs_reload.cpp
@@ -85,7 +85,6 @@ public:
{ "autobroadcast", rbac::RBAC_PERM_COMMAND_RELOAD_AUTOBROADCAST, true, &HandleReloadAutobroadcastCommand, "" },
{ "battleground_template", rbac::RBAC_PERM_COMMAND_RELOAD_BATTLEGROUND_TEMPLATE, true, &HandleReloadBattlegroundTemplate, "" },
{ "broadcast_text", rbac::RBAC_PERM_COMMAND_RELOAD_BROADCAST_TEXT, true, &HandleReloadBroadcastTextCommand, "" },
- { "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, "" },
{ "creature_text", rbac::RBAC_PERM_COMMAND_RELOAD_CREATURE_TEXT, true, &HandleReloadCreatureText, "" },
@@ -197,7 +196,6 @@ public:
HandleReloadAccessRequirementCommand(handler, "");
HandleReloadMailLevelRewardCommand(handler, "");
- HandleReloadCommandCommand(handler, "");
HandleReloadReservedNameCommand(handler, "");
HandleReloadTrinityStringCommand(handler, "");
HandleReloadGameTeleCommand(handler, "");
@@ -405,17 +403,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...");