Core: Removed more operator workarounds for ACE_Singleton (missed previously because of inconsistent naming)
--HG-- branch : trunk
This commit is contained in:
@@ -52,7 +52,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
m_flags |= CHANNEL_FLAG_CUSTOM;
|
||||
|
||||
// If storing custom channels in the db is enabled either load or save the channel
|
||||
if (sWorld.getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS))
|
||||
if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS))
|
||||
{
|
||||
PreparedStatement *stmt = CharacterDatabase.GetPreparedStatement(CHAR_LOAD_CHANNEL);
|
||||
stmt->setString(0, name);
|
||||
@@ -76,7 +76,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
uint64 banned_guid = atol(*iter);
|
||||
if (banned_guid)
|
||||
{
|
||||
sLog.outDebug("Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid);
|
||||
sLog->outDebug("Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid);
|
||||
banned.insert(banned_guid);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
stmt->setString(0, name);
|
||||
stmt->setUInt32(1, m_Team);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
sLog.outDebug("Channel(%s) saved in database", name.c_str());
|
||||
sLog->outDebug("Channel(%s) saved in database", name.c_str());
|
||||
}
|
||||
|
||||
m_IsSaved = true;
|
||||
@@ -116,7 +116,7 @@ void Channel::UpdateChannelInDB() const
|
||||
stmt->setUInt32(5, m_Team);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
sLog.outDebug("Channel(%s) updated in database", m_name.c_str());
|
||||
sLog->outDebug("Channel(%s) updated in database", m_name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -131,13 +131,13 @@ void Channel::UpdateChannelUseageInDB() const
|
||||
|
||||
void Channel::CleanOldChannelsInDB()
|
||||
{
|
||||
if (sWorld.getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0)
|
||||
if (sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_CLEAN_CHANNEL);
|
||||
stmt->setUInt32(0, sWorld.getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION)*DAY);
|
||||
stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION)*DAY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
sLog.outDebug("Cleaned out unused custom chat channels.");
|
||||
sLog->outDebug("Cleaned out unused custom chat channels.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
if (plr)
|
||||
{
|
||||
if (HasFlag(CHANNEL_FLAG_LFG) &&
|
||||
sWorld.getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup())
|
||||
sWorld->getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && plr->GetSession()->GetSecurity() == SEC_PLAYER && plr->GetGroup())
|
||||
{
|
||||
MakeNotInLfg(&data);
|
||||
SendToOne(&data, p);
|
||||
@@ -184,7 +184,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
plr->JoinedChannel(this);
|
||||
}
|
||||
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
{
|
||||
MakeJoined(&data, p);
|
||||
SendToAll(&data);
|
||||
@@ -246,7 +246,7 @@ void Channel::Leave(uint64 p, bool send)
|
||||
bool changeowner = players[p].IsOwner();
|
||||
|
||||
players.erase(p);
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld.getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
if (m_announce && (!plr || plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || !sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL)))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeLeft(&data, p);
|
||||
@@ -455,7 +455,7 @@ void Channel::SetMode(uint64 p, const char *p2n, bool mod, bool set)
|
||||
// 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
|
||||
if ((plr->GetSession()->GetSecurity() < SEC_GAMEMASTER || newp->GetSession()->GetSecurity() < SEC_GAMEMASTER) &&
|
||||
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;
|
||||
MakePlayerNotFound(&data, p2n);
|
||||
@@ -511,7 +511,7 @@ void Channel::SetOwner(uint64 p, const char *newname)
|
||||
return;
|
||||
}
|
||||
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakePlayerNotFound(&data, newname);
|
||||
@@ -559,7 +559,7 @@ void Channel::List(Player* player)
|
||||
size_t pos = data.wpos();
|
||||
data << uint32(0); // size of list, placeholder
|
||||
|
||||
uint32 gmLevelInWhoList = sWorld.getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
uint32 gmLevelInWhoList = sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
|
||||
uint32 count = 0;
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
@@ -621,7 +621,7 @@ void Channel::Say(uint64 p, const char *what, uint32 lang)
|
||||
{
|
||||
if (!what)
|
||||
return;
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
lang = LANG_UNIVERSAL;
|
||||
|
||||
Player *plr = sObjectMgr->GetPlayer(p);
|
||||
@@ -688,7 +688,7 @@ void Channel::Invite(uint64 p, const char *newname)
|
||||
if (!plr)
|
||||
return;
|
||||
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (newp->GetTeam() != plr->GetTeam() && !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeInviteWrongFaction(&data);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
ChannelMgr* channelMgr(uint32 team)
|
||||
{
|
||||
if (sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
if (sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL))
|
||||
return ACE_Singleton<AllianceChannelMgr, ACE_Null_Mutex>::instance(); // cross-faction
|
||||
|
||||
if (team == ALLIANCE)
|
||||
|
||||
@@ -523,7 +523,7 @@ bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_ac
|
||||
return false;
|
||||
|
||||
// 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 (m_session->GetSecurity() > SEC_PLAYER && !strong && !sWorld->getBoolConfig(CONFIG_GM_LOWER_SECURITY))
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
@@ -598,7 +598,7 @@ void ChatHandler::SendGlobalSysMessage(const char *str)
|
||||
while (char* line = LineFromMessage(pos))
|
||||
{
|
||||
FillSystemMessageData(&data, line);
|
||||
sWorld.SendGlobalMessage(&data);
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
}
|
||||
|
||||
free(buf);
|
||||
@@ -616,7 +616,7 @@ void ChatHandler::SendGlobalGMSysMessage(const char *str)
|
||||
while (char* line = LineFromMessage(pos))
|
||||
{
|
||||
FillSystemMessageData(&data, line);
|
||||
sWorld.SendGlobalGMMessage(&data);
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
}
|
||||
free(buf);
|
||||
}
|
||||
@@ -716,7 +716,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
|
||||
{
|
||||
Player* p = m_session->GetPlayer();
|
||||
uint64 sel_guid = p->GetSelection();
|
||||
sLog.outCommand(m_session->GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]",
|
||||
sLog->outCommand(m_session->GetAccountId(),"Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]",
|
||||
fullcmd.c_str(),p->GetName(),m_session->GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
|
||||
GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName() : "", GUID_LOPART(sel_guid));
|
||||
}
|
||||
@@ -768,12 +768,12 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
|
||||
// expected subcommand by full name DB content
|
||||
else if (*text)
|
||||
{
|
||||
sLog.outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.",text,fullcommand.c_str());
|
||||
sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.",text,fullcommand.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (table[i].SecurityLevel != security)
|
||||
sLog.outDetail("Table `command` overwrite for command '%s' default security (%u) by %u",fullcommand.c_str(),table[i].SecurityLevel,security);
|
||||
sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u",fullcommand.c_str(),table[i].SecurityLevel,security);
|
||||
|
||||
table[i].SecurityLevel = security;
|
||||
table[i].Help = help;
|
||||
@@ -784,9 +784,9 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
|
||||
if (!cmd.empty())
|
||||
{
|
||||
if (table == getCommandTable())
|
||||
sLog.outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str());
|
||||
sLog->outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str());
|
||||
else
|
||||
sLog.outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str());
|
||||
sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str());
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -799,7 +799,7 @@ int ChatHandler::ParseCommands(const char* text)
|
||||
|
||||
std::string fullcmd = text;
|
||||
|
||||
if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld.getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0)
|
||||
if (m_session && m_session->GetSecurity() <= SEC_PLAYER && sWorld->getBoolConfig(CONFIG_ALLOW_PLAYER_COMMANDS) == 0)
|
||||
return 0;
|
||||
|
||||
/// chat case (.command or !command format)
|
||||
@@ -856,7 +856,7 @@ valid examples:
|
||||
const char* validSequenceIterator = validSequence;
|
||||
|
||||
// more simple checks
|
||||
if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3)
|
||||
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) < 3)
|
||||
{
|
||||
const std::string validCommands = "cHhr|";
|
||||
|
||||
@@ -875,7 +875,7 @@ valid examples:
|
||||
|
||||
++message;
|
||||
// validate sequence
|
||||
if (sWorld.getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2)
|
||||
if (sWorld->getIntConfig(CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY) == 2)
|
||||
{
|
||||
if (commandChar == *validSequenceIterator)
|
||||
{
|
||||
@@ -919,7 +919,7 @@ valid examples:
|
||||
else if (reader.get() != '|')
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage sequence aborted unexpectedly");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage sequence aborted unexpectedly");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -928,7 +928,7 @@ valid examples:
|
||||
if (reader.peek() == '\0')
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage pipe followed by \\0");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage pipe followed by \\0");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -953,7 +953,7 @@ valid examples:
|
||||
else
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage invalid sequence, expected %c but got %c", *validSequenceIterator, commandChar);
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage invalid sequence, expected %c but got %c", *validSequenceIterator, commandChar);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -962,7 +962,7 @@ valid examples:
|
||||
{
|
||||
// no escaped pipes in sequences
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage got escaped pipe in sequence");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage got escaped pipe in sequence");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -979,7 +979,7 @@ valid examples:
|
||||
if (!c)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage got \\0 while reading color in |c command");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage got \\0 while reading color in |c command");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -997,7 +997,7 @@ valid examples:
|
||||
continue;
|
||||
}
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage got non hex char '%c' while reading color", c);
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage got non hex char '%c' while reading color", c);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1015,7 +1015,7 @@ valid examples:
|
||||
if (!linkedItem)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage got invalid itemID %u in |item command", atoi(buffer));
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage got invalid itemID %u in |item command", atoi(buffer));
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1023,7 +1023,7 @@ valid examples:
|
||||
if (color != ItemQualityColors[linkedItem->Quality])
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage linked item has color %u, but user claims %u", ItemQualityColors[linkedItem->Quality],
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage linked item has color %u, but user claims %u", ItemQualityColors[linkedItem->Quality],
|
||||
color);
|
||||
#endif
|
||||
return false;
|
||||
@@ -1096,7 +1096,7 @@ valid examples:
|
||||
if (!linkedQuest)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage Questtemplate %u not found", questid);
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage Questtemplate %u not found", questid);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1236,7 +1236,7 @@ valid examples:
|
||||
else
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage user sent unsupported link type '%s'", buffer);
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage user sent unsupported link type '%s'", buffer);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1249,7 +1249,7 @@ valid examples:
|
||||
if (reader.get() != '[')
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage link caption doesn't start with '['");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage link caption doesn't start with '['");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1314,7 +1314,7 @@ valid examples:
|
||||
if (!ql)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage default questname didn't match and there is no locale");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage default questname didn't match and there is no locale");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1331,7 +1331,7 @@ valid examples:
|
||||
if (!foundName)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage no quest locale title matched");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage no quest locale title matched");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1374,7 +1374,7 @@ valid examples:
|
||||
if (!foundName)
|
||||
{
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage linked item name wasn't found in any localization");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage linked item name wasn't found in any localization");
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1406,7 +1406,7 @@ valid examples:
|
||||
break;
|
||||
default:
|
||||
#ifdef TRINITY_DEBUG
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage got invalid command |%c", commandChar);
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage got invalid command |%c", commandChar);
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
@@ -1415,7 +1415,7 @@ valid examples:
|
||||
// check if every opened sequence was also closed properly
|
||||
#ifdef TRINITY_DEBUG
|
||||
if (validSequence != validSequenceIterator)
|
||||
sLog.outBasic("ChatHandler::isValidChatMessage EOF in active sequence");
|
||||
sLog->outBasic("ChatHandler::isValidChatMessage EOF in active sequence");
|
||||
#endif
|
||||
return validSequence == validSequenceIterator;
|
||||
}
|
||||
@@ -2170,7 +2170,7 @@ bool ChatHandler::GetPlayerGroupAndGUIDByName(const char* cname, Player* &plr, G
|
||||
|
||||
LocaleConstant CliHandler::GetSessionDbcLocale() const
|
||||
{
|
||||
return sWorld.GetDefaultDbcLocale();
|
||||
return sWorld->GetDefaultDbcLocale();
|
||||
}
|
||||
|
||||
int CliHandler::GetSessionDbLocaleIndex() const
|
||||
|
||||
@@ -84,14 +84,14 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/)
|
||||
|
||||
bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
|
||||
{
|
||||
uint32 PlayersNum = sWorld.GetPlayerCount();
|
||||
uint32 MaxPlayersNum = sWorld.GetMaxPlayerCount();
|
||||
uint32 activeClientsNum = sWorld.GetActiveSessionCount();
|
||||
uint32 queuedClientsNum = sWorld.GetQueuedSessionCount();
|
||||
uint32 maxActiveClientsNum = sWorld.GetMaxActiveSessionCount();
|
||||
uint32 maxQueuedClientsNum = sWorld.GetMaxQueuedSessionCount();
|
||||
std::string uptime = secsToTimeString(sWorld.GetUptime());
|
||||
uint32 updateTime = sWorld.GetUpdateTime();
|
||||
uint32 PlayersNum = sWorld->GetPlayerCount();
|
||||
uint32 MaxPlayersNum = sWorld->GetMaxPlayerCount();
|
||||
uint32 activeClientsNum = sWorld->GetActiveSessionCount();
|
||||
uint32 queuedClientsNum = sWorld->GetQueuedSessionCount();
|
||||
uint32 maxActiveClientsNum = sWorld->GetMaxActiveSessionCount();
|
||||
uint32 maxQueuedClientsNum = sWorld->GetMaxQueuedSessionCount();
|
||||
std::string uptime = secsToTimeString(sWorld->GetUptime());
|
||||
uint32 updateTime = sWorld->GetUpdateTime();
|
||||
|
||||
PSendSysMessage(_FULLVERSION);
|
||||
PSendSysMessage(LANG_CONNECTED_PLAYERS, PlayersNum, MaxPlayersNum);
|
||||
@@ -137,7 +137,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
||||
}
|
||||
|
||||
// save if the player has last been saved over 20 seconds ago
|
||||
uint32 save_interval = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE);
|
||||
uint32 save_interval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
|
||||
if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS))
|
||||
player->SaveToDB();
|
||||
|
||||
@@ -147,7 +147,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
|
||||
/// Display the 'Message of the day' for the realm
|
||||
bool ChatHandler::HandleServerMotdCommand(const char* /*args*/)
|
||||
{
|
||||
PSendSysMessage(LANG_MOTD_CURRENT, sWorld.GetMotd());
|
||||
PSendSysMessage(LANG_MOTD_CURRENT, sWorld->GetMotd());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ bool ChatHandler::HandleNameAnnounceCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
sWorld.SendWorldText(LANG_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
|
||||
sWorld->SendWorldText(LANG_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ bool ChatHandler::HandleGMNameAnnounceCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
sWorld.SendGMText(LANG_GM_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
|
||||
sWorld->SendGMText(LANG_GM_ANNOUNCE_COLOR, m_session->GetPlayer()->GetName(), args);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ bool ChatHandler::HandleAnnounceCommand(const char* args)
|
||||
|
||||
char buff[2048];
|
||||
sprintf(buff, GetTrinityString(LANG_SYSTEMMESSAGE), args);
|
||||
sWorld.SendServerMessage(SERVER_MSG_STRING, buff);
|
||||
sWorld->SendServerMessage(SERVER_MSG_STRING, buff);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ bool ChatHandler::HandleGMAnnounceCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
sWorld.SendGMText(LANG_GM_BROADCAST,args);
|
||||
sWorld->SendGMText(LANG_GM_BROADCAST,args);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ bool ChatHandler::HandleNotifyCommand(const char* args)
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
|
||||
data << str;
|
||||
sWorld.SendGlobalMessage(&data);
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -109,7 +109,7 @@ bool ChatHandler::HandleGMNotifyCommand(const char* args)
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (str.size()+1));
|
||||
data << str;
|
||||
sWorld.SendGlobalGMMessage(&data);
|
||||
sWorld->SendGlobalGMMessage(&data);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -187,14 +187,14 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(),
|
||||
zone_x, zone_y, ground_z, floor_z, have_map, have_vmap);
|
||||
|
||||
sLog.outDebug("Player %s GPS call for %s '%s' (%s: %u):",
|
||||
sLog->outDebug("Player %s GPS call for %s '%s' (%s: %u):",
|
||||
m_session ? GetNameLink().c_str() : GetTrinityString(LANG_CONSOLE_COMMAND),
|
||||
(obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetName(),
|
||||
(obj->GetTypeId() == TYPEID_PLAYER ? "GUID" : "Entry"), (obj->GetTypeId() == TYPEID_PLAYER ? obj->GetGUIDLow(): obj->GetEntry()));
|
||||
sLog.outDebug(GetTrinityString(LANG_MAP_POSITION),
|
||||
obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld.GetDefaultDbcLocale()] : "<unknown>"),
|
||||
zone_id, (zoneEntry ? zoneEntry->area_name[sWorld.GetDefaultDbcLocale()] : "<unknown>"),
|
||||
area_id, (areaEntry ? areaEntry->area_name[sWorld.GetDefaultDbcLocale()] : "<unknown>"),
|
||||
sLog->outDebug(GetTrinityString(LANG_MAP_POSITION),
|
||||
obj->GetMapId(), (mapEntry ? mapEntry->name[sWorld->GetDefaultDbcLocale()] : "<unknown>"),
|
||||
zone_id, (zoneEntry ? zoneEntry->area_name[sWorld->GetDefaultDbcLocale()] : "<unknown>"),
|
||||
area_id, (areaEntry ? areaEntry->area_name[sWorld->GetDefaultDbcLocale()] : "<unknown>"),
|
||||
obj->GetPhaseMask(),
|
||||
obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(), obj->GetOrientation(),
|
||||
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), obj->GetInstanceId(),
|
||||
@@ -555,7 +555,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
wstrToLower (wnamepart);
|
||||
@@ -642,7 +642,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
|
||||
|
||||
std::ostringstream reply;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
bool limitReached = false;
|
||||
|
||||
GameTeleMap const & teleMap = sObjectMgr->GetGameTeleMap();
|
||||
@@ -710,7 +710,7 @@ bool ChatHandler::HandleWhispersCommand(const char* args)
|
||||
//Save all players in the world
|
||||
bool ChatHandler::HandleSaveAllCommand(const char* /*args*/)
|
||||
{
|
||||
sObjectAccessor.SaveAllPlayers();
|
||||
sObjectAccessor->SaveAllPlayers();
|
||||
SendSysMessage(LANG_PLAYERS_SAVED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
|
||||
// find only player from same account if any
|
||||
if (!target)
|
||||
if (WorldSession* session = sWorld.FindSession(account_id))
|
||||
if (WorldSession* session = sWorld->FindSession(account_id))
|
||||
target = session->GetPlayer();
|
||||
|
||||
uint32 notspeaktime = (uint32) atoi(delayStr);
|
||||
@@ -106,7 +106,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
|
||||
// find only player from same account if any
|
||||
if (!target)
|
||||
if (WorldSession* session = sWorld.FindSession(account_id))
|
||||
if (WorldSession* session = sWorld->FindSession(account_id))
|
||||
target = session->GetPlayer();
|
||||
|
||||
// must have strong lesser security level
|
||||
@@ -221,8 +221,8 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
if (HasLowerSecurity(target, 0))
|
||||
return false;
|
||||
|
||||
if (sWorld.getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
|
||||
sWorld.SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
|
||||
if (sWorld->getBoolConfig(CONFIG_SHOW_KICK_IN_WORLD))
|
||||
sWorld->SendWorldText(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
|
||||
else
|
||||
PSendSysMessage(LANG_COMMAND_KICKMESSAGE, playerName.c_str());
|
||||
|
||||
@@ -528,7 +528,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
GameEventMgr::GameEventDataMap const& events = sGameEventMgr->GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = sGameEventMgr->GetActiveEventList();
|
||||
@@ -646,7 +646,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
|
||||
int i = 0;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
do
|
||||
{
|
||||
if (maxResults && count++ == maxResults)
|
||||
@@ -693,7 +693,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
/// Triggering corpses expire check in world
|
||||
bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
|
||||
{
|
||||
sObjectAccessor.RemoveOldCorpses();
|
||||
sObjectAccessor->RemoveOldCorpses();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -800,7 +800,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
|
||||
if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
|
||||
{
|
||||
sLog.outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
|
||||
sLog->outError("InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
|
||||
PSendSysMessage("Error 2");
|
||||
delete pet;
|
||||
return false;
|
||||
@@ -938,7 +938,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
|
||||
wstrToLower(wnamepart);
|
||||
|
||||
uint32 counter = 0; // Counter for figure out that we found smth.
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// Search in CharTitles.dbc
|
||||
for (uint32 id = 0; id < sCharTitlesStore.GetNumRows(); id++)
|
||||
|
||||
@@ -259,7 +259,7 @@ bool ChatHandler::HandleAddItemCommand(const char *args)
|
||||
if (!plTarget)
|
||||
plTarget = pl;
|
||||
|
||||
sLog.outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
|
||||
sLog->outDetail(GetTrinityString(LANG_ADDITEM), itemId, count);
|
||||
|
||||
ItemPrototype const *pProto = ObjectMgr::GetItemPrototype(itemId);
|
||||
if (!pProto)
|
||||
@@ -338,7 +338,7 @@ bool ChatHandler::HandleAddItemSetCommand(const char *args)
|
||||
if (!plTarget)
|
||||
plTarget = pl;
|
||||
|
||||
sLog.outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId);
|
||||
sLog->outDetail(GetTrinityString(LANG_ADDITEMSET), itemsetId);
|
||||
|
||||
bool found = false;
|
||||
for (uint32 id = 0; id < sItemStorage.MaxEntry; id++)
|
||||
@@ -756,7 +756,7 @@ bool ChatHandler::HandleLookupItemCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// Search in `item_template`
|
||||
for (uint32 id = 0; id < sItemStorage.MaxEntry; id++)
|
||||
@@ -841,7 +841,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// Search in ItemSet.dbc
|
||||
for (uint32 id = 0; id < sItemSetStore.GetNumRows(); id++)
|
||||
@@ -914,7 +914,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// Search in SkillLine.dbc
|
||||
for (uint32 id = 0; id < sSkillLineStore.GetNumRows(); id++)
|
||||
@@ -1001,7 +1001,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// Search in Spell.dbc
|
||||
for (uint32 id = 0; id < sSpellStore.GetNumRows(); id++)
|
||||
@@ -1110,7 +1110,7 @@ bool ChatHandler::HandleLookupQuestCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
ObjectMgr::QuestMap const& qTemplates = sObjectMgr->GetQuestTemplates();
|
||||
for (ObjectMgr::QuestMap::const_iterator iter = qTemplates.begin(); iter != qTemplates.end(); ++iter)
|
||||
@@ -1227,7 +1227,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
for (uint32 id = 0; id< sCreatureStorage.MaxEntry; ++id)
|
||||
{
|
||||
@@ -1311,7 +1311,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
for (uint32 id = 0; id< sGOStorage.MaxEntry; id++)
|
||||
{
|
||||
@@ -1398,7 +1398,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char *args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
for (uint32 id = 0; id < sFactionStore.GetNumRows(); ++id)
|
||||
{
|
||||
@@ -1497,7 +1497,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
|
||||
|
||||
bool found = false;
|
||||
uint32 count = 0;
|
||||
uint32 maxResults = sWorld.getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
uint32 maxResults = sWorld->getIntConfig(CONFIG_MAX_RESULTS_LOOKUP_COMMANDS);
|
||||
|
||||
// Search in TaxiNodes.dbc
|
||||
for (uint32 id = 0; id < sTaxiNodesStore.GetNumRows(); id++)
|
||||
@@ -1575,7 +1575,7 @@ bool ChatHandler::HandleLookupMapCommand(const char *args)
|
||||
MapEntry const* MapInfo = sMapStore.LookupEntry(id);
|
||||
if (MapInfo)
|
||||
{
|
||||
uint8 loc = m_session ? m_session->GetSessionDbcLocale() : sWorld.GetDefaultDbcLocale();
|
||||
uint8 loc = m_session ? m_session->GetSessionDbcLocale() : sWorld->GetDefaultDbcLocale();
|
||||
|
||||
std::string name = MapInfo->name[loc];
|
||||
if (name.empty())
|
||||
@@ -1851,7 +1851,7 @@ bool ChatHandler::HandleDieCommand(const char* /*args*/)
|
||||
|
||||
if (target->isAlive())
|
||||
{
|
||||
if (sWorld.getBoolConfig(CONFIG_DIE_COMMAND_MODE))
|
||||
if (sWorld->getBoolConfig(CONFIG_DIE_COMMAND_MODE))
|
||||
m_session->GetPlayer()->Kill(target);
|
||||
else
|
||||
m_session->GetPlayer()->DealDamage(target, target->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
|
||||
@@ -1954,7 +1954,7 @@ bool ChatHandler::HandleReviveCommand(const char *args)
|
||||
}
|
||||
else
|
||||
// will resurrected at login without corpse
|
||||
sObjectAccessor.ConvertCorpseForPlayer(target_guid);
|
||||
sObjectAccessor->ConvertCorpseForPlayer(target_guid);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -2367,7 +2367,7 @@ bool ChatHandler::HandleChangeWeather(const char *args)
|
||||
return false;
|
||||
|
||||
//Weather is OFF
|
||||
if (!sWorld.getBoolConfig(CONFIG_WEATHER))
|
||||
if (!sWorld->getBoolConfig(CONFIG_WEATHER))
|
||||
{
|
||||
SendSysMessage(LANG_WEATHER_DISABLED);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -2505,7 +2505,7 @@ static bool HandleResetStatsOrLevelHelper(Player* player)
|
||||
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(player->getClass());
|
||||
if (!cEntry)
|
||||
{
|
||||
sLog.outError("Class %u not found in DBC (Wrong DBC files?)",player->getClass());
|
||||
sLog->outError("Class %u not found in DBC (Wrong DBC files?)",player->getClass());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2548,8 +2548,8 @@ bool ChatHandler::HandleResetLevelCommand(const char * args)
|
||||
|
||||
// set starting level
|
||||
uint32 start_level = target->getClass() != CLASS_DEATH_KNIGHT
|
||||
? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
? sWorld->getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
||||
: sWorld->getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
||||
|
||||
sScriptMgr->OnPlayerLevelChanged(target, start_level);
|
||||
|
||||
@@ -2684,14 +2684,14 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
|
||||
if (casename == "spells")
|
||||
{
|
||||
atLogin = AT_LOGIN_RESET_SPELLS;
|
||||
sWorld.SendWorldText(LANG_RESETALL_SPELLS);
|
||||
sWorld->SendWorldText(LANG_RESETALL_SPELLS);
|
||||
if (!m_session)
|
||||
SendSysMessage(LANG_RESETALL_SPELLS);
|
||||
}
|
||||
else if (casename == "talents")
|
||||
{
|
||||
atLogin = AtLoginFlags(AT_LOGIN_RESET_TALENTS | AT_LOGIN_RESET_PET_TALENTS);
|
||||
sWorld.SendWorldText(LANG_RESETALL_TALENTS);
|
||||
sWorld->SendWorldText(LANG_RESETALL_TALENTS);
|
||||
if (!m_session)
|
||||
SendSysMessage(LANG_RESETALL_TALENTS);
|
||||
}
|
||||
@@ -2705,7 +2705,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin);
|
||||
|
||||
ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, *HashMapHolder<Player>::GetLock(), true);
|
||||
HashMapHolder<Player>::MapType const& plist = sObjectAccessor.GetPlayers();
|
||||
HashMapHolder<Player>::MapType const& plist = sObjectAccessor->GetPlayers();
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
|
||||
itr->second->SetAtLoginFlag(atLogin);
|
||||
|
||||
@@ -2714,7 +2714,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
|
||||
|
||||
bool ChatHandler::HandleServerShutDownCancelCommand(const char* /*args*/)
|
||||
{
|
||||
sWorld.ShutdownCancel();
|
||||
sWorld->ShutdownCancel();
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2746,10 +2746,10 @@ bool ChatHandler::HandleServerShutDownCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld.ShutdownServ (time, 0, exitcode);
|
||||
sWorld->ShutdownServ (time, 0, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld.ShutdownServ(time,0,SHUTDOWN_EXIT_CODE);
|
||||
sWorld->ShutdownServ(time,0,SHUTDOWN_EXIT_CODE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2781,10 +2781,10 @@ bool ChatHandler::HandleServerRestartCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld.ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode);
|
||||
sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld.ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
|
||||
sWorld->ShutdownServ(time, SHUTDOWN_MASK_RESTART, RESTART_EXIT_CODE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2816,10 +2816,10 @@ bool ChatHandler::HandleServerIdleRestartCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld.ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
|
||||
sWorld->ShutdownServ (time, SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld.ShutdownServ(time,SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE,RESTART_EXIT_CODE);
|
||||
sWorld->ShutdownServ(time,SHUTDOWN_MASK_RESTART|SHUTDOWN_MASK_IDLE,RESTART_EXIT_CODE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2851,10 +2851,10 @@ bool ChatHandler::HandleServerIdleShutDownCommand(const char *args)
|
||||
if (exitcode < 0 || exitcode > 125)
|
||||
return false;
|
||||
|
||||
sWorld.ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode);
|
||||
sWorld->ShutdownServ (time, SHUTDOWN_MASK_IDLE, exitcode);
|
||||
}
|
||||
else
|
||||
sWorld.ShutdownServ(time,SHUTDOWN_MASK_IDLE,SHUTDOWN_EXIT_CODE);
|
||||
sWorld->ShutdownServ(time,SHUTDOWN_MASK_IDLE,SHUTDOWN_EXIT_CODE);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -2894,7 +2894,7 @@ bool ChatHandler::HandleBanCharacterCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (sWorld.BanCharacter(name, duration, reason, m_session ? m_session->GetPlayerName() : ""))
|
||||
switch (sWorld->BanCharacter(name, duration, reason, m_session ? m_session->GetPlayerName() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
{
|
||||
@@ -2965,7 +2965,7 @@ bool ChatHandler::HandleBanHelper(BanMode mode, const char *args)
|
||||
break;
|
||||
}
|
||||
|
||||
switch(sWorld.BanAccount(mode, nameOrIP, duration, reason,m_session ? m_session->GetPlayerName() : ""))
|
||||
switch(sWorld->BanAccount(mode, nameOrIP, duration, reason,m_session ? m_session->GetPlayerName() : ""))
|
||||
{
|
||||
case BAN_SUCCESS:
|
||||
if (atoi(duration)>0)
|
||||
@@ -3023,7 +3023,7 @@ bool ChatHandler::HandleUnBanCharacterCommand(const char *args)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!sWorld.RemoveBanCharacter(name))
|
||||
if (!sWorld->RemoveBanCharacter(name))
|
||||
{
|
||||
SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||
SetSentErrorMessage(true);
|
||||
@@ -3073,7 +3073,7 @@ bool ChatHandler::HandleUnBanHelper(BanMode mode, const char *args)
|
||||
break;
|
||||
}
|
||||
|
||||
if (sWorld.RemoveBanAccount(mode,nameOrIP))
|
||||
if (sWorld->RemoveBanAccount(mode,nameOrIP))
|
||||
PSendSysMessage(LANG_UNBAN_UNBANNED,nameOrIP.c_str());
|
||||
else
|
||||
PSendSysMessage(LANG_UNBAN_ERROR,nameOrIP.c_str());
|
||||
@@ -3771,30 +3771,30 @@ bool ChatHandler::HandleServerPLimitCommand(const char *args)
|
||||
int l = strlen(param);
|
||||
|
||||
if (strncmp(param,"player",l) == 0)
|
||||
sWorld.SetPlayerSecurityLimit(SEC_PLAYER);
|
||||
sWorld->SetPlayerSecurityLimit(SEC_PLAYER);
|
||||
else if (strncmp(param,"moderator",l) == 0)
|
||||
sWorld.SetPlayerSecurityLimit(SEC_MODERATOR);
|
||||
sWorld->SetPlayerSecurityLimit(SEC_MODERATOR);
|
||||
else if (strncmp(param,"gamemaster",l) == 0)
|
||||
sWorld.SetPlayerSecurityLimit(SEC_GAMEMASTER);
|
||||
sWorld->SetPlayerSecurityLimit(SEC_GAMEMASTER);
|
||||
else if (strncmp(param,"administrator",l) == 0)
|
||||
sWorld.SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
|
||||
sWorld->SetPlayerSecurityLimit(SEC_ADMINISTRATOR);
|
||||
else if (strncmp(param,"reset",l) == 0)
|
||||
{
|
||||
sWorld.SetPlayerAmountLimit(sConfig.GetIntDefault("PlayerLimit", 100));
|
||||
sWorld.LoadDBAllowedSecurityLevel();
|
||||
sWorld->SetPlayerAmountLimit(sConfig->GetIntDefault("PlayerLimit", 100));
|
||||
sWorld->LoadDBAllowedSecurityLevel();
|
||||
}
|
||||
else
|
||||
{
|
||||
int val = atoi(param);
|
||||
if (val < 0)
|
||||
sWorld.SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
|
||||
sWorld->SetPlayerSecurityLimit(AccountTypes(uint32(-val)));
|
||||
else
|
||||
sWorld.SetPlayerAmountLimit(uint32(val));
|
||||
sWorld->SetPlayerAmountLimit(uint32(val));
|
||||
}
|
||||
}
|
||||
|
||||
uint32 pLimit = sWorld.GetPlayerAmountLimit();
|
||||
AccountTypes allowedAccountType = sWorld.GetPlayerSecurityLimit();
|
||||
uint32 pLimit = sWorld->GetPlayerAmountLimit();
|
||||
AccountTypes allowedAccountType = sWorld->GetPlayerSecurityLimit();
|
||||
char const* secName = "";
|
||||
switch(allowedAccountType)
|
||||
{
|
||||
@@ -4182,7 +4182,7 @@ bool ChatHandler::HandleInstanceSaveDataCommand(const char * /*args*/)
|
||||
/// Define the 'Message of the day' for the realm
|
||||
bool ChatHandler::HandleServerSetMotdCommand(const char *args)
|
||||
{
|
||||
sWorld.SetMotd(args);
|
||||
sWorld->SetMotd(args);
|
||||
PSendSysMessage(LANG_MOTD_NEW, args);
|
||||
return true;
|
||||
}
|
||||
@@ -4195,13 +4195,13 @@ bool ChatHandler::HandleServerSetClosedCommand(const char *args)
|
||||
if (strncmp(args, "on", 3) == 0)
|
||||
{
|
||||
SendSysMessage(LANG_WORLD_CLOSED);
|
||||
sWorld.SetClosed(true);
|
||||
sWorld->SetClosed(true);
|
||||
return true;
|
||||
}
|
||||
else if (strncmp(args, "off", 4) == 0)
|
||||
{
|
||||
SendSysMessage(LANG_WORLD_OPENED);
|
||||
sWorld.SetClosed(false);
|
||||
sWorld->SetClosed(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4465,7 +4465,7 @@ bool ChatHandler::HandlePlayAllCommand(const char *args)
|
||||
|
||||
WorldPacket data(SMSG_PLAY_SOUND, 4);
|
||||
data << uint32(soundId) << m_session->GetPlayer()->GetGUID();
|
||||
sWorld.SendGlobalMessage(&data);
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
|
||||
PSendSysMessage(LANG_COMMAND_PLAYED_TO_ALL, soundId);
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user