Core: Define helper functions to know if an account is Player, Moderator, GM, Admin or Console

This commit is contained in:
Spp-
2011-09-08 15:11:55 +02:00
parent d5cbc97373
commit 327fe7c247
23 changed files with 174 additions and 90 deletions
+3 -3
View File
@@ -260,7 +260,7 @@ World::AddSession_(WorldSession* s)
if (decrease_session)
--Sessions;
if (pLimit > 0 && Sessions >= pLimit && s->GetSecurity() == SEC_PLAYER && !HasRecentlyDisconnected(s))
if (pLimit > 0 && Sessions >= pLimit && AccountMgr::IsPlayerAccount(s->GetSecurity()) && !HasRecentlyDisconnected(s))
{
AddQueuedPlayer (s);
UpdateMaxSessionCounters();
@@ -2037,7 +2037,7 @@ void World::SendGlobalGMMessage(WorldPacket* packet, WorldSession* self, uint32
itr->second->GetPlayer() &&
itr->second->GetPlayer()->IsInWorld() &&
itr->second != self &&
itr->second->GetSecurity() > SEC_PLAYER &&
!AccountMgr::IsPlayerAccount(itr->second->GetSecurity()) &&
(team == 0 || itr->second->GetPlayer()->GetTeam() == team))
{
itr->second->SendPacket(packet);
@@ -2134,7 +2134,7 @@ void World::SendGMText(int32 string_id, ...)
if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
continue;
if (itr->second->GetSecurity() < SEC_MODERATOR)
if (AccountMgr::IsPlayerAccount(itr->second->GetSecurity()))
continue;
wt_do(itr->second->GetPlayer());