Core: Define helper functions to know if an account is Player, Moderator, GM, Admin or Console
This commit is contained in:
@@ -220,4 +220,70 @@ std::string CalculateShaPassHash(std::string& name, std::string& password)
|
|||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsPlayerAccount(uint32 gmlevel)
|
||||||
|
{
|
||||||
|
switch (gmlevel)
|
||||||
|
{
|
||||||
|
case SEC_CONSOLE:
|
||||||
|
case SEC_ADMINISTRATOR:
|
||||||
|
case SEC_GAMEMASTER:
|
||||||
|
case SEC_MODERATOR:
|
||||||
|
return false;
|
||||||
|
default:
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsModeratorAccount(uint32 gmlevel)
|
||||||
|
{
|
||||||
|
switch (gmlevel)
|
||||||
|
{
|
||||||
|
case SEC_CONSOLE:
|
||||||
|
case SEC_ADMINISTRATOR:
|
||||||
|
case SEC_GAMEMASTER:
|
||||||
|
case SEC_MODERATOR:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsGMAccount(uint32 gmlevel)
|
||||||
|
{
|
||||||
|
switch (gmlevel)
|
||||||
|
{
|
||||||
|
case SEC_CONSOLE:
|
||||||
|
case SEC_ADMINISTRATOR:
|
||||||
|
case SEC_GAMEMASTER:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsAdminAccount(uint32 gmlevel)
|
||||||
|
{
|
||||||
|
switch (gmlevel)
|
||||||
|
{
|
||||||
|
case SEC_CONSOLE:
|
||||||
|
case SEC_ADMINISTRATOR:
|
||||||
|
case SEC_MODERATOR:
|
||||||
|
case SEC_PLAYER:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool IsConsoleAccount(uint32 gmlevel)
|
||||||
|
{
|
||||||
|
switch (gmlevel)
|
||||||
|
{
|
||||||
|
case SEC_CONSOLE:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} // Namespace AccountMgr
|
} // Namespace AccountMgr
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ namespace AccountMgr
|
|||||||
std::string CalculateShaPassHash(std::string& name, std::string& password);
|
std::string CalculateShaPassHash(std::string& name, std::string& password);
|
||||||
|
|
||||||
bool normalizeString(std::string& utf8String);
|
bool normalizeString(std::string& utf8String);
|
||||||
|
bool IsPlayerAccount(uint32 gmlevel);
|
||||||
|
bool IsModeratorAccount(uint32 gmlevel);
|
||||||
|
bool IsGMAccount(uint32 gmlevel);
|
||||||
|
bool IsAdminAccount(uint32 gmlevel);
|
||||||
|
bool IsConsoleAccount(uint32 gmlevel);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -112,13 +112,13 @@ void AuctionHouseMgr::SendAuctionWonMail(AuctionEntry *auction, SQLTransaction&
|
|||||||
bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid);
|
bidder_accId = sObjectMgr->GetPlayerAccountIdByGUID(bidder_guid);
|
||||||
bidder_security = AccountMgr::GetSecurity(bidder_accId, realmID);
|
bidder_security = AccountMgr::GetSecurity(bidder_accId, realmID);
|
||||||
|
|
||||||
if (bidder_security > SEC_PLAYER) // not do redundant DB requests
|
if (!AccountMgr::IsPlayerAccount(bidder_security)) // not do redundant DB requests
|
||||||
{
|
{
|
||||||
if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid, bidder_name))
|
if (!sObjectMgr->GetPlayerNameByGUID(bidder_guid, bidder_name))
|
||||||
bidder_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
bidder_name = sObjectMgr->GetTrinityStringForDBCLocale(LANG_UNKNOWN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bidder_security > SEC_PLAYER)
|
if (!AccountMgr::IsPlayerAccount(bidder_security))
|
||||||
{
|
{
|
||||||
std::string owner_name;
|
std::string owner_name;
|
||||||
if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, owner_name))
|
if (!sObjectMgr->GetPlayerNameByGUID(auction->owner, owner_name))
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include "SocialMgr.h"
|
#include "SocialMgr.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "DatabaseEnv.h"
|
#include "DatabaseEnv.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||||
: m_announce(true), m_ownership(true), m_name(name), m_password(""), m_flags(0), m_channelId(channel_id), m_ownerGUID(0), m_Team(Team)
|
: m_announce(true), m_ownership(true), m_name(name), m_password(""), m_flags(0), m_channelId(channel_id), m_ownerGUID(0), m_Team(Team)
|
||||||
@@ -173,7 +174,7 @@ void Channel::Join(uint64 p, const char *pass)
|
|||||||
if (plr)
|
if (plr)
|
||||||
{
|
{
|
||||||
if (HasFlag(CHANNEL_FLAG_LFG) &&
|
if (HasFlag(CHANNEL_FLAG_LFG) &&
|
||||||
sWorld->getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup())
|
sWorld->getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && AccountMgr::IsPlayerAccount(plr->GetSession()->GetSecurity()) && plr->GetGroup())
|
||||||
{
|
{
|
||||||
MakeNotInLfg(&data);
|
MakeNotInLfg(&data);
|
||||||
SendToOne(&data, p);
|
SendToOne(&data, p);
|
||||||
@@ -183,7 +184,7 @@ void Channel::Join(uint64 p, const char *pass)
|
|||||||
plr->JoinedChannel(this);
|
plr->JoinedChannel(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
if (m_announce && (!plr || !AccountMgr::IsGMAccount(plr->GetSession()->GetSecurity()) || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||||
{
|
{
|
||||||
MakeJoined(&data, p);
|
MakeJoined(&data, p);
|
||||||
SendToAll(&data);
|
SendToAll(&data);
|
||||||
@@ -245,7 +246,7 @@ void Channel::Leave(uint64 p, bool send)
|
|||||||
bool changeowner = players[p].IsOwner();
|
bool changeowner = players[p].IsOwner();
|
||||||
|
|
||||||
players.erase(p);
|
players.erase(p);
|
||||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
if (m_announce && (!plr || !AccountMgr::IsGMAccount(plr->GetSession()->GetSecurity()) || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeLeft(&data, p);
|
MakeLeft(&data, p);
|
||||||
@@ -283,7 +284,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
|||||||
MakeNotMember(&data);
|
MakeNotMember(&data);
|
||||||
SendToOne(&data, good);
|
SendToOne(&data, good);
|
||||||
}
|
}
|
||||||
else if (!players[good].IsModerator() && sec < SEC_GAMEMASTER)
|
else if (!players[good].IsModerator() && !AccountMgr::IsGMAccount(sec))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotModerator(&data);
|
MakeNotModerator(&data);
|
||||||
@@ -298,7 +299,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
|||||||
MakePlayerNotFound(&data, badname);
|
MakePlayerNotFound(&data, badname);
|
||||||
SendToOne(&data, good);
|
SendToOne(&data, good);
|
||||||
}
|
}
|
||||||
else if (sec < SEC_GAMEMASTER && bad->GetGUID() == m_ownerGUID && good != m_ownerGUID)
|
else if (!AccountMgr::IsGMAccount(sec) && bad->GetGUID() == m_ownerGUID && good != m_ownerGUID)
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotOwner(&data);
|
MakeNotOwner(&data);
|
||||||
@@ -347,7 +348,7 @@ void Channel::UnBan(uint64 good, const char *badname)
|
|||||||
MakeNotMember(&data);
|
MakeNotMember(&data);
|
||||||
SendToOne(&data, good);
|
SendToOne(&data, good);
|
||||||
}
|
}
|
||||||
else if (!players[good].IsModerator() && sec < SEC_GAMEMASTER)
|
else if (!players[good].IsModerator() && !AccountMgr::IsGMAccount(sec))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotModerator(&data);
|
MakeNotModerator(&data);
|
||||||
@@ -390,7 +391,7 @@ void Channel::Password(uint64 p, const char *pass)
|
|||||||
MakeNotMember(&data);
|
MakeNotMember(&data);
|
||||||
SendToOne(&data, p);
|
SendToOne(&data, p);
|
||||||
}
|
}
|
||||||
else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
|
else if (!players[p].IsModerator() && !AccountMgr::IsGMAccount(sec))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotModerator(&data);
|
MakeNotModerator(&data);
|
||||||
@@ -422,7 +423,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
|||||||
MakeNotMember(&data);
|
MakeNotMember(&data);
|
||||||
SendToOne(&data, p);
|
SendToOne(&data, p);
|
||||||
}
|
}
|
||||||
else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
|
else if (!players[p].IsModerator() && !AccountMgr::IsGMAccount(sec))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotModerator(&data);
|
MakeNotModerator(&data);
|
||||||
@@ -452,7 +453,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
|||||||
|
|
||||||
// allow make moderator from another team only if both is GMs
|
// allow make moderator from another team only if both is GMs
|
||||||
// at this moment this only way to show channel post for GM from another team
|
// at this moment this only way to show channel post for GM from another team
|
||||||
if ((plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || newp->GetSession()->GetSecurity() < SEC_GAMEMASTER) &&
|
if ((!AccountMgr::IsGMAccount(plr->GetSession()->GetSecurity()) || !AccountMgr::IsGMAccount(newp->GetSession()->GetSecurity())) &&
|
||||||
plr->GetTeam() != newp->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
plr->GetTeam() != newp->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
@@ -492,7 +493,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sec < SEC_GAMEMASTER && p != m_ownerGUID)
|
if (!AccountMgr::IsGMAccount(sec) && p != m_ownerGUID)
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotOwner(&data);
|
MakeNotOwner(&data);
|
||||||
@@ -566,7 +567,7 @@ void Channel::List(Player* player)
|
|||||||
|
|
||||||
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||||
if (plr && (player->GetSession()->GetSecurity() > SEC_PLAYER || plr->GetSession()->GetSecurity() <= AccountTypes(gmLevelInWhoList)) &&
|
if (plr && (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) || plr->GetSession()->GetSecurity() <= AccountTypes(gmLevelInWhoList)) &&
|
||||||
plr->IsVisibleGloballyFor(player))
|
plr->IsVisibleGloballyFor(player))
|
||||||
{
|
{
|
||||||
data << uint64(i->first);
|
data << uint64(i->first);
|
||||||
@@ -594,7 +595,7 @@ void Channel::Announce(uint64 p)
|
|||||||
MakeNotMember(&data);
|
MakeNotMember(&data);
|
||||||
SendToOne(&data, p);
|
SendToOne(&data, p);
|
||||||
}
|
}
|
||||||
else if (!players[p].IsModerator() && sec < SEC_GAMEMASTER)
|
else if (!players[p].IsModerator() && !AccountMgr::IsGMAccount(sec))
|
||||||
{
|
{
|
||||||
WorldPacket data;
|
WorldPacket data;
|
||||||
MakeNotModerator(&data);
|
MakeNotModerator(&data);
|
||||||
|
|||||||
@@ -510,7 +510,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
|
// ignore only for non-players for non strong checks (when allow apply command at least to same sec level)
|
||||||
if (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
|
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
@@ -696,7 +696,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
|
|||||||
// table[i].Name == "" is special case: send original command to handler
|
// table[i].Name == "" is special case: send original command to handler
|
||||||
if ((table[i].Handler)(this, table[i].Name[0] != '\0' ? text : oldtext))
|
if ((table[i].Handler)(this, table[i].Name[0] != '\0' ? text : oldtext))
|
||||||
{
|
{
|
||||||
if (table[i].SecurityLevel > SEC_PLAYER)
|
if (!AccountMgr::IsPlayerAccount(table[i].SecurityLevel))
|
||||||
{
|
{
|
||||||
// chat case
|
// chat case
|
||||||
if (m_session)
|
if (m_session)
|
||||||
@@ -786,7 +786,7 @@ int ChatHandler::ParseCommands(const char* text)
|
|||||||
|
|
||||||
std::string fullcmd = text;
|
std::string fullcmd = text;
|
||||||
|
|
||||||
if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld->getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0)
|
if (m_session && AccountMgr::IsPlayerAccount(m_session->GetSecurity()) && !sWorld->getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/// chat case (.command or !command format)
|
/// chat case (.command or !command format)
|
||||||
@@ -811,7 +811,7 @@ int ChatHandler::ParseCommands(const char* text)
|
|||||||
|
|
||||||
if (!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
|
if (!ExecuteCommandInTable(getCommandTable(), text, fullcmd))
|
||||||
{
|
{
|
||||||
if (m_session && m_session->GetSecurity() == SEC_PLAYER)
|
if (m_session && AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
SendSysMessage(LANG_NO_CMD);
|
SendSysMessage(LANG_NO_CMD);
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
|||||||
Player* player = m_session->GetPlayer();
|
Player* player = m_session->GetPlayer();
|
||||||
|
|
||||||
// save GM account without delay and output message
|
// save GM account without delay and output message
|
||||||
if (m_session->GetSecurity() > SEC_PLAYER)
|
if (!AccountMgr::IsPlayerAccount(m_session->GetSecurity()))
|
||||||
{
|
{
|
||||||
if (Player *target = getSelectedPlayer())
|
if (Player *target = getSelectedPlayer())
|
||||||
target->SaveToDB();
|
target->SaveToDB();
|
||||||
|
|||||||
@@ -1933,7 +1933,7 @@ bool ChatHandler::HandleReviveCommand(const char *args)
|
|||||||
|
|
||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
target->ResurrectPlayer(target->GetSession()->GetSecurity() > SEC_PLAYER ? 1.0f : 0.5f);
|
target->ResurrectPlayer(!AccountMgr::IsPlayerAccount(target->GetSession()->GetSecurity()) ? 1.0f : 0.5f);
|
||||||
target->SpawnCorpseBones();
|
target->SpawnCorpseBones();
|
||||||
target->SaveToDB();
|
target->SaveToDB();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,7 +171,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
|||||||
uint64 targetAccId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
|
uint64 targetAccId = sObjectMgr->GetPlayerAccountIdByGUID(targetGuid);
|
||||||
uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccId, realmID);
|
uint32 targetGmLevel = AccountMgr::GetSecurity(targetAccId, realmID);
|
||||||
// Target must exist and have administrative rights
|
// Target must exist and have administrative rights
|
||||||
if (!targetGuid || targetGmLevel == SEC_PLAYER)
|
if (!targetGuid || AccountMgr::IsPlayerAccount(targetGmLevel))
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
|
SendSysMessage(LANG_COMMAND_TICKETASSIGNERROR_A);
|
||||||
return true;
|
return true;
|
||||||
@@ -191,7 +191,7 @@ bool ChatHandler::HandleGMTicketAssignToCommand(const char* args)
|
|||||||
}
|
}
|
||||||
// Assign ticket
|
// Assign ticket
|
||||||
SQLTransaction trans = SQLTransaction(NULL);
|
SQLTransaction trans = SQLTransaction(NULL);
|
||||||
ticket->SetAssignedTo(targetGuid, targetGmLevel == SEC_ADMINISTRATOR);
|
ticket->SetAssignedTo(targetGuid, AccountMgr::IsAdminAccount(targetGmLevel));
|
||||||
ticket->SaveToDB(trans);
|
ticket->SaveToDB(trans);
|
||||||
sTicketMgr->UpdateLastChange();
|
sTicketMgr->UpdateLastChange();
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@
|
|||||||
#include "CharacterDatabaseCleaner.h"
|
#include "CharacterDatabaseCleaner.h"
|
||||||
#include "InstanceScript.h"
|
#include "InstanceScript.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
|
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
|
||||||
|
|
||||||
@@ -654,7 +655,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|||||||
//m_pad = 0;
|
//m_pad = 0;
|
||||||
|
|
||||||
// players always accept
|
// players always accept
|
||||||
if (GetSession()->GetSecurity() == SEC_PLAYER)
|
if (AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
|
||||||
SetAcceptWhispers(true);
|
SetAcceptWhispers(true);
|
||||||
|
|
||||||
m_curSelection = 0;
|
m_curSelection = 0;
|
||||||
@@ -996,7 +997,7 @@ bool Player::Create(uint32 guidlow, CharacterCreateInfo* createInfo)
|
|||||||
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||||
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||||
|
|
||||||
if (GetSession()->GetSecurity() >= SEC_MODERATOR)
|
if (!AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
|
||||||
{
|
{
|
||||||
uint32 gm_level = sWorld->getIntConfig(CONFIG_START_GM_LEVEL);
|
uint32 gm_level = sWorld->getIntConfig(CONFIG_START_GM_LEVEL);
|
||||||
if (gm_level > start_level)
|
if (gm_level > start_level)
|
||||||
@@ -2085,7 +2086,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((GetSession()->GetSecurity() < SEC_GAMEMASTER) && sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
|
if (AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()) && sDisableMgr->IsDisabledFor(DISABLE_TYPE_MAP, mapid, this))
|
||||||
{
|
{
|
||||||
sLog->outError("Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
|
sLog->outError("Player (GUID: %u, name: %s) tried to enter a forbidden map %u", GetGUIDLow(), GetName(), mapid);
|
||||||
SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED);
|
SendTransferAborted(mapid, TRANSFER_ABORT_MAP_NOT_ALLOWED);
|
||||||
@@ -3116,7 +3117,7 @@ void Player::InitTalentForLevel()
|
|||||||
// if used more that have then reset
|
// if used more that have then reset
|
||||||
if (m_usedTalentCount > talentPointsForLevel)
|
if (m_usedTalentCount > talentPointsForLevel)
|
||||||
{
|
{
|
||||||
if (GetSession()->GetSecurity() < SEC_ADMINISTRATOR)
|
if (!AccountMgr::IsAdminAccount(GetSession()->GetSecurity()))
|
||||||
resetTalents(true);
|
resetTalents(true);
|
||||||
else
|
else
|
||||||
SetFreeTalentPoints(0);
|
SetFreeTalentPoints(0);
|
||||||
@@ -16510,7 +16511,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
|
if (ObjectMgr::CheckPlayerName(m_name) != CHAR_NAME_SUCCESS ||
|
||||||
(GetSession()->GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(m_name)))
|
(AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()) && sObjectMgr->IsReservedName(m_name)))
|
||||||
{
|
{
|
||||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME), guid);
|
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE guid ='%u'", uint32(AT_LOGIN_RENAME), guid);
|
||||||
return false;
|
return false;
|
||||||
@@ -17038,7 +17039,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|||||||
outDebugValues();
|
outDebugValues();
|
||||||
|
|
||||||
// GM state
|
// GM state
|
||||||
if (GetSession()->GetSecurity() > SEC_PLAYER)
|
if (!AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
|
||||||
{
|
{
|
||||||
switch (sWorld->getIntConfig(CONFIG_GM_LOGIN_STATE))
|
switch (sWorld->getIntConfig(CONFIG_GM_LOGIN_STATE))
|
||||||
{
|
{
|
||||||
@@ -18940,7 +18941,7 @@ void Player::outDebugValues() const
|
|||||||
void Player::UpdateSpeakTime()
|
void Player::UpdateSpeakTime()
|
||||||
{
|
{
|
||||||
// ignore chat spam protection for GMs in any mode
|
// ignore chat spam protection for GMs in any mode
|
||||||
if (GetSession()->GetSecurity() > SEC_PLAYER)
|
if (!AccountMgr::IsPlayerAccount(GetSession()->GetSecurity()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
time_t current = time (NULL);
|
time_t current = time (NULL);
|
||||||
@@ -21118,7 +21119,7 @@ bool Player::IsVisibleGloballyFor(Player* u) const
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
// GMs are visible for higher gms (or players are visible for gms)
|
// GMs are visible for higher gms (or players are visible for gms)
|
||||||
if (u->GetSession()->GetSecurity() > SEC_PLAYER)
|
if (!AccountMgr::IsPlayerAccount(u->GetSession()->GetSecurity()))
|
||||||
return GetSession()->GetSecurity() <= u->GetSession()->GetSecurity();
|
return GetSession()->GetSecurity() <= u->GetSession()->GetSecurity();
|
||||||
|
|
||||||
// non faction visibility non-breakable for non-GMs
|
// non faction visibility non-breakable for non-GMs
|
||||||
|
|||||||
@@ -1138,7 +1138,7 @@ class Player : public Unit, public GridObject<Player>
|
|||||||
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||||
bool isGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; }
|
bool isGameMaster() const { return m_ExtraFlags & PLAYER_EXTRA_GM_ON; }
|
||||||
void SetGameMaster(bool on);
|
void SetGameMaster(bool on);
|
||||||
bool isGMChat() const { return GetSession()->GetSecurity() >= SEC_MODERATOR && (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT); }
|
bool isGMChat() const { return m_ExtraFlags & PLAYER_EXTRA_GM_CHAT; }
|
||||||
void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
|
void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
|
||||||
bool isTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; }
|
bool isTaxiCheater() const { return m_ExtraFlags & PLAYER_EXTRA_TAXICHEAT; }
|
||||||
void SetTaxiCheater(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; }
|
void SetTaxiCheater(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_TAXICHEAT; else m_ExtraFlags &= ~PLAYER_EXTRA_TAXICHEAT; }
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
PlayerSocial::PlayerSocial()
|
PlayerSocial::PlayerSocial()
|
||||||
{
|
{
|
||||||
@@ -197,7 +198,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
|
|||||||
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||||
if (pFriend && pFriend->GetName() &&
|
if (pFriend && pFriend->GetName() &&
|
||||||
(security > SEC_PLAYER ||
|
(!AccountMgr::IsPlayerAccount(security) ||
|
||||||
((pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList))) &&
|
((pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList))) &&
|
||||||
pFriend->IsVisibleGloballyFor(player))
|
pFriend->IsVisibleGloballyFor(player))
|
||||||
{
|
{
|
||||||
@@ -276,7 +277,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
|
|||||||
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||||
if (pFriend && pFriend->IsInWorld() &&
|
if (pFriend && pFriend->IsInWorld() &&
|
||||||
(pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
|
(!AccountMgr::IsPlayerAccount(pFriend->GetSession()->GetSecurity()) ||
|
||||||
((pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList)) &&
|
((pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList)) &&
|
||||||
player->IsVisibleGloballyFor(pFriend))
|
player->IsVisibleGloballyFor(pFriend))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
#include "Config.h"
|
#include "Config.h"
|
||||||
#include "SocialMgr.h"
|
#include "SocialMgr.h"
|
||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
|
#define MAX_GUILD_BANK_TAB_TEXT_LEN 500
|
||||||
#define EMBLEM_PRICE 10 * GOLD
|
#define EMBLEM_PRICE 10 * GOLD
|
||||||
@@ -937,7 +938,7 @@ void Guild::BankMoveItemData::LogBankEvent(SQLTransaction& trans, MoveItemData*
|
|||||||
void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const
|
void Guild::BankMoveItemData::LogAction(MoveItemData* pFrom) const
|
||||||
{
|
{
|
||||||
MoveItemData::LogAction(pFrom);
|
MoveItemData::LogAction(pFrom);
|
||||||
if (!pFrom->IsBank() && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE) && m_pPlayer->GetSession()->GetSecurity() > SEC_PLAYER) // TODO: move to scripts
|
if (!pFrom->IsBank() && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE) && !AccountMgr::IsPlayerAccount(m_pPlayer->GetSession()->GetSecurity())) // TODO: move to scripts
|
||||||
sLog->outCommand(m_pPlayer->GetSession()->GetAccountId(),
|
sLog->outCommand(m_pPlayer->GetSession()->GetAccountId(),
|
||||||
"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)",
|
"GM %s (Account: %u) deposit item: %s (Entry: %d Count: %u) to guild bank (Guild ID: %u)",
|
||||||
m_pPlayer->GetName(), m_pPlayer->GetSession()->GetAccountId(),
|
m_pPlayer->GetName(), m_pPlayer->GetSession()->GetAccountId(),
|
||||||
@@ -1630,7 +1631,7 @@ void Guild::HandleMemberDepositMoney(WorldSession* session, uint32 amount)
|
|||||||
player->ModifyMoney(-int32(amount));
|
player->ModifyMoney(-int32(amount));
|
||||||
player->SaveGoldToDB(trans);
|
player->SaveGoldToDB(trans);
|
||||||
// Log GM action (TODO: move to scripts)
|
// Log GM action (TODO: move to scripts)
|
||||||
if (player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (!AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(player->GetSession()->GetAccountId(),
|
sLog->outCommand(player->GetSession()->GetAccountId(),
|
||||||
"GM %s (Account: %u) deposit money (Amount: %u) to pGuild bank (Guild ID %u)",
|
"GM %s (Account: %u) deposit money (Amount: %u) to pGuild bank (Guild ID %u)",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "Opcodes.h"
|
#include "Opcodes.h"
|
||||||
#include "UpdateMask.h"
|
#include "UpdateMask.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
//please DO NOT use iterator++, because it is slower than ++iterator!!!
|
//please DO NOT use iterator++, because it is slower than ++iterator!!!
|
||||||
//post-incrementation is always slower than pre-incrementation !
|
//post-incrementation is always slower than pre-incrementation !
|
||||||
@@ -204,7 +205,7 @@ void WorldSession::HandleAuctionSellItem(WorldPacket & recv_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (AccountMgr::IsGMAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) create auction: %s (Entry: %u Count: %u)",
|
||||||
GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), count);
|
GetPlayerName(), GetAccountId(), it->GetTemplate()->Name1.c_str(), it->GetEntry(), count);
|
||||||
|
|||||||
@@ -42,6 +42,7 @@
|
|||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "Battleground.h"
|
#include "Battleground.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
class LoginQueryHolder : public SQLQueryHolder
|
class LoginQueryHolder : public SQLQueryHolder
|
||||||
{
|
{
|
||||||
@@ -279,7 +280,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
|||||||
|
|
||||||
WorldPacket data(SMSG_CHAR_CREATE, 1); // returned with diff.values in all cases
|
WorldPacket data(SMSG_CHAR_CREATE, 1); // returned with diff.values in all cases
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER)
|
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
if (uint32 mask = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED))
|
if (uint32 mask = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED))
|
||||||
{
|
{
|
||||||
@@ -337,7 +338,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER)
|
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||||
if ((1 << (race_ - 1)) & raceMaskDisabled)
|
if ((1 << (race_ - 1)) & raceMaskDisabled)
|
||||||
@@ -374,7 +375,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(name))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && sObjectMgr->IsReservedName(name))
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_NAME_RESERVED;
|
data << (uint8)CHAR_NAME_RESERVED;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
@@ -383,7 +384,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
|||||||
|
|
||||||
// speedup check for heroic class disabled case
|
// speedup check for heroic class disabled case
|
||||||
uint32 heroic_free_slots = sWorld->getIntConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
|
uint32 heroic_free_slots = sWorld->getIntConfig(CONFIG_HEROIC_CHARACTERS_PER_REALM);
|
||||||
if (heroic_free_slots == 0 && GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT)
|
if (heroic_free_slots == 0 && AccountMgr::IsPlayerAccount(GetSecurity()) && class_ == CLASS_DEATH_KNIGHT)
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
data << (uint8)CHAR_CREATE_UNIQUE_CLASS_LIMIT;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
@@ -392,7 +393,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket & recv_data)
|
|||||||
|
|
||||||
// speedup check for heroic class disabled case
|
// speedup check for heroic class disabled case
|
||||||
uint32 req_level_for_heroic = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
|
uint32 req_level_for_heroic = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
|
||||||
if (GetSecurity() == SEC_PLAYER && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && class_ == CLASS_DEATH_KNIGHT && req_level_for_heroic > sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||||
{
|
{
|
||||||
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
|
data << (uint8)CHAR_CREATE_LEVEL_REQUIREMENT;
|
||||||
SendPacket(&data);
|
SendPacket(&data);
|
||||||
@@ -492,7 +493,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || !AccountMgr::IsPlayerAccount(GetSecurity());
|
||||||
uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS);
|
uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS);
|
||||||
|
|
||||||
_charCreateCallback.FreeResult();
|
_charCreateCallback.FreeResult();
|
||||||
@@ -516,7 +517,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
|
|||||||
bool haveSameRace = false;
|
bool haveSameRace = false;
|
||||||
uint32 heroicReqLevel = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
|
uint32 heroicReqLevel = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER);
|
||||||
bool hasHeroicReqLevel = (heroicReqLevel == 0);
|
bool hasHeroicReqLevel = (heroicReqLevel == 0);
|
||||||
bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || GetSecurity() > SEC_PLAYER;
|
bool allowTwoSideAccounts = !sWorld->IsPvPRealm() || sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ACCOUNTS) || !AccountMgr::IsPlayerAccount(GetSecurity());
|
||||||
uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS);
|
uint32 skipCinematics = sWorld->getIntConfig(CONFIG_SKIP_CINEMATICS);
|
||||||
|
|
||||||
if (result)
|
if (result)
|
||||||
@@ -527,7 +528,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
|
|||||||
Field* field = result->Fetch();
|
Field* field = result->Fetch();
|
||||||
uint8 accRace = field[1].GetUInt8();
|
uint8 accRace = field[1].GetUInt8();
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER && createInfo->Class == CLASS_DEATH_KNIGHT)
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && createInfo->Class == CLASS_DEATH_KNIGHT)
|
||||||
{
|
{
|
||||||
uint8 accClass = field[2].GetUInt8();
|
uint8 accClass = field[2].GetUInt8();
|
||||||
if (accClass == CLASS_DEATH_KNIGHT)
|
if (accClass == CLASS_DEATH_KNIGHT)
|
||||||
@@ -588,7 +589,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
|
|||||||
if (!haveSameRace)
|
if (!haveSameRace)
|
||||||
haveSameRace = createInfo->Race == accRace;
|
haveSameRace = createInfo->Race == accRace;
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER && createInfo->Class == CLASS_DEATH_KNIGHT)
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && createInfo->Class == CLASS_DEATH_KNIGHT)
|
||||||
{
|
{
|
||||||
uint8 acc_class = field[2].GetUInt8();
|
uint8 acc_class = field[2].GetUInt8();
|
||||||
if (acc_class == CLASS_DEATH_KNIGHT)
|
if (acc_class == CLASS_DEATH_KNIGHT)
|
||||||
@@ -618,7 +619,7 @@ void WorldSession::HandleCharCreateCallback(PreparedQueryResult result, Characte
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER && createInfo->Class == CLASS_DEATH_KNIGHT && !hasHeroicReqLevel)
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && createInfo->Class == CLASS_DEATH_KNIGHT && !hasHeroicReqLevel)
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_CREATE, 1);
|
WorldPacket data(SMSG_CHAR_CREATE, 1);
|
||||||
data << uint8(CHAR_CREATE_LEVEL_REQUIREMENT);
|
data << uint8(CHAR_CREATE_LEVEL_REQUIREMENT);
|
||||||
@@ -1121,7 +1122,7 @@ void WorldSession::HandleCharRenameOpcode(WorldPacket& recv_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(newname))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && sObjectMgr->IsReservedName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
WorldPacket data(SMSG_CHAR_RENAME, 1);
|
||||||
data << uint8(CHAR_NAME_RESERVED);
|
data << uint8(CHAR_NAME_RESERVED);
|
||||||
@@ -1383,7 +1384,7 @@ void WorldSession::HandleCharCustomize(WorldPacket& recv_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(newname))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && sObjectMgr->IsReservedName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
WorldPacket data(SMSG_CHAR_CUSTOMIZE, 1);
|
||||||
data << uint8(CHAR_NAME_RESERVED);
|
data << uint8(CHAR_NAME_RESERVED);
|
||||||
@@ -1574,7 +1575,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GetSecurity() == SEC_PLAYER)
|
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||||
if ((1 << (race - 1)) & raceMaskDisabled)
|
if ((1 << (race - 1)) & raceMaskDisabled)
|
||||||
@@ -1605,7 +1606,7 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recv_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check name limitations
|
// check name limitations
|
||||||
if (GetSecurity() == SEC_PLAYER && sObjectMgr->IsReservedName(newname))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()) && sObjectMgr->IsReservedName(newname))
|
||||||
{
|
{
|
||||||
WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1);
|
WorldPacket data(SMSG_CHAR_FACTION_CHANGE, 1);
|
||||||
data << uint8(CHAR_NAME_RESERVED);
|
data << uint8(CHAR_NAME_RESERVED);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@
|
|||||||
#include "SpellAuraEffects.h"
|
#include "SpellAuraEffects.h"
|
||||||
#include "Util.h"
|
#include "Util.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg, uint32 lang)
|
bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg, uint32 lang)
|
||||||
{
|
{
|
||||||
@@ -48,7 +49,7 @@ bool WorldSession::processChatmessageFurtherAfterSecurityChecks(std::string& msg
|
|||||||
if (sWorld->getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
|
if (sWorld->getBoolConfig(CONFIG_CHAT_FAKE_MESSAGE_PREVENTING))
|
||||||
stripLineInvisibleChars(msg);
|
stripLineInvisibleChars(msg);
|
||||||
|
|
||||||
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && GetSecurity() < SEC_MODERATOR
|
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) && AccountMgr::IsPlayerAccount(GetSecurity())
|
||||||
&& !ChatHandler(this).isValidChatMessage(msg.c_str()))
|
&& !ChatHandler(this).isValidChatMessage(msg.c_str()))
|
||||||
{
|
{
|
||||||
sLog->outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
|
sLog->outError("Player %s (GUID: %u) sent a chatmessage with an invalid link: %s", GetPlayer()->GetName(),
|
||||||
@@ -269,24 +270,20 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Player* receiver = sObjectAccessor->FindPlayerByName(to.c_str());
|
Player* receiver = sObjectAccessor->FindPlayerByName(to.c_str());
|
||||||
uint32 senderSecurity = GetSecurity();
|
bool senderIsPlayer = AccountMgr::IsPlayerAccount(GetSecurity());
|
||||||
uint32 receiverSecurity = receiver ? receiver->GetSession()->GetSecurity() : SEC_PLAYER;
|
bool receiverIsPlayer = AccountMgr::IsPlayerAccount(receiver ? receiver->GetSession()->GetSecurity() : SEC_PLAYER);
|
||||||
if (!receiver || (senderSecurity == SEC_PLAYER && receiverSecurity > SEC_PLAYER && !receiver->isAcceptWhispers() && !receiver->IsInWhisperWhiteList(sender->GetGUID())))
|
if (!receiver || (senderIsPlayer && !receiverIsPlayer && !receiver->isAcceptWhispers() && !receiver->IsInWhisperWhiteList(sender->GetGUID())))
|
||||||
{
|
{
|
||||||
SendPlayerNotFoundNotice(to);
|
SendPlayerNotFoundNotice(to);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && senderSecurity == SEC_PLAYER && receiverSecurity == SEC_PLAYER)
|
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT) && senderIsPlayer && receiverIsPlayer)
|
||||||
{
|
if (GetPlayer()->GetTeam() != receiver->GetTeam())
|
||||||
uint32 senderFaction = GetPlayer()->GetTeam();
|
|
||||||
uint32 receiverFaction = receiver->GetTeam();
|
|
||||||
if (senderFaction != receiverFaction)
|
|
||||||
{
|
{
|
||||||
SendWrongFactionNotice();
|
SendWrongFactionNotice();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (GetPlayer()->HasAura(1852) && !receiver->isGameMaster())
|
if (GetPlayer()->HasAura(1852) && !receiver->isGameMaster())
|
||||||
{
|
{
|
||||||
@@ -295,7 +292,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
|
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
|
||||||
if (senderSecurity > SEC_PLAYER && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))
|
if (!senderIsPlayer && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID()))
|
||||||
sender->AddWhisperWhiteList(receiver->GetGUID());
|
sender->AddWhisperWhiteList(receiver->GetGUID());
|
||||||
|
|
||||||
GetPlayer()->Whisper(msg, lang, receiver->GetGUID());
|
GetPlayer()->Whisper(msg, lang, receiver->GetGUID());
|
||||||
@@ -420,10 +417,13 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket & recv_data)
|
|||||||
} break;
|
} break;
|
||||||
case CHAT_MSG_CHANNEL:
|
case CHAT_MSG_CHANNEL:
|
||||||
{
|
{
|
||||||
if (_player->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
if (_player->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||||
return;
|
{
|
||||||
|
SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
if (ChannelMgr* cMgr = channelMgr(_player->GetTeam()))
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
#include "DBCStores.h"
|
#include "DBCStores.h"
|
||||||
#include "Item.h"
|
#include "Item.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
||||||
{
|
{
|
||||||
@@ -160,7 +161,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!accountBound && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && GetSecurity() == SEC_PLAYER)
|
if (!accountBound && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL) && pl->GetTeam() != rc_team && AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM);
|
pl->SendMailResult(0, MAIL_SEND, MAIL_ERR_NOT_YOUR_TEAM);
|
||||||
return;
|
return;
|
||||||
@@ -246,7 +247,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
|||||||
for (uint8 i = 0; i < items_count; ++i)
|
for (uint8 i = 0; i < items_count; ++i)
|
||||||
{
|
{
|
||||||
Item* item = items[i];
|
Item* item = items[i];
|
||||||
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (!AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)",
|
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail item: %s (Entry: %u Count: %u) to player: %s (Account: %u)",
|
||||||
GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
|
GetPlayerName(), GetAccountId(), item->GetTemplate()->Name1.c_str(), item->GetEntry(), item->GetCount(), receiver.c_str(), rc_account);
|
||||||
@@ -266,7 +267,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data)
|
|||||||
needItemDelay = pl->GetSession()->GetAccountId() != rc_account;
|
needItemDelay = pl->GetSession()->GetAccountId() != rc_account;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (money > 0 && GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (money > 0 && !AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
|
sLog->outCommand(GetAccountId(), "GM %s (Account: %u) mail money: %u to player: %s (Account: %u)",
|
||||||
GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
|
GetPlayerName(), GetAccountId(), money, receiver.c_str(), rc_account);
|
||||||
@@ -440,7 +441,7 @@ void WorldSession::HandleMailTakeItem(WorldPacket & recv_data)
|
|||||||
|
|
||||||
uint32 sender_accId = 0;
|
uint32 sender_accId = 0;
|
||||||
|
|
||||||
if (GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (!AccountMgr::IsPlayerAccount(GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
std::string sender_name;
|
std::string sender_name;
|
||||||
if (receive)
|
if (receive)
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
#include "InstanceScript.h"
|
#include "InstanceScript.h"
|
||||||
#include "GameObjectAI.h"
|
#include "GameObjectAI.h"
|
||||||
#include "Group.h"
|
#include "Group.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
||||||
{
|
{
|
||||||
@@ -242,7 +243,7 @@ void WorldSession::HandleWhoOpcode(WorldPacket & recv_data)
|
|||||||
HashMapHolder<Player>::MapType& m = sObjectAccessor->GetPlayers();
|
HashMapHolder<Player>::MapType& m = sObjectAccessor->GetPlayers();
|
||||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (security == SEC_PLAYER)
|
if (AccountMgr::IsPlayerAccount(security))
|
||||||
{
|
{
|
||||||
// player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST
|
// player can see member of other team only if CONFIG_ALLOW_TWO_SIDE_WHO_LIST
|
||||||
if (itr->second->GetTeam() != team && !allowTwoSideWhoList)
|
if (itr->second->GetTeam() != team && !allowTwoSideWhoList)
|
||||||
@@ -560,13 +561,13 @@ void WorldSession::HandleAddFriendOpcodeCallBack(QueryResult result, std::string
|
|||||||
team = Player::TeamForRace((*result)[1].GetUInt8());
|
team = Player::TeamForRace((*result)[1].GetUInt8());
|
||||||
friendAcctid = (*result)[2].GetUInt32();
|
friendAcctid = (*result)[2].GetUInt32();
|
||||||
|
|
||||||
if (GetSecurity() >= SEC_MODERATOR || sWorld->getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || AccountMgr::GetSecurity(friendAcctid, realmID) < SEC_MODERATOR)
|
if (!AccountMgr::IsPlayerAccount(GetSecurity()) || sWorld->getBoolConfig(CONFIG_ALLOW_GM_FRIEND) || AccountMgr::IsPlayerAccount(AccountMgr::GetSecurity(friendAcctid, realmID)))
|
||||||
{
|
{
|
||||||
if (friendGuid)
|
if (friendGuid)
|
||||||
{
|
{
|
||||||
if (friendGuid == GetPlayer()->GetGUID())
|
if (friendGuid == GetPlayer()->GetGUID())
|
||||||
friendResult = FRIEND_SELF;
|
friendResult = FRIEND_SELF;
|
||||||
else if (GetPlayer()->GetTeam() != team && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && GetSecurity() < SEC_MODERATOR)
|
else if (GetPlayer()->GetTeam() != team && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND) && AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
friendResult = FRIEND_ENEMY;
|
friendResult = FRIEND_ENEMY;
|
||||||
else if (GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid)))
|
else if (GetPlayer()->GetSocial()->HasFriend(GUID_LOPART(friendGuid)))
|
||||||
friendResult = FRIEND_ALREADY;
|
friendResult = FRIEND_ALREADY;
|
||||||
@@ -1274,7 +1275,7 @@ void WorldSession::HandleWorldTeleportOpcode(WorldPacket& recv_data)
|
|||||||
|
|
||||||
sLog->outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation);
|
sLog->outStaticDebug("Time %u sec, map=%u, x=%f, y=%f, z=%f, orient=%f", time/1000, mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||||
|
|
||||||
if (GetSecurity() >= SEC_ADMINISTRATOR)
|
if (AccountMgr::IsAdminAccount(GetSecurity()))
|
||||||
GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation);
|
GetPlayer()->TeleportTo(mapid, PositionX, PositionY, PositionZ, Orientation);
|
||||||
else
|
else
|
||||||
SendNotification(LANG_YOU_NOT_HAVE_PERMISSION);
|
SendNotification(LANG_YOU_NOT_HAVE_PERMISSION);
|
||||||
@@ -1287,7 +1288,7 @@ void WorldSession::HandleWhoisOpcode(WorldPacket& recv_data)
|
|||||||
std::string charname;
|
std::string charname;
|
||||||
recv_data >> charname;
|
recv_data >> charname;
|
||||||
|
|
||||||
if (GetSecurity() < SEC_ADMINISTRATOR)
|
if (!AccountMgr::IsAdminAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
SendNotification(LANG_YOU_NOT_HAVE_PERMISSION);
|
SendNotification(LANG_YOU_NOT_HAVE_PERMISSION);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include "Spell.h"
|
#include "Spell.h"
|
||||||
#include "SocialMgr.h"
|
#include "SocialMgr.h"
|
||||||
#include "Language.h"
|
#include "Language.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
void WorldSession::SendTradeStatus(TradeStatus status)
|
void WorldSession::SendTradeStatus(TradeStatus status)
|
||||||
{
|
{
|
||||||
@@ -151,7 +152,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
|||||||
{
|
{
|
||||||
// logging
|
// logging
|
||||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow());
|
sLog->outDebug(LOG_FILTER_NETWORKIO, "partner storing: %u", myItems[i]->GetGUIDLow());
|
||||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (!AccountMgr::IsPlayerAccount(_player->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
|
sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
|
||||||
_player->GetName(), _player->GetSession()->GetAccountId(),
|
_player->GetName(), _player->GetSession()->GetAccountId(),
|
||||||
@@ -169,7 +170,7 @@ void WorldSession::moveItems(Item* myItems[], Item* hisItems[])
|
|||||||
{
|
{
|
||||||
// logging
|
// logging
|
||||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow());
|
sLog->outDebug(LOG_FILTER_NETWORKIO, "player storing: %u", hisItems[i]->GetGUIDLow());
|
||||||
if (trader->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (!AccountMgr::IsPlayerAccount(trader->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
|
sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) trade: %s (Entry: %d Count: %u) to player: %s (Account: %u)",
|
||||||
trader->GetName(), trader->GetSession()->GetAccountId(),
|
trader->GetName(), trader->GetSession()->GetAccountId(),
|
||||||
@@ -459,14 +460,14 @@ void WorldSession::HandleAcceptTradeOpcode(WorldPacket& /*recvPacket*/)
|
|||||||
// logging money
|
// logging money
|
||||||
if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
if (_player->GetSession()->GetSecurity() > SEC_PLAYER && my_trade->GetMoney() > 0)
|
if (!AccountMgr::IsPlayerAccount(_player->GetSession()->GetSecurity()) && my_trade->GetMoney() > 0)
|
||||||
{
|
{
|
||||||
sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)",
|
sLog->outCommand(_player->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)",
|
||||||
_player->GetName(), _player->GetSession()->GetAccountId(),
|
_player->GetName(), _player->GetSession()->GetAccountId(),
|
||||||
my_trade->GetMoney(),
|
my_trade->GetMoney(),
|
||||||
trader->GetName(), trader->GetSession()->GetAccountId());
|
trader->GetName(), trader->GetSession()->GetAccountId());
|
||||||
}
|
}
|
||||||
if (trader->GetSession()->GetSecurity() > SEC_PLAYER && his_trade->GetMoney() > 0)
|
if (!AccountMgr::IsPlayerAccount(trader->GetSession()->GetSecurity()) && his_trade->GetMoney() > 0)
|
||||||
{
|
{
|
||||||
sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)",
|
sLog->outCommand(trader->GetSession()->GetAccountId(), "GM %s (Account: %u) give money (Amount: %u) to player: %s (Account: %u)",
|
||||||
trader->GetName(), trader->GetSession()->GetAccountId(),
|
trader->GetName(), trader->GetSession()->GetAccountId(),
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
#include "Log.h"
|
#include "Log.h"
|
||||||
#include "WorldLog.h"
|
#include "WorldLog.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__)
|
||||||
#pragma pack(1)
|
#pragma pack(1)
|
||||||
@@ -935,7 +936,7 @@ int WorldSocket::HandleAuthSession (WorldPacket& recvPacket)
|
|||||||
// Check locked state for server
|
// Check locked state for server
|
||||||
AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
|
AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
|
||||||
sLog->outDebug(LOG_FILTER_NETWORKIO, "Allowed Level: %u Player Level %u", allowedAccountType, AccountTypes(security));
|
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);
|
WorldPacket Packet (SMSG_AUTH_RESPONSE, 1);
|
||||||
Packet << uint8 (AUTH_UNAVAILABLE);
|
Packet << uint8 (AUTH_UNAVAILABLE);
|
||||||
@@ -1039,7 +1040,7 @@ int WorldSocket::HandlePing (WorldPacket& recvPacket)
|
|||||||
{
|
{
|
||||||
ACE_GUARD_RETURN (LockType, Guard, m_SessionLock, -1);
|
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();
|
Player* _player = m_Session->GetPlayer();
|
||||||
sLog->outError("WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",
|
sLog->outError("WorldSocket::HandlePing: Player (account: %u, GUID: %u, name: %s) kicked for over-speed pings (address: %s)",
|
||||||
|
|||||||
@@ -61,6 +61,7 @@
|
|||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "GameObjectAI.h"
|
#include "GameObjectAI.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
pEffect SpellEffects[TOTAL_SPELL_EFFECTS]=
|
||||||
{
|
{
|
||||||
@@ -3441,7 +3442,7 @@ void Spell::EffectEnchantItemPerm(SpellEffIndex effIndex)
|
|||||||
if (!item_owner)
|
if (!item_owner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (item_owner != p_caster && !AccountMgr::IsPlayerAccount(p_caster->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||||
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
||||||
@@ -3502,7 +3503,7 @@ void Spell::EffectEnchantItemPrismatic(SpellEffIndex effIndex)
|
|||||||
if (!item_owner)
|
if (!item_owner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (item_owner != p_caster && !AccountMgr::IsPlayerAccount(p_caster->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(perm): %s (Entry: %d) for player: %s (Account: %u)",
|
||||||
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
||||||
@@ -3632,7 +3633,7 @@ void Spell::EffectEnchantItemTmp(SpellEffIndex effIndex)
|
|||||||
if (!item_owner)
|
if (!item_owner)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (item_owner != p_caster && p_caster->GetSession()->GetSecurity() > SEC_PLAYER && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
if (item_owner != p_caster && !AccountMgr::IsPlayerAccount(p_caster->GetSession()->GetSecurity()) && sWorld->getBoolConfig(CONFIG_GM_LOG_TRADE))
|
||||||
{
|
{
|
||||||
sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)",
|
sLog->outCommand(p_caster->GetSession()->GetAccountId(), "GM %s (Account: %u) enchanting(temp): %s (Entry: %d) for player: %s (Account: %u)",
|
||||||
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
p_caster->GetName(), p_caster->GetSession()->GetAccountId(),
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ World::AddSession_(WorldSession* s)
|
|||||||
if (decrease_session)
|
if (decrease_session)
|
||||||
--Sessions;
|
--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);
|
AddQueuedPlayer (s);
|
||||||
UpdateMaxSessionCounters();
|
UpdateMaxSessionCounters();
|
||||||
@@ -2037,7 +2037,7 @@ void World::SendGlobalGMMessage(WorldPacket* packet, WorldSession* self, uint32
|
|||||||
itr->second->GetPlayer() &&
|
itr->second->GetPlayer() &&
|
||||||
itr->second->GetPlayer()->IsInWorld() &&
|
itr->second->GetPlayer()->IsInWorld() &&
|
||||||
itr->second != self &&
|
itr->second != self &&
|
||||||
itr->second->GetSecurity() > SEC_PLAYER &&
|
!AccountMgr::IsPlayerAccount(itr->second->GetSecurity()) &&
|
||||||
(team == 0 || itr->second->GetPlayer()->GetTeam() == team))
|
(team == 0 || itr->second->GetPlayer()->GetTeam() == team))
|
||||||
{
|
{
|
||||||
itr->second->SendPacket(packet);
|
itr->second->SendPacket(packet);
|
||||||
@@ -2134,7 +2134,7 @@ void World::SendGMText(int32 string_id, ...)
|
|||||||
if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
|
if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (itr->second->GetSecurity() < SEC_MODERATOR)
|
if (AccountMgr::IsPlayerAccount(itr->second->GetSecurity()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wt_do(itr->second->GetPlayer());
|
wt_do(itr->second->GetPlayer());
|
||||||
|
|||||||
@@ -448,7 +448,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
|
// Check and abort if the target gm has a higher rank on one of the realms and the new realm is -1
|
||||||
if (gmRealmID == -1 && plSecurity != SEC_CONSOLE)
|
if (gmRealmID == -1 && !AccountMgr::IsConsoleAccount(plSecurity))
|
||||||
{
|
{
|
||||||
QueryResult result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm);
|
QueryResult result = LoginDatabase.PQuery("SELECT * FROM account_access WHERE id = '%u' AND gmlevel > '%d'", targetAccountId, gm);
|
||||||
if (result)
|
if (result)
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ EndScriptData */
|
|||||||
#include "ScriptMgr.h"
|
#include "ScriptMgr.h"
|
||||||
#include "ObjectMgr.h"
|
#include "ObjectMgr.h"
|
||||||
#include "Chat.h"
|
#include "Chat.h"
|
||||||
|
#include "AccountMgr.h"
|
||||||
|
|
||||||
class gm_commandscript : public CommandScript
|
class gm_commandscript : public CommandScript
|
||||||
{
|
{
|
||||||
@@ -56,10 +57,11 @@ public:
|
|||||||
{
|
{
|
||||||
if (!*args)
|
if (!*args)
|
||||||
{
|
{
|
||||||
if (handler->GetSession()->GetPlayer()->isGMChat())
|
WorldSession* session = handler->GetSession();
|
||||||
handler->GetSession()->SendNotification(LANG_GM_CHAT_ON);
|
if (!AccountMgr::IsPlayerAccount(session->GetSecurity()) && session->GetPlayer()->isGMChat())
|
||||||
|
session->SendNotification(LANG_GM_CHAT_ON);
|
||||||
else
|
else
|
||||||
handler->GetSession()->SendNotification(LANG_GM_CHAT_OFF);
|
session->SendNotification(LANG_GM_CHAT_OFF);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -120,7 +122,7 @@ public:
|
|||||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||||
{
|
{
|
||||||
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
||||||
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
if ((itr->second->isGameMaster() || !AccountMgr::IsPlayerAccount((itr_sec) && itr_sec <= AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_GM_LIST)))) &&
|
||||||
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
(!handler->GetSession() || itr->second->IsVisibleGloballyFor(handler->GetSession()->GetPlayer())))
|
||||||
{
|
{
|
||||||
if (first)
|
if (first)
|
||||||
|
|||||||
Reference in New Issue
Block a user