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

This commit is contained in:
Spp- committed 2011-09-08 15:11:55 +02:00
1 parent d5cbc97373
commit 327fe7c247
23 files changed
+174 -90

No files matched your search

+3 -2
View File
@@ -44,6 +44,7 @@
#include "Log.h"
#include "WorldLog.h"
#include "ScriptMgr.h"
#include "AccountMgr.h"
#if defined(__GNUC__)
#pragma pack(1)
@@ -935,7 +936,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
// Check locked state for server
AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security));
if (allowedAccountType > SEC_PLAYER && AccountTypes(security) < allowedAccountType)
if (AccountTypes(security) < allowedAccountType)
{
WorldPacket Packet (SMSG_AUTH_RESPONSE, 1);
Packet << uint8 (AUTH_UNAVAILABLE);
@@ -1039,7 +1040,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
{
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
if (m_Session && m_Session->GetSecurity() == SEC_PLAYER)
if (m_Session && AccountMgr::IsPlayerAccount(m_Session->GetSecurity()))
{
Player* _player = m_Session->GetPlayer();
sLog->outError("WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",