From fa2616fe4efa4651d48710c7458cd2d479e9338b Mon Sep 17 00:00:00 2001 From: Carbenium Date: Fri, 6 Dec 2013 19:13:40 +0100 Subject: Add mailbox command --- src/server/scripts/Commands/cs_misc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp index 019a962c4b1..7e28046d1e2 100644 --- a/src/server/scripts/Commands/cs_misc.cpp +++ b/src/server/scripts/Commands/cs_misc.cpp @@ -94,6 +94,7 @@ public: { "unpossess", rbac::RBAC_PERM_COMMAND_UNPOSSESS, false, &HandleUnPossessCommand, "", NULL }, { "unstuck", rbac::RBAC_PERM_COMMAND_UNSTUCK, true, &HandleUnstuckCommand, "", NULL }, { "wchange", rbac::RBAC_PERM_COMMAND_WCHANGE, false, &HandleChangeWeather, "", NULL }, + { "mailbox", rbac::RBAC_PERM_COMMAND_MAILBOX, false, &HandleMailBoxCommand, "", NULL }, { NULL, 0, false, NULL, "", NULL } }; return commandTable; @@ -2464,6 +2465,14 @@ public: player->StopCastingBindSight(); return true; } + + static bool HandleMailBoxCommand(ChatHandler* handler, char const* /*args*/) + { + Player* player = handler->GetSession()->GetPlayer(); + + handler->GetSession()->SendShowMailBox(player->GetGUID()); + return true; + } }; void AddSC_misc_commandscript() -- cgit v1.2.3 From c7b78a2b4e6c55e7057060a76aa008fcb7309a55 Mon Sep 17 00:00:00 2001 From: Discover- Date: Sun, 19 Jan 2014 14:03:09 +0100 Subject: Core/Commands: Using the '.gm vis off' command now instantly makes the GM invisible to non-GM players, instead of waiting until Player::UpdateObjectVisibility was called from a different method. Ref. #11467 --- src/server/scripts/Commands/cs_gm.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp index 55e22a8c99a..498ee68ba11 100644 --- a/src/server/scripts/Commands/cs_gm.cpp +++ b/src/server/scripts/Commands/cs_gm.cpp @@ -198,33 +198,34 @@ public: //Enable\Disable Invisible mode static bool HandleGMVisibleCommand(ChatHandler* handler, char const* args) { + Player* _player = handler->GetSession()->GetPlayer(); + if (!*args) { - handler->PSendSysMessage(LANG_YOU_ARE, handler->GetSession()->GetPlayer()->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE)); + handler->PSendSysMessage(LANG_YOU_ARE, _player->isGMVisible() ? handler->GetTrinityString(LANG_VISIBLE) : handler->GetTrinityString(LANG_INVISIBLE)); return true; } const uint32 VISUAL_AURA = 37800; std::string param = (char*)args; - Player* player = handler->GetSession()->GetPlayer(); if (param == "on") { - if (player->HasAura(VISUAL_AURA, 0)) - player->RemoveAurasDueToSpell(VISUAL_AURA); + if (_player->HasAura(VISUAL_AURA, 0)) + _player->RemoveAurasDueToSpell(VISUAL_AURA); - player->SetGMVisible(true); + _player->SetGMVisible(true); + _player->UpdateObjectVisibility(); handler->GetSession()->SendNotification(LANG_INVISIBLE_VISIBLE); return true; } if (param == "off") { + _player->AddAura(VISUAL_AURA, _player); + _player->SetGMVisible(false); + _player->UpdateObjectVisibility(); handler->GetSession()->SendNotification(LANG_INVISIBLE_INVISIBLE); - player->SetGMVisible(false); - - player->AddAura(VISUAL_AURA, player); - return true; } @@ -236,12 +237,11 @@ public: //Enable\Disable GM Mode static bool HandleGMCommand(ChatHandler* handler, char const* args) { + Player* _player = handler->GetSession()->GetPlayer(); + if (!*args) { - if (handler->GetSession()->GetPlayer()->IsGameMaster()) - handler->GetSession()->SendNotification(LANG_GM_ON); - else - handler->GetSession()->SendNotification(LANG_GM_OFF); + handler->GetSession()->SendNotification(_player->IsGameMaster() ? LANG_GM_ON : LANG_GM_OFF); return true; } @@ -249,9 +249,9 @@ public: if (param == "on") { - handler->GetSession()->GetPlayer()->SetGameMaster(true); + _player->SetGameMaster(true); handler->GetSession()->SendNotification(LANG_GM_ON); - handler->GetSession()->GetPlayer()->UpdateTriggerVisibility(); + _player->UpdateTriggerVisibility(); #ifdef _DEBUG_VMAPS VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager(); vMapManager->processCommand("stoplog"); @@ -261,9 +261,9 @@ public: if (param == "off") { - handler->GetSession()->GetPlayer()->SetGameMaster(false); + _player->SetGameMaster(false); handler->GetSession()->SendNotification(LANG_GM_OFF); - handler->GetSession()->GetPlayer()->UpdateTriggerVisibility(); + _player->UpdateTriggerVisibility(); #ifdef _DEBUG_VMAPS VMAP::IVMapManager* vMapManager = VMAP::VMapFactory::createOrGetVMapManager(); vMapManager->processCommand("startlog"); -- cgit v1.2.3