mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 18:15:31 +01:00
Core/RBAC: Create new permissions 'Use staff badge in chat' and 'Check if should appear in .gm ingame command'
This commit is contained in:
@@ -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())
|
||||
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;
|
||||
|
||||
if (param == "on")
|
||||
{
|
||||
session->GetPlayer()->SetGMChat(true);
|
||||
session->SendNotification(LANG_GM_CHAT_ON);
|
||||
else
|
||||
return true;
|
||||
}
|
||||
|
||||
if (param == "off")
|
||||
{
|
||||
session->GetPlayer()->SetGMChat(false);
|
||||
session->SendNotification(LANG_GM_CHAT_OFF);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string param = (char*)args;
|
||||
|
||||
if (param == "on")
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->SetGMChat(true);
|
||||
handler->GetSession()->SendNotification(LANG_GM_CHAT_ON);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (param == "off")
|
||||
{
|
||||
handler->GetSession()->GetPlayer()->SetGMChat(false);
|
||||
handler->GetSession()->SendNotification(LANG_GM_CHAT_OFF);
|
||||
return true;
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user