aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Accounts/RBAC.h2
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp46
2 files changed, 27 insertions, 21 deletions
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 1c2cd9dd27a..80a493febe0 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -63,6 +63,8 @@ enum RBACPermissions
RBAC_PERM_COMMANDS_SAVE_WITHOUT_DELAY = 30,
RBAC_PERM_COMMANDS_USE_UNSTUCK_WITH_ARGS = 31,
RBAC_PERM_COMMANDS_BE_ASSIGNED_TICKET = 32,
+ RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST = 34,
+ RBAC_PERM_CHAT_USE_STAFF_BADGE = 37,
RBAC_PERM_RESURRECT_WITH_FULL_HPS = 38,
RBAC_PERM_MAX
};
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index 932bb562f11..168a5ec60b8 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -59,30 +59,32 @@ public:
// Enables or disables hiding of the staff badge
static bool HandleGMChatCommand(ChatHandler* handler, char const* args)
{
- if (!*args)
+ if (WorldSession* session = handler->GetSession())
{
- WorldSession* session = handler->GetSession();
- if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->isGMChat())
- session->SendNotification(LANG_GM_CHAT_ON);
- else
- session->SendNotification(LANG_GM_CHAT_OFF);
- return true;
- }
+ if (!*args)
+ {
+ if (session->HasPermission(RBAC_PERM_CHAT_USE_STAFF_BADGE) && session->GetPlayer()->isGMChat())
+ session->SendNotification(LANG_GM_CHAT_ON);
+ else
+ session->SendNotification(LANG_GM_CHAT_OFF);
+ return true;
+ }
- std::string param = (char*)args;
+ std::string param = (char*)args;
- if (param == "on")
- {
- handler->GetSession()->GetPlayer()->SetGMChat(true);
- handler->GetSession()->SendNotification(LANG_GM_CHAT_ON);
- return true;
- }
+ if (param == "on")
+ {
+ session->GetPlayer()->SetGMChat(true);
+ session->SendNotification(LANG_GM_CHAT_ON);
+ return true;
+ }
- if (param == "off")
- {
- handler->GetSession()->GetPlayer()->SetGMChat(false);
- handler->GetSession()->SendNotification(LANG_GM_CHAT_OFF);
- return true;
+ if (param == "off")
+ {
+ session->GetPlayer()->SetGMChat(false);
+ session->SendNotification(LANG_GM_CHAT_OFF);
+ return true;
+ }
}
handler->SendSysMessage(LANG_USE_BOL);
@@ -126,7 +128,9 @@ public:
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
{
AccountTypes itrSec = itr->second->GetSession()->GetSecurity();
- if ((itr->second->isGameMaster() || (!AccountMgr::IsPlayerAccount(itrSec) && itrSec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
+ if ((itr->second->isGameMaster() ||
+ (itr->second->GetSession()->HasPermission(RBAC_PERM_COMMANDS_APPEAR_IN_GM_LIST) &&
+ itrSec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
{
if (first)