From 6d5cc744aa73a4634820f5ee304989e453b823b3 Mon Sep 17 00:00:00 2001 From: Maelthyr <100411212+Maelthyrr@users.noreply.github.com> Date: Sat, 28 Jan 2023 11:03:22 +0100 Subject: [PATCH] refactor(Core/World): Remove Hungarian notation (#14095) Co-authored-by: Syllox --- src/server/game/World/World.cpp | 1729 +++++++++++++++---------------- src/server/game/World/World.h | 172 +-- 2 files changed, 950 insertions(+), 951 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 8310e9506..82de7a516 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -101,64 +101,64 @@ namespace TaskScheduler playersSaveScheduler; } -std::atomic_long World::m_stopEvent = false; -uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE; +std::atomic_long World::_stopEvent = false; +uint8 World::_exitCode = SHUTDOWN_EXIT_CODE; uint32 World::m_worldLoopCounter = 0; -float World::m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE; -float World::m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE; -float World::m_MaxVisibleDistanceInBGArenas = DEFAULT_VISIBILITY_BGARENAS; +float World::_maxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE; +float World::_maxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE; +float World::_maxVisibleDistanceInBGArenas = DEFAULT_VISIBILITY_BGARENAS; Realm realm; /// World constructor World::World() { - m_playerLimit = 0; - m_allowedSecurityLevel = SEC_PLAYER; - m_allowMovement = true; - m_ShutdownMask = 0; - m_ShutdownTimer = 0; - m_maxActiveSessionCount = 0; - m_maxQueuedSessionCount = 0; - m_PlayerCount = 0; - m_MaxPlayerCount = 0; - m_NextDailyQuestReset = 0s; - m_NextWeeklyQuestReset = 0s; - m_NextMonthlyQuestReset = 0s; - m_NextRandomBGReset = 0s; - m_NextCalendarOldEventsDeletionTime = 0s; - m_NextGuildReset = 0s; - m_defaultDbcLocale = LOCALE_enUS; - mail_expire_check_timer = 0s; - m_isClosed = false; - m_CleaningFlags = 0; + _playerLimit = 0; + _allowedSecurityLevel = SEC_PLAYER; + _allowMovement = true; + _shutdownMask = 0; + _shutdownTimer = 0; + _maxActiveSessionCount = 0; + _maxQueuedSessionCount = 0; + _playerCount = 0; + _maxPlayerCount = 0; + _nextDailyQuestReset = 0s; + _nextWeeklyQuestReset = 0s; + _nextMonthlyQuestReset = 0s; + _nextRandomBGReset = 0s; + _nextCalendarOldEventsDeletionTime = 0s; + _nextGuildReset = 0s; + _defaultDbcLocale = LOCALE_enUS; + _mail_expire_check_timer = 0s; + _isClosed = false; + _cleaningFlags = 0; - memset(rate_values, 0, sizeof(rate_values)); - memset(m_int_configs, 0, sizeof(m_int_configs)); - memset(m_bool_configs, 0, sizeof(m_bool_configs)); - memset(m_float_configs, 0, sizeof(m_float_configs)); + memset(_rate_values, 0, sizeof(_rate_values)); + memset(_int_configs, 0, sizeof(_int_configs)); + memset(_bool_configs, 0, sizeof(_bool_configs)); + memset(_float_configs, 0, sizeof(_float_configs)); } /// World destructor World::~World() { ///- Empty the kicked session set - while (!m_sessions.empty()) + while (!_sessions.empty()) { // not remove from queue, prevent loading new sessions - delete m_sessions.begin()->second; - m_sessions.erase(m_sessions.begin()); + delete _sessions.begin()->second; + _sessions.erase(_sessions.begin()); } - while (!m_offlineSessions.empty()) + while (!_offlineSessions.empty()) { - delete m_offlineSessions.begin()->second; - m_offlineSessions.erase(m_offlineSessions.begin()); + delete _offlineSessions.begin()->second; + _offlineSessions.erase(_offlineSessions.begin()); } CliCommandHolder* command = nullptr; - while (cliCmdQueue.next(command)) + while (_cliCmdQueue.next(command)) delete command; VMAP::VMapFactory::clear(); @@ -178,7 +178,7 @@ Player* World::FindPlayerInZone(uint32 zone) { ///- circle through active sessions and return the first player found in the zone SessionMap::const_iterator itr; - for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (itr = _sessions.begin(); itr != _sessions.end(); ++itr) { if (!itr->second) continue; @@ -195,12 +195,12 @@ Player* World::FindPlayerInZone(uint32 zone) bool World::IsClosed() const { - return m_isClosed; + return _isClosed; } void World::SetClosed(bool val) { - m_isClosed = val; + _isClosed = val; // Invert the value, for simplicity for scripters. sScriptMgr->OnOpenStateChange(!val); @@ -209,9 +209,9 @@ void World::SetClosed(bool val) /// Find a session by its id WorldSession* World::FindSession(uint32 id) const { - SessionMap::const_iterator itr = m_sessions.find(id); + SessionMap::const_iterator itr = _sessions.find(id); - if (itr != m_sessions.end()) + if (itr != _sessions.end()) return itr->second; // also can return nullptr for kicked session else return nullptr; @@ -219,8 +219,8 @@ WorldSession* World::FindSession(uint32 id) const WorldSession* World::FindOfflineSession(uint32 id) const { - SessionMap::const_iterator itr = m_offlineSessions.find(id); - if (itr != m_offlineSessions.end()) + SessionMap::const_iterator itr = _offlineSessions.find(id); + if (itr != _offlineSessions.end()) return itr->second; else return nullptr; @@ -228,10 +228,10 @@ WorldSession* World::FindOfflineSession(uint32 id) const WorldSession* World::FindOfflineSessionForCharacterGUID(ObjectGuid::LowType guidLow) const { - if (m_offlineSessions.empty()) + if (_offlineSessions.empty()) return nullptr; - for (SessionMap::const_iterator itr = m_offlineSessions.begin(); itr != m_offlineSessions.end(); ++itr) + for (SessionMap::const_iterator itr = _offlineSessions.begin(); itr != _offlineSessions.end(); ++itr) if (itr->second->GetGuidLow() == guidLow) return itr->second; @@ -242,9 +242,9 @@ WorldSession* World::FindOfflineSessionForCharacterGUID(ObjectGuid::LowType guid bool World::KickSession(uint32 id) { ///- Find the session, kick the user, but we can't delete session at this moment to prevent iterator invalidation - SessionMap::const_iterator itr = m_sessions.find(id); + SessionMap::const_iterator itr = _sessions.find(id); - if (itr != m_sessions.end() && itr->second) + if (itr != _sessions.end() && itr->second) { if (itr->second->PlayerLoading()) return false; @@ -257,7 +257,7 @@ bool World::KickSession(uint32 id) void World::AddSession(WorldSession* s) { - addSessQueue.add(s); + _addSessQueue.add(s); } void World::AddSession_(WorldSession* s) @@ -273,28 +273,28 @@ void World::AddSession_(WorldSession* s) return; } - SessionMap::const_iterator old = m_sessions.find(s->GetAccountId()); - if (old != m_sessions.end()) + SessionMap::const_iterator old = _sessions.find(s->GetAccountId()); + if (old != _sessions.end()) { WorldSession* oldSession = old->second; if (!RemoveQueuedPlayer(oldSession) && getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE)) - m_disconnects[s->GetAccountId()] = GameTime::GetGameTime().count(); + _disconnects[s->GetAccountId()] = GameTime::GetGameTime().count(); // pussywizard: if (oldSession->HandleSocketClosed()) { // there should be no offline session if current one is logged onto a character SessionMap::iterator iter; - if ((iter = m_offlineSessions.find(oldSession->GetAccountId())) != m_offlineSessions.end()) + if ((iter = _offlineSessions.find(oldSession->GetAccountId())) != _offlineSessions.end()) { WorldSession* tmp = iter->second; - m_offlineSessions.erase(iter); + _offlineSessions.erase(iter); tmp->SetShouldSetOfflineInDB(false); delete tmp; } oldSession->SetOfflineTime(GameTime::GetGameTime().count()); - m_offlineSessions[oldSession->GetAccountId()] = oldSession; + _offlineSessions[oldSession->GetAccountId()] = oldSession; } else { @@ -303,7 +303,7 @@ void World::AddSession_(WorldSession* s) } } - m_sessions[s->GetAccountId()] = s; + _sessions[s->GetAccountId()] = s; uint32 Sessions = GetActiveAndQueuedSessionCount(); uint32 pLimit = GetPlayerAmountLimit(); @@ -330,7 +330,7 @@ bool World::HasRecentlyDisconnected(WorldSession* session) if (uint32 tolerance = getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE)) { - for (DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end();) + for (DisconnectMap::iterator i = _disconnects.begin(); i != _disconnects.end();) { if ((GameTime::GetGameTime().count() - i->second) < tolerance) { @@ -339,7 +339,7 @@ bool World::HasRecentlyDisconnected(WorldSession* session) ++i; } else - m_disconnects.erase(i++); + _disconnects.erase(i++); } } return false; @@ -349,7 +349,7 @@ int32 World::GetQueuePos(WorldSession* sess) { uint32 position = 1; - for (Queue::const_iterator iter = m_QueuedPlayer.begin(); iter != m_QueuedPlayer.end(); ++iter, ++position) + for (Queue::const_iterator iter = _queuedPlayer.begin(); iter != _queuedPlayer.end(); ++iter, ++position) if ((*iter) == sess) return position; @@ -359,7 +359,7 @@ int32 World::GetQueuePos(WorldSession* sess) void World::AddQueuedPlayer(WorldSession* sess) { sess->SetInQueue(true); - m_QueuedPlayer.push_back(sess); + _queuedPlayer.push_back(sess); // The 1st SMSG_AUTH_RESPONSE needs to contain other info too. sess->SendAuthResponse(AUTH_WAIT_QUEUE, false, GetQueuePos(sess)); @@ -370,18 +370,18 @@ bool World::RemoveQueuedPlayer(WorldSession* sess) uint32 sessions = GetActiveSessionCount(); uint32 position = 1; - Queue::iterator iter = m_QueuedPlayer.begin(); + Queue::iterator iter = _queuedPlayer.begin(); // search to remove and count skipped positions bool found = false; - for (; iter != m_QueuedPlayer.end(); ++iter, ++position) + for (; iter != _queuedPlayer.end(); ++iter, ++position) { if (*iter == sess) { sess->SetInQueue(false); sess->ResetTimeOutTime(false); - iter = m_QueuedPlayer.erase(iter); + iter = _queuedPlayer.erase(iter); found = true; break; } @@ -395,19 +395,19 @@ bool World::RemoveQueuedPlayer(WorldSession* sess) } // accept first in queue - if ((!GetPlayerAmountLimit() || sessions < GetPlayerAmountLimit()) && !m_QueuedPlayer.empty()) + if ((!GetPlayerAmountLimit() || sessions < GetPlayerAmountLimit()) && !_queuedPlayer.empty()) { - WorldSession* pop_sess = m_QueuedPlayer.front(); + WorldSession* pop_sess = _queuedPlayer.front(); pop_sess->InitializeSession(); - m_QueuedPlayer.pop_front(); + _queuedPlayer.pop_front(); // update iter to point first queued socket or end() if queue is empty now - iter = m_QueuedPlayer.begin(); + iter = _queuedPlayer.begin(); position = 1; } // update queue position from iter to end() - for (; iter != m_QueuedPlayer.end(); ++iter, ++position) + for (; iter != _queuedPlayer.end(); ++iter, ++position) (*iter)->SendAuthWaitQueue(position); return found; @@ -445,757 +445,756 @@ void World::LoadConfigSettings(bool reload) Motd::SetMotd(sConfigMgr->GetOption("Motd", "Welcome to an AzerothCore server")); ///- Read ticket system setting from the config file - m_bool_configs[CONFIG_ALLOW_TICKETS] = sConfigMgr->GetOption("AllowTickets", true); - m_bool_configs[CONFIG_DELETE_CHARACTER_TICKET_TRACE] = sConfigMgr->GetOption("DeletedCharacterTicketTrace", false); + _bool_configs[CONFIG_ALLOW_TICKETS] = sConfigMgr->GetOption("AllowTickets", true); + _bool_configs[CONFIG_DELETE_CHARACTER_TICKET_TRACE] = sConfigMgr->GetOption("DeletedCharacterTicketTrace", false); ///- Get string for new logins (newly created characters) SetNewCharString(sConfigMgr->GetOption("PlayerStart.String", "")); ///- Send server info on login? - m_int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfigMgr->GetOption("Server.LoginInfo", 0); + _int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfigMgr->GetOption("Server.LoginInfo", 0); ///- Read all rates from the config file - rate_values[RATE_HEALTH] = sConfigMgr->GetOption("Rate.Health", 1); - if (rate_values[RATE_HEALTH] < 0) + _rate_values[RATE_HEALTH] = sConfigMgr->GetOption("Rate.Health", 1); + if (_rate_values[RATE_HEALTH] < 0) { - LOG_ERROR("server.loading", "Rate.Health ({}) must be > 0. Using 1 instead.", rate_values[RATE_HEALTH]); - rate_values[RATE_HEALTH] = 1; + LOG_ERROR("server.loading", "Rate.Health ({}) must be > 0. Using 1 instead.", _rate_values[RATE_HEALTH]); + _rate_values[RATE_HEALTH] = 1; } - rate_values[RATE_POWER_MANA] = sConfigMgr->GetOption("Rate.Mana", 1); - if (rate_values[RATE_POWER_MANA] < 0) + _rate_values[RATE_POWER_MANA] = sConfigMgr->GetOption("Rate.Mana", 1); + if (_rate_values[RATE_POWER_MANA] < 0) { - LOG_ERROR("server.loading", "Rate.Mana ({}) must be > 0. Using 1 instead.", rate_values[RATE_POWER_MANA]); - rate_values[RATE_POWER_MANA] = 1; + LOG_ERROR("server.loading", "Rate.Mana ({}) must be > 0. Using 1 instead.", _rate_values[RATE_POWER_MANA]); + _rate_values[RATE_POWER_MANA] = 1; } - rate_values[RATE_POWER_RAGE_INCOME] = sConfigMgr->GetOption("Rate.Rage.Income", 1); - rate_values[RATE_POWER_RAGE_LOSS] = sConfigMgr->GetOption("Rate.Rage.Loss", 1); - if (rate_values[RATE_POWER_RAGE_LOSS] < 0) + _rate_values[RATE_POWER_RAGE_INCOME] = sConfigMgr->GetOption("Rate.Rage.Income", 1); + _rate_values[RATE_POWER_RAGE_LOSS] = sConfigMgr->GetOption("Rate.Rage.Loss", 1); + if (_rate_values[RATE_POWER_RAGE_LOSS] < 0) { - LOG_ERROR("server.loading", "Rate.Rage.Loss ({}) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RAGE_LOSS]); - rate_values[RATE_POWER_RAGE_LOSS] = 1; + LOG_ERROR("server.loading", "Rate.Rage.Loss ({}) must be > 0. Using 1 instead.", _rate_values[RATE_POWER_RAGE_LOSS]); + _rate_values[RATE_POWER_RAGE_LOSS] = 1; } - rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfigMgr->GetOption("Rate.RunicPower.Income", 1); - rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfigMgr->GetOption("Rate.RunicPower.Loss", 1); - if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0) + _rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfigMgr->GetOption("Rate.RunicPower.Income", 1); + _rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfigMgr->GetOption("Rate.RunicPower.Loss", 1); + if (_rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0) { - LOG_ERROR("server.loading", "Rate.RunicPower.Loss ({}) must be > 0. Using 1 instead.", rate_values[RATE_POWER_RUNICPOWER_LOSS]); - rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1; + LOG_ERROR("server.loading", "Rate.RunicPower.Loss ({}) must be > 0. Using 1 instead.", _rate_values[RATE_POWER_RUNICPOWER_LOSS]); + _rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1; } - rate_values[RATE_POWER_FOCUS] = sConfigMgr->GetOption("Rate.Focus", 1.0f); - rate_values[RATE_POWER_ENERGY] = sConfigMgr->GetOption("Rate.Energy", 1.0f); + _rate_values[RATE_POWER_FOCUS] = sConfigMgr->GetOption("Rate.Focus", 1.0f); + _rate_values[RATE_POWER_ENERGY] = sConfigMgr->GetOption("Rate.Energy", 1.0f); - rate_values[RATE_SKILL_DISCOVERY] = sConfigMgr->GetOption("Rate.Skill.Discovery", 1.0f); + _rate_values[RATE_SKILL_DISCOVERY] = sConfigMgr->GetOption("Rate.Skill.Discovery", 1.0f); - rate_values[RATE_DROP_ITEM_POOR] = sConfigMgr->GetOption("Rate.Drop.Item.Poor", 1.0f); - rate_values[RATE_DROP_ITEM_NORMAL] = sConfigMgr->GetOption("Rate.Drop.Item.Normal", 1.0f); - rate_values[RATE_DROP_ITEM_UNCOMMON] = sConfigMgr->GetOption("Rate.Drop.Item.Uncommon", 1.0f); - rate_values[RATE_DROP_ITEM_RARE] = sConfigMgr->GetOption("Rate.Drop.Item.Rare", 1.0f); - rate_values[RATE_DROP_ITEM_EPIC] = sConfigMgr->GetOption("Rate.Drop.Item.Epic", 1.0f); - rate_values[RATE_DROP_ITEM_LEGENDARY] = sConfigMgr->GetOption("Rate.Drop.Item.Legendary", 1.0f); - rate_values[RATE_DROP_ITEM_ARTIFACT] = sConfigMgr->GetOption("Rate.Drop.Item.Artifact", 1.0f); - rate_values[RATE_DROP_ITEM_REFERENCED] = sConfigMgr->GetOption("Rate.Drop.Item.Referenced", 1.0f); - rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = sConfigMgr->GetOption("Rate.Drop.Item.ReferencedAmount", 1.0f); - rate_values[RATE_DROP_MONEY] = sConfigMgr->GetOption("Rate.Drop.Money", 1.0f); - rate_values[RATE_REWARD_BONUS_MONEY] = sConfigMgr->GetOption("Rate.RewardBonusMoney", 1.0f); - rate_values[RATE_XP_KILL] = sConfigMgr->GetOption("Rate.XP.Kill", 1.0f); - rate_values[RATE_XP_BG_KILL_AV] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillAV", 1.0f); - rate_values[RATE_XP_BG_KILL_WSG] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillWSG", 1.0f); - rate_values[RATE_XP_BG_KILL_AB] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillAB", 1.0f); - rate_values[RATE_XP_BG_KILL_EOTS] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillEOTS", 1.0f); - rate_values[RATE_XP_BG_KILL_SOTA] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillSOTA", 1.0f); - rate_values[RATE_XP_BG_KILL_IC] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillIC", 1.0f); - rate_values[RATE_XP_QUEST] = sConfigMgr->GetOption("Rate.XP.Quest", 1.0f); - rate_values[RATE_XP_QUEST_DF] = sConfigMgr->GetOption("Rate.XP.Quest.DF", 1.0f); - rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetOption("Rate.XP.Explore", 1.0f); - rate_values[RATE_XP_PET] = sConfigMgr->GetOption("Rate.XP.Pet", 1.0f); - rate_values[RATE_XP_PET_NEXT_LEVEL] = sConfigMgr->GetOption("Rate.Pet.LevelXP", 0.05f); - rate_values[RATE_REPAIRCOST] = sConfigMgr->GetOption("Rate.RepairCost", 1.0f); + _rate_values[RATE_DROP_ITEM_POOR] = sConfigMgr->GetOption("Rate.Drop.Item.Poor", 1.0f); + _rate_values[RATE_DROP_ITEM_NORMAL] = sConfigMgr->GetOption("Rate.Drop.Item.Normal", 1.0f); + _rate_values[RATE_DROP_ITEM_UNCOMMON] = sConfigMgr->GetOption("Rate.Drop.Item.Uncommon", 1.0f); + _rate_values[RATE_DROP_ITEM_RARE] = sConfigMgr->GetOption("Rate.Drop.Item.Rare", 1.0f); + _rate_values[RATE_DROP_ITEM_EPIC] = sConfigMgr->GetOption("Rate.Drop.Item.Epic", 1.0f); + _rate_values[RATE_DROP_ITEM_LEGENDARY] = sConfigMgr->GetOption("Rate.Drop.Item.Legendary", 1.0f); + _rate_values[RATE_DROP_ITEM_ARTIFACT] = sConfigMgr->GetOption("Rate.Drop.Item.Artifact", 1.0f); + _rate_values[RATE_DROP_ITEM_REFERENCED] = sConfigMgr->GetOption("Rate.Drop.Item.Referenced", 1.0f); + _rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = sConfigMgr->GetOption("Rate.Drop.Item.ReferencedAmount", 1.0f); + _rate_values[RATE_DROP_MONEY] = sConfigMgr->GetOption("Rate.Drop.Money", 1.0f); + _rate_values[RATE_REWARD_BONUS_MONEY] = sConfigMgr->GetOption("Rate.RewardBonusMoney", 1.0f); + _rate_values[RATE_XP_KILL] = sConfigMgr->GetOption("Rate.XP.Kill", 1.0f); + _rate_values[RATE_XP_BG_KILL_AV] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillAV", 1.0f); + _rate_values[RATE_XP_BG_KILL_WSG] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillWSG", 1.0f); + _rate_values[RATE_XP_BG_KILL_AB] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillAB", 1.0f); + _rate_values[RATE_XP_BG_KILL_EOTS] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillEOTS", 1.0f); + _rate_values[RATE_XP_BG_KILL_SOTA] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillSOTA", 1.0f); + _rate_values[RATE_XP_BG_KILL_IC] = sConfigMgr->GetOption("Rate.XP.BattlegroundKillIC", 1.0f); + _rate_values[RATE_XP_QUEST] = sConfigMgr->GetOption("Rate.XP.Quest", 1.0f); + _rate_values[RATE_XP_QUEST_DF] = sConfigMgr->GetOption("Rate.XP.Quest.DF", 1.0f); + _rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetOption("Rate.XP.Explore", 1.0f); + _rate_values[RATE_XP_PET] = sConfigMgr->GetOption("Rate.XP.Pet", 1.0f); + _rate_values[RATE_XP_PET_NEXT_LEVEL] = sConfigMgr->GetOption("Rate.Pet.LevelXP", 0.05f); + _rate_values[RATE_REPAIRCOST] = sConfigMgr->GetOption("Rate.RepairCost", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_POOR] = sConfigMgr->GetOption("Rate.SellValue.Item.Poor", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_NORMAL] = sConfigMgr->GetOption("Rate.SellValue.Item.Normal", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_UNCOMMON] = sConfigMgr->GetOption("Rate.SellValue.Item.Uncommon", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_RARE] = sConfigMgr->GetOption("Rate.SellValue.Item.Rare", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_EPIC] = sConfigMgr->GetOption("Rate.SellValue.Item.Epic", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_LEGENDARY] = sConfigMgr->GetOption("Rate.SellValue.Item.Legendary", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_ARTIFACT] = sConfigMgr->GetOption("Rate.SellValue.Item.Artifact", 1.0f); - rate_values[RATE_SELLVALUE_ITEM_HEIRLOOM] = sConfigMgr->GetOption("Rate.SellValue.Item.Heirloom", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_POOR] = sConfigMgr->GetOption("Rate.SellValue.Item.Poor", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_NORMAL] = sConfigMgr->GetOption("Rate.SellValue.Item.Normal", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_UNCOMMON] = sConfigMgr->GetOption("Rate.SellValue.Item.Uncommon", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_RARE] = sConfigMgr->GetOption("Rate.SellValue.Item.Rare", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_EPIC] = sConfigMgr->GetOption("Rate.SellValue.Item.Epic", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_LEGENDARY] = sConfigMgr->GetOption("Rate.SellValue.Item.Legendary", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_ARTIFACT] = sConfigMgr->GetOption("Rate.SellValue.Item.Artifact", 1.0f); + _rate_values[RATE_SELLVALUE_ITEM_HEIRLOOM] = sConfigMgr->GetOption("Rate.SellValue.Item.Heirloom", 1.0f); - rate_values[ RATE_BUYVALUE_ITEM_POOR] = sConfigMgr->GetOption("Rate.BuyValue.Item.Poor", 1.0f); - rate_values[ RATE_BUYVALUE_ITEM_NORMAL] = sConfigMgr->GetOption("Rate.BuyValue.Item.Normal", 1.0f); - rate_values[ RATE_BUYVALUE_ITEM_UNCOMMON] = sConfigMgr->GetOption("Rate.BuyValue.Item.Uncommon", 1.0f); - rate_values[ RATE_BUYVALUE_ITEM_RARE] = sConfigMgr->GetOption("Rate.BuyValue.Item.Rare", 1.0f); - rate_values[ RATE_BUYVALUE_ITEM_EPIC] = sConfigMgr->GetOption("Rate.BuyValue.Item.Epic", 1.0f); - rate_values[ RATE_BUYVALUE_ITEM_LEGENDARY] = sConfigMgr->GetOption("Rate.BuyValue.Item.Legendary", 1.0f); - rate_values[RATE_BUYVALUE_ITEM_ARTIFACT] = sConfigMgr->GetOption("Rate.BuyValue.Item.Artifact", 1.0f); - rate_values[RATE_BUYVALUE_ITEM_HEIRLOOM] = sConfigMgr->GetOption("Rate.BuyValue.Item.Heirloom", 1.0f); + _rate_values[ RATE_BUYVALUE_ITEM_POOR] = sConfigMgr->GetOption("Rate.BuyValue.Item.Poor", 1.0f); + _rate_values[ RATE_BUYVALUE_ITEM_NORMAL] = sConfigMgr->GetOption("Rate.BuyValue.Item.Normal", 1.0f); + _rate_values[ RATE_BUYVALUE_ITEM_UNCOMMON] = sConfigMgr->GetOption("Rate.BuyValue.Item.Uncommon", 1.0f); + _rate_values[ RATE_BUYVALUE_ITEM_RARE] = sConfigMgr->GetOption("Rate.BuyValue.Item.Rare", 1.0f); + _rate_values[ RATE_BUYVALUE_ITEM_EPIC] = sConfigMgr->GetOption("Rate.BuyValue.Item.Epic", 1.0f); + _rate_values[ RATE_BUYVALUE_ITEM_LEGENDARY] = sConfigMgr->GetOption("Rate.BuyValue.Item.Legendary", 1.0f); + _rate_values[RATE_BUYVALUE_ITEM_ARTIFACT] = sConfigMgr->GetOption("Rate.BuyValue.Item.Artifact", 1.0f); + _rate_values[RATE_BUYVALUE_ITEM_HEIRLOOM] = sConfigMgr->GetOption("Rate.BuyValue.Item.Heirloom", 1.0f); - if (rate_values[RATE_REPAIRCOST] < 0.0f) + if (_rate_values[RATE_REPAIRCOST] < 0.0f) { - LOG_ERROR("server.loading", "Rate.RepairCost ({}) must be >=0. Using 0.0 instead.", rate_values[RATE_REPAIRCOST]); - rate_values[RATE_REPAIRCOST] = 0.0f; + LOG_ERROR("server.loading", "Rate.RepairCost ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_REPAIRCOST]); + _rate_values[RATE_REPAIRCOST] = 0.0f; } - rate_values[RATE_REPUTATION_GAIN] = sConfigMgr->GetOption("Rate.Reputation.Gain", 1.0f); - rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfigMgr->GetOption("Rate.Reputation.LowLevel.Kill", 1.0f); - rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfigMgr->GetOption("Rate.Reputation.LowLevel.Quest", 1.0f); - rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = sConfigMgr->GetOption("Rate.Reputation.RecruitAFriendBonus", 0.1f); - rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Normal.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.Elite.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RAREELITE.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RARE.Damage", 1.0f); - rate_values[RATE_CREATURE_NORMAL_HP] = sConfigMgr->GetOption("Rate.Creature.Normal.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.Elite.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.RAREELITE.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.RARE.HP", 1.0f); - rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Normal.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.Elite.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RARE.SpellDamage", 1.0f); - rate_values[RATE_CREATURE_AGGRO] = sConfigMgr->GetOption("Rate.Creature.Aggro", 1.0f); - rate_values[RATE_REST_INGAME] = sConfigMgr->GetOption("Rate.Rest.InGame", 1.0f); - rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = sConfigMgr->GetOption("Rate.Rest.Offline.InTavernOrCity", 1.0f); - rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = sConfigMgr->GetOption("Rate.Rest.Offline.InWilderness", 1.0f); - rate_values[RATE_DAMAGE_FALL] = sConfigMgr->GetOption("Rate.Damage.Fall", 1.0f); - rate_values[RATE_AUCTION_TIME] = sConfigMgr->GetOption("Rate.Auction.Time", 1.0f); - rate_values[RATE_AUCTION_DEPOSIT] = sConfigMgr->GetOption("Rate.Auction.Deposit", 1.0f); - rate_values[RATE_AUCTION_CUT] = sConfigMgr->GetOption("Rate.Auction.Cut", 1.0f); - rate_values[RATE_HONOR] = sConfigMgr->GetOption("Rate.Honor", 1.0f); - rate_values[RATE_ARENA_POINTS] = sConfigMgr->GetOption("Rate.ArenaPoints", 1.0f); - rate_values[RATE_INSTANCE_RESET_TIME] = sConfigMgr->GetOption("Rate.InstanceResetTime", 1.0f); + _rate_values[RATE_REPUTATION_GAIN] = sConfigMgr->GetOption("Rate.Reputation.Gain", 1.0f); + _rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfigMgr->GetOption("Rate.Reputation.LowLevel.Kill", 1.0f); + _rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfigMgr->GetOption("Rate.Reputation.LowLevel.Quest", 1.0f); + _rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = sConfigMgr->GetOption("Rate.Reputation.RecruitAFriendBonus", 0.1f); + _rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Normal.Damage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.Elite.Damage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RAREELITE.Damage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RARE.Damage", 1.0f); + _rate_values[RATE_CREATURE_NORMAL_HP] = sConfigMgr->GetOption("Rate.Creature.Normal.HP", 1.0f); + _rate_values[RATE_CREATURE_ELITE_ELITE_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.Elite.HP", 1.0f); + _rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.RAREELITE.HP", 1.0f); + _rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f); + _rate_values[RATE_CREATURE_ELITE_RARE_HP] = sConfigMgr->GetOption("Rate.Creature.Elite.RARE.HP", 1.0f); + _rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Normal.SpellDamage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.Elite.SpellDamage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f); + _rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = sConfigMgr->GetOption("Rate.Creature.Elite.RARE.SpellDamage", 1.0f); + _rate_values[RATE_CREATURE_AGGRO] = sConfigMgr->GetOption("Rate.Creature.Aggro", 1.0f); + _rate_values[RATE_REST_INGAME] = sConfigMgr->GetOption("Rate.Rest.InGame", 1.0f); + _rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = sConfigMgr->GetOption("Rate.Rest.Offline.InTavernOrCity", 1.0f); + _rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = sConfigMgr->GetOption("Rate.Rest.Offline.InWilderness", 1.0f); + _rate_values[RATE_DAMAGE_FALL] = sConfigMgr->GetOption("Rate.Damage.Fall", 1.0f); + _rate_values[RATE_AUCTION_TIME] = sConfigMgr->GetOption("Rate.Auction.Time", 1.0f); + _rate_values[RATE_AUCTION_DEPOSIT] = sConfigMgr->GetOption("Rate.Auction.Deposit", 1.0f); + _rate_values[RATE_AUCTION_CUT] = sConfigMgr->GetOption("Rate.Auction.Cut", 1.0f); + _rate_values[RATE_HONOR] = sConfigMgr->GetOption("Rate.Honor", 1.0f); + _rate_values[RATE_ARENA_POINTS] = sConfigMgr->GetOption("Rate.ArenaPoints", 1.0f); + _rate_values[RATE_INSTANCE_RESET_TIME] = sConfigMgr->GetOption("Rate.InstanceResetTime", 1.0f); - rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE] = sConfigMgr->GetOption("Rate.MissChanceMultiplier.TargetCreature", 11.0f); - rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER] = sConfigMgr->GetOption("Rate.MissChanceMultiplier.TargetPlayer", 7.0f); - m_bool_configs[CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS] = sConfigMgr->GetOption("Rate.MissChanceMultiplier.OnlyAffectsPlayer", false); + _rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE] = sConfigMgr->GetOption("Rate.MissChanceMultiplier.TargetCreature", 11.0f); + _rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER] = sConfigMgr->GetOption("Rate.MissChanceMultiplier.TargetPlayer", 7.0f); + _bool_configs[CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS] = sConfigMgr->GetOption("Rate.MissChanceMultiplier.OnlyAffectsPlayer", false); - rate_values[RATE_TALENT] = sConfigMgr->GetOption("Rate.Talent", 1.0f); - if (rate_values[RATE_TALENT] < 0.0f) + _rate_values[RATE_TALENT] = sConfigMgr->GetOption("Rate.Talent", 1.0f); + if (_rate_values[RATE_TALENT] < 0.0f) { - LOG_ERROR("server.loading", "Rate.Talent ({}) must be > 0. Using 1 instead.", rate_values[RATE_TALENT]); - rate_values[RATE_TALENT] = 1.0f; + LOG_ERROR("server.loading", "Rate.Talent ({}) must be > 0. Using 1 instead.", _rate_values[RATE_TALENT]); + _rate_values[RATE_TALENT] = 1.0f; } - rate_values[RATE_MOVESPEED] = sConfigMgr->GetOption("Rate.MoveSpeed", 1.0f); - if (rate_values[RATE_MOVESPEED] < 0) + _rate_values[RATE_MOVESPEED] = sConfigMgr->GetOption("Rate.MoveSpeed", 1.0f); + if (_rate_values[RATE_MOVESPEED] < 0) { - LOG_ERROR("server.loading", "Rate.MoveSpeed ({}) must be > 0. Using 1 instead.", rate_values[RATE_MOVESPEED]); - rate_values[RATE_MOVESPEED] = 1.0f; + LOG_ERROR("server.loading", "Rate.MoveSpeed ({}) must be > 0. Using 1 instead.", _rate_values[RATE_MOVESPEED]); + _rate_values[RATE_MOVESPEED] = 1.0f; } - for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED]; - rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfigMgr->GetOption("Rate.Corpse.Decay.Looted", 0.5f); + for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * _rate_values[RATE_MOVESPEED]; + _rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfigMgr->GetOption("Rate.Corpse.Decay.Looted", 0.5f); - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfigMgr->GetOption("TargetPosRecalculateRange", 1.5f); - if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE) + _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfigMgr->GetOption("TargetPosRecalculateRange", 1.5f); + if (_rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE) { - LOG_ERROR("server.loading", "TargetPosRecalculateRange ({}) must be >= {}. Using {} instead.", rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE); - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = CONTACT_DISTANCE; + LOG_ERROR("server.loading", "TargetPosRecalculateRange ({}) must be >= {}. Using {} instead.", _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE); + _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = CONTACT_DISTANCE; } - else if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] > NOMINAL_MELEE_RANGE) + else if (_rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] > NOMINAL_MELEE_RANGE) { - LOG_ERROR("server.loading", "TargetPosRecalculateRange ({}) must be <= {}. Using {} instead.", - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE); - rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE; + LOG_ERROR("server.loading", "TargetPosRecalculateRange ({}) must be <= {}. Using {} instead.", _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE); + _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE; } - rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfigMgr->GetOption("DurabilityLoss.OnDeath", 10.0f); - if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f) + _rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfigMgr->GetOption("DurabilityLoss.OnDeath", 10.0f); + if (_rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f) { - LOG_ERROR("server.loading", "DurabilityLoss.OnDeath ({}) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); - rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f; + LOG_ERROR("server.loading", "DurabilityLoss.OnDeath ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); + _rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f; } - if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] > 100.0f) + if (_rate_values[RATE_DURABILITY_LOSS_ON_DEATH] > 100.0f) { - LOG_ERROR("server.loading", "DurabilityLoss.OnDeath ({}) must be <= 100. Using 100.0 instead.", rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); - rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f; + LOG_ERROR("server.loading", "DurabilityLoss.OnDeath ({}) must be <= 100. Using 100.0 instead.", _rate_values[RATE_DURABILITY_LOSS_ON_DEATH]); + _rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f; + _rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = _rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f; - rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfigMgr->GetOption("DurabilityLossChance.Damage", 0.5f); - if (rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f) + _rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfigMgr->GetOption("DurabilityLossChance.Damage", 0.5f); + if (_rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f) { - LOG_ERROR("server.loading", "DurabilityLossChance.Damage ({}) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_DAMAGE]); - rate_values[RATE_DURABILITY_LOSS_DAMAGE] = 0.0f; + LOG_ERROR("server.loading", "DurabilityLossChance.Damage ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_DAMAGE]); + _rate_values[RATE_DURABILITY_LOSS_DAMAGE] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfigMgr->GetOption("DurabilityLossChance.Absorb", 0.5f); - if (rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f) + _rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfigMgr->GetOption("DurabilityLossChance.Absorb", 0.5f); + if (_rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f) { - LOG_ERROR("server.loading", "DurabilityLossChance.Absorb ({}) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_ABSORB]); - rate_values[RATE_DURABILITY_LOSS_ABSORB] = 0.0f; + LOG_ERROR("server.loading", "DurabilityLossChance.Absorb ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_ABSORB]); + _rate_values[RATE_DURABILITY_LOSS_ABSORB] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfigMgr->GetOption("DurabilityLossChance.Parry", 0.05f); - if (rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f) + _rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfigMgr->GetOption("DurabilityLossChance.Parry", 0.05f); + if (_rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f) { - LOG_ERROR("server.loading", "DurabilityLossChance.Parry ({}) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_PARRY]); - rate_values[RATE_DURABILITY_LOSS_PARRY] = 0.0f; + LOG_ERROR("server.loading", "DurabilityLossChance.Parry ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_PARRY]); + _rate_values[RATE_DURABILITY_LOSS_PARRY] = 0.0f; } - rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfigMgr->GetOption("DurabilityLossChance.Block", 0.05f); - if (rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f) + _rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfigMgr->GetOption("DurabilityLossChance.Block", 0.05f); + if (_rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f) { - LOG_ERROR("server.loading", "DurabilityLossChance.Block ({}) must be >=0. Using 0.0 instead.", rate_values[RATE_DURABILITY_LOSS_BLOCK]); - rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f; + LOG_ERROR("server.loading", "DurabilityLossChance.Block ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_BLOCK]); + _rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f; } ///- Read other configuration items from the config file - m_bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfigMgr->GetOption("DurabilityLoss.InPvP", false); + _bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfigMgr->GetOption("DurabilityLoss.InPvP", false); - m_int_configs[CONFIG_COMPRESSION] = sConfigMgr->GetOption("Compression", 1); - if (m_int_configs[CONFIG_COMPRESSION] < 1 || m_int_configs[CONFIG_COMPRESSION] > 9) + _int_configs[CONFIG_COMPRESSION] = sConfigMgr->GetOption("Compression", 1); + if (_int_configs[CONFIG_COMPRESSION] < 1 || _int_configs[CONFIG_COMPRESSION] > 9) { - LOG_ERROR("server.loading", "Compression level ({}) must be in range 1..9. Using default compression level (1).", m_int_configs[CONFIG_COMPRESSION]); - m_int_configs[CONFIG_COMPRESSION] = 1; + LOG_ERROR("server.loading", "Compression level ({}) must be in range 1..9. Using default compression level (1).", _int_configs[CONFIG_COMPRESSION]); + _int_configs[CONFIG_COMPRESSION] = 1; } - m_bool_configs[CONFIG_ADDON_CHANNEL] = sConfigMgr->GetOption("AddonChannel", true); - m_bool_configs[CONFIG_CLEAN_CHARACTER_DB] = sConfigMgr->GetOption("CleanCharacterDB", false); - m_int_configs[CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS] = sConfigMgr->GetOption("PersistentCharacterCleanFlags", 0); - m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetOption("ChatLevelReq.Channel", 1); - m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetOption("ChatLevelReq.Whisper", 1); - m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetOption("ChatLevelReq.Say", 1); - m_int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetOption("PartyLevelReq", 1); - m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Trade", 1); - m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Ticket", 1); - m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Auction", 1); - m_int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Mail", 1); - m_bool_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = sConfigMgr->GetOption("AllowPlayerCommands", 1); - m_bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfigMgr->GetOption("PreserveCustomChannels", false); - m_int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfigMgr->GetOption("PreserveCustomChannelDuration", 14); - m_int_configs[CONFIG_INTERVAL_SAVE] = sConfigMgr->GetOption("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfigMgr->GetOption("DisconnectToleranceInterval", 0); - m_bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfigMgr->GetOption("PlayerSave.Stats.SaveOnlyOnLogout", true); + _bool_configs[CONFIG_ADDON_CHANNEL] = sConfigMgr->GetOption("AddonChannel", true); + _bool_configs[CONFIG_CLEAN_CHARACTER_DB] = sConfigMgr->GetOption("CleanCharacterDB", false); + _int_configs[CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS] = sConfigMgr->GetOption("PersistentCharacterCleanFlags", 0); + _int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetOption("ChatLevelReq.Channel", 1); + _int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetOption("ChatLevelReq.Whisper", 1); + _int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetOption("ChatLevelReq.Say", 1); + _int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetOption("PartyLevelReq", 1); + _int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Trade", 1); + _int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Ticket", 1); + _int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Auction", 1); + _int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfigMgr->GetOption("LevelReq.Mail", 1); + _bool_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = sConfigMgr->GetOption("AllowPlayerCommands", 1); + _bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfigMgr->GetOption("PreserveCustomChannels", false); + _int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfigMgr->GetOption("PreserveCustomChannelDuration", 14); + _int_configs[CONFIG_INTERVAL_SAVE] = sConfigMgr->GetOption("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS); + _int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfigMgr->GetOption("DisconnectToleranceInterval", 0); + _bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfigMgr->GetOption("PlayerSave.Stats.SaveOnlyOnLogout", true); - m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfigMgr->GetOption("PlayerSave.Stats.MinLevel", 0); - if (m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] > MAX_LEVEL || int32(m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]) < 0) + _int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfigMgr->GetOption("PlayerSave.Stats.MinLevel", 0); + if (_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] > MAX_LEVEL || int32(_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]) < 0) { - LOG_ERROR("server.loading", "PlayerSave.Stats.MinLevel ({}) must be in range 0..80. Using default, do not save character stats (0).", m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]); - m_int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0; + LOG_ERROR("server.loading", "PlayerSave.Stats.MinLevel ({}) must be in range 0..80. Using default, do not save character stats (0).", _int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]); + _int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = 0; } - m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfigMgr->GetOption("MapUpdateInterval", 100); - if (m_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) + _int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfigMgr->GetOption("MapUpdateInterval", 100); + if (_int_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY) { - LOG_ERROR("server.loading", "MapUpdateInterval ({}) must be greater {}. Use this minimal value.", m_int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY); - m_int_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; + LOG_ERROR("server.loading", "MapUpdateInterval ({}) must be greater {}. Use this minimal value.", _int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY); + _int_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY; } if (reload) - sMapMgr->SetMapUpdateInterval(m_int_configs[CONFIG_INTERVAL_MAPUPDATE]); + sMapMgr->SetMapUpdateInterval(_int_configs[CONFIG_INTERVAL_MAPUPDATE]); - m_int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfigMgr->GetOption("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); + _int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfigMgr->GetOption("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS); if (reload) { uint32 val = sConfigMgr->GetOption("WorldServerPort", 8085); - if (val != m_int_configs[CONFIG_PORT_WORLD]) - LOG_ERROR("server.loading", "WorldServerPort option can't be changed at worldserver.conf reload, using current value ({}).", m_int_configs[CONFIG_PORT_WORLD]); + if (val != _int_configs[CONFIG_PORT_WORLD]) + LOG_ERROR("server.loading", "WorldServerPort option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_PORT_WORLD]); } else - m_int_configs[CONFIG_PORT_WORLD] = sConfigMgr->GetOption("WorldServerPort", 8085); + _int_configs[CONFIG_PORT_WORLD] = sConfigMgr->GetOption("WorldServerPort", 8085); - m_bool_configs[CONFIG_CLOSE_IDLE_CONNECTIONS] = sConfigMgr->GetOption("CloseIdleConnections", true); - m_int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfigMgr->GetOption("SocketTimeOutTime", 900000); - m_int_configs[CONFIG_SOCKET_TIMEOUTTIME_ACTIVE] = sConfigMgr->GetOption("SocketTimeOutTimeActive", 60000); - m_int_configs[CONFIG_SESSION_ADD_DELAY] = sConfigMgr->GetOption("SessionAddDelay", 10000); + _bool_configs[CONFIG_CLOSE_IDLE_CONNECTIONS] = sConfigMgr->GetOption("CloseIdleConnections", true); + _int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfigMgr->GetOption("SocketTimeOutTime", 900000); + _int_configs[CONFIG_SOCKET_TIMEOUTTIME_ACTIVE] = sConfigMgr->GetOption("SocketTimeOutTimeActive", 60000); + _int_configs[CONFIG_SESSION_ADD_DELAY] = sConfigMgr->GetOption("SessionAddDelay", 10000); - m_float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetOption("MaxGroupXPDistance", 74.0f); - m_float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetOption("MaxRecruitAFriendBonusDistance", 100.0f); + _float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetOption("MaxGroupXPDistance", 74.0f); + _float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetOption("MaxRecruitAFriendBonusDistance", 100.0f); /// \todo Add MonsterSight in worldserver.conf or put it as define - m_float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetOption("MonsterSight", 50); + _float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetOption("MonsterSight", 50); if (reload) { uint32 val = sConfigMgr->GetOption("GameType", 0); - if (val != m_int_configs[CONFIG_GAME_TYPE]) - LOG_ERROR("server.loading", "GameType option can't be changed at worldserver.conf reload, using current value ({}).", m_int_configs[CONFIG_GAME_TYPE]); + if (val != _int_configs[CONFIG_GAME_TYPE]) + LOG_ERROR("server.loading", "GameType option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_GAME_TYPE]); } else - m_int_configs[CONFIG_GAME_TYPE] = sConfigMgr->GetOption("GameType", 0); + _int_configs[CONFIG_GAME_TYPE] = sConfigMgr->GetOption("GameType", 0); if (reload) { uint32 val = sConfigMgr->GetOption("RealmZone", REALM_ZONE_DEVELOPMENT); - if (val != m_int_configs[CONFIG_REALM_ZONE]) - LOG_ERROR("server.loading", "RealmZone option can't be changed at worldserver.conf reload, using current value ({}).", m_int_configs[CONFIG_REALM_ZONE]); + if (val != _int_configs[CONFIG_REALM_ZONE]) + LOG_ERROR("server.loading", "RealmZone option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_REALM_ZONE]); } else - m_int_configs[CONFIG_REALM_ZONE] = sConfigMgr->GetOption("RealmZone", REALM_ZONE_DEVELOPMENT); + _int_configs[CONFIG_REALM_ZONE] = sConfigMgr->GetOption("RealmZone", REALM_ZONE_DEVELOPMENT); - m_int_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfigMgr->GetOption ("StrictPlayerNames", 0); - m_int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfigMgr->GetOption ("StrictCharterNames", 0); - m_int_configs[CONFIG_STRICT_CHANNEL_NAMES] = sConfigMgr->GetOption ("StrictChannelNames", 0); - m_int_configs[CONFIG_STRICT_PET_NAMES] = sConfigMgr->GetOption ("StrictPetNames", 0); + _int_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfigMgr->GetOption ("StrictPlayerNames", 0); + _int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfigMgr->GetOption ("StrictCharterNames", 0); + _int_configs[CONFIG_STRICT_CHANNEL_NAMES] = sConfigMgr->GetOption ("StrictChannelNames", 0); + _int_configs[CONFIG_STRICT_PET_NAMES] = sConfigMgr->GetOption ("StrictPetNames", 0); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfigMgr->GetOption("AllowTwoSide.Accounts", true); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Calendar", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Chat", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Channel", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Group", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Guild", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Auction", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Mail", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfigMgr->GetOption("AllowTwoSide.WhoList", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfigMgr->GetOption("AllowTwoSide.AddFriend", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfigMgr->GetOption("AllowTwoSide.Trade", false); - m_bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Emote", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfigMgr->GetOption("AllowTwoSide.Accounts", true); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Calendar", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Chat", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Channel", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Group", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Guild", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Auction", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Mail", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfigMgr->GetOption("AllowTwoSide.WhoList", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfigMgr->GetOption("AllowTwoSide.AddFriend", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfigMgr->GetOption("AllowTwoSide.Trade", false); + _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE] = sConfigMgr->GetOption("AllowTwoSide.Interaction.Emote", false); - m_int_configs[CONFIG_MIN_PLAYER_NAME] = sConfigMgr->GetOption ("MinPlayerName", 2); - if (m_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME) + _int_configs[CONFIG_MIN_PLAYER_NAME] = sConfigMgr->GetOption ("MinPlayerName", 2); + if (_int_configs[CONFIG_MIN_PLAYER_NAME] < 1 || _int_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME) { - LOG_ERROR("server.loading", "MinPlayerName ({}) must be in range 1..{}. Set to 2.", m_int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME); - m_int_configs[CONFIG_MIN_PLAYER_NAME] = 2; + LOG_ERROR("server.loading", "MinPlayerName ({}) must be in range 1..{}. Set to 2.", _int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME); + _int_configs[CONFIG_MIN_PLAYER_NAME] = 2; } - m_int_configs[CONFIG_MIN_CHARTER_NAME] = sConfigMgr->GetOption ("MinCharterName", 2); - if (m_int_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_int_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME) + _int_configs[CONFIG_MIN_CHARTER_NAME] = sConfigMgr->GetOption ("MinCharterName", 2); + if (_int_configs[CONFIG_MIN_CHARTER_NAME] < 1 || _int_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME) { - LOG_ERROR("server.loading", "MinCharterName ({}) must be in range 1..{}. Set to 2.", m_int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME); - m_int_configs[CONFIG_MIN_CHARTER_NAME] = 2; + LOG_ERROR("server.loading", "MinCharterName ({}) must be in range 1..{}. Set to 2.", _int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME); + _int_configs[CONFIG_MIN_CHARTER_NAME] = 2; } - m_int_configs[CONFIG_MIN_PET_NAME] = sConfigMgr->GetOption ("MinPetName", 2); - if (m_int_configs[CONFIG_MIN_PET_NAME] < 1 || m_int_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME) + _int_configs[CONFIG_MIN_PET_NAME] = sConfigMgr->GetOption ("MinPetName", 2); + if (_int_configs[CONFIG_MIN_PET_NAME] < 1 || _int_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME) { - LOG_ERROR("server.loading", "MinPetName ({}) must be in range 1..{}. Set to 2.", m_int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME); - m_int_configs[CONFIG_MIN_PET_NAME] = 2; + LOG_ERROR("server.loading", "MinPetName ({}) must be in range 1..{}. Set to 2.", _int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME); + _int_configs[CONFIG_MIN_PET_NAME] = 2; } - m_int_configs[CONFIG_CHARTER_COST_GUILD] = sConfigMgr->GetOption("Guild.CharterCost", 1000); - m_int_configs[CONFIG_CHARTER_COST_ARENA_2v2] = sConfigMgr->GetOption("ArenaTeam.CharterCost.2v2", 800000); - m_int_configs[CONFIG_CHARTER_COST_ARENA_3v3] = sConfigMgr->GetOption("ArenaTeam.CharterCost.3v3", 1200000); - m_int_configs[CONFIG_CHARTER_COST_ARENA_5v5] = sConfigMgr->GetOption("ArenaTeam.CharterCost.5v5", 2000000); + _int_configs[CONFIG_CHARTER_COST_GUILD] = sConfigMgr->GetOption("Guild.CharterCost", 1000); + _int_configs[CONFIG_CHARTER_COST_ARENA_2v2] = sConfigMgr->GetOption("ArenaTeam.CharterCost.2v2", 800000); + _int_configs[CONFIG_CHARTER_COST_ARENA_3v3] = sConfigMgr->GetOption("ArenaTeam.CharterCost.3v3", 1200000); + _int_configs[CONFIG_CHARTER_COST_ARENA_5v5] = sConfigMgr->GetOption("ArenaTeam.CharterCost.5v5", 2000000); - m_int_configs[CONFIG_MAX_WHO_LIST_RETURN] = sConfigMgr->GetOption("MaxWhoListReturns", 49); + _int_configs[CONFIG_MAX_WHO_LIST_RETURN] = sConfigMgr->GetOption("MaxWhoListReturns", 49); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = sConfigMgr->GetOption("CharacterCreating.Disabled", 0); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = sConfigMgr->GetOption("CharacterCreating.Disabled.RaceMask", 0); + _int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = sConfigMgr->GetOption("CharacterCreating.Disabled", 0); + _int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = sConfigMgr->GetOption("CharacterCreating.Disabled.RaceMask", 0); - m_int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = sConfigMgr->GetOption("CharacterCreating.Disabled.ClassMask", 0); + _int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = sConfigMgr->GetOption("CharacterCreating.Disabled.ClassMask", 0); - m_int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfigMgr->GetOption("CharactersPerRealm", 10); - if (m_int_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_int_configs[CONFIG_CHARACTERS_PER_REALM] > 10) + _int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfigMgr->GetOption("CharactersPerRealm", 10); + if (_int_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || _int_configs[CONFIG_CHARACTERS_PER_REALM] > 10) { - LOG_ERROR("server.loading", "CharactersPerRealm ({}) must be in range 1..10. Set to 10.", m_int_configs[CONFIG_CHARACTERS_PER_REALM]); - m_int_configs[CONFIG_CHARACTERS_PER_REALM] = 10; + LOG_ERROR("server.loading", "CharactersPerRealm ({}) must be in range 1..10. Set to 10.", _int_configs[CONFIG_CHARACTERS_PER_REALM]); + _int_configs[CONFIG_CHARACTERS_PER_REALM] = 10; } // must be after CONFIG_CHARACTERS_PER_REALM - m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfigMgr->GetOption("CharactersPerAccount", 50); - if (m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_int_configs[CONFIG_CHARACTERS_PER_REALM]) + _int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfigMgr->GetOption("CharactersPerAccount", 50); + if (_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < _int_configs[CONFIG_CHARACTERS_PER_REALM]) { - LOG_ERROR("server.loading", "CharactersPerAccount ({}) can't be less than CharactersPerRealm ({}).", m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], m_int_configs[CONFIG_CHARACTERS_PER_REALM]); - m_int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_int_configs[CONFIG_CHARACTERS_PER_REALM]; + LOG_ERROR("server.loading", "CharactersPerAccount ({}) can't be less than CharactersPerRealm ({}).", _int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], _int_configs[CONFIG_CHARACTERS_PER_REALM]); + _int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = _int_configs[CONFIG_CHARACTERS_PER_REALM]; } - m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfigMgr->GetOption("HeroicCharactersPerRealm", 1); - if (int32(m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10) + _int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfigMgr->GetOption("HeroicCharactersPerRealm", 1); + if (int32(_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || _int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10) { - LOG_ERROR("server.loading", "HeroicCharactersPerRealm ({}) must be in range 0..10. Set to 1.", m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]); - m_int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1; + LOG_ERROR("server.loading", "HeroicCharactersPerRealm ({}) must be in range 0..10. Set to 1.", _int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]); + _int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1; } - m_int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = sConfigMgr->GetOption("CharacterCreating.MinLevelForHeroicCharacter", 55); + _int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = sConfigMgr->GetOption("CharacterCreating.MinLevelForHeroicCharacter", 55); - m_int_configs[CONFIG_SKIP_CINEMATICS] = sConfigMgr->GetOption("SkipCinematics", 0); - if (int32(m_int_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_int_configs[CONFIG_SKIP_CINEMATICS] > 2) + _int_configs[CONFIG_SKIP_CINEMATICS] = sConfigMgr->GetOption("SkipCinematics", 0); + if (int32(_int_configs[CONFIG_SKIP_CINEMATICS]) < 0 || _int_configs[CONFIG_SKIP_CINEMATICS] > 2) { - LOG_ERROR("server.loading", "SkipCinematics ({}) must be in range 0..2. Set to 0.", m_int_configs[CONFIG_SKIP_CINEMATICS]); - m_int_configs[CONFIG_SKIP_CINEMATICS] = 0; + LOG_ERROR("server.loading", "SkipCinematics ({}) must be in range 0..2. Set to 0.", _int_configs[CONFIG_SKIP_CINEMATICS]); + _int_configs[CONFIG_SKIP_CINEMATICS] = 0; } if (reload) { uint32 val = sConfigMgr->GetOption("MaxPlayerLevel", DEFAULT_MAX_LEVEL); - if (val != m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) - LOG_ERROR("server.loading", "MaxPlayerLevel option can't be changed at config reload, using current value ({}).", m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); + if (val != _int_configs[CONFIG_MAX_PLAYER_LEVEL]) + LOG_ERROR("server.loading", "MaxPlayerLevel option can't be changed at config reload, using current value ({}).", _int_configs[CONFIG_MAX_PLAYER_LEVEL]); } else - m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfigMgr->GetOption("MaxPlayerLevel", DEFAULT_MAX_LEVEL); + _int_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfigMgr->GetOption("MaxPlayerLevel", DEFAULT_MAX_LEVEL); - if (m_int_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL || m_int_configs[CONFIG_MAX_PLAYER_LEVEL] < 1) + if (_int_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL || _int_configs[CONFIG_MAX_PLAYER_LEVEL] < 1) { - LOG_ERROR("server.loading", "MaxPlayerLevel ({}) must be in range 1..{}. Set to {}.", m_int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL); - m_int_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL; + LOG_ERROR("server.loading", "MaxPlayerLevel ({}) must be in range 1..{}. Set to {}.", _int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL); + _int_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL; } - m_int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfigMgr->GetOption("MinDualSpecLevel", 40); + _int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfigMgr->GetOption("MinDualSpecLevel", 40); - m_int_configs[CONFIG_START_PLAYER_LEVEL] = sConfigMgr->GetOption("StartPlayerLevel", 1); - if (m_int_configs[CONFIG_START_PLAYER_LEVEL] < 1 || m_int_configs[CONFIG_START_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) + _int_configs[CONFIG_START_PLAYER_LEVEL] = sConfigMgr->GetOption("StartPlayerLevel", 1); + if (_int_configs[CONFIG_START_PLAYER_LEVEL] < 1 || _int_configs[CONFIG_START_PLAYER_LEVEL] > _int_configs[CONFIG_MAX_PLAYER_LEVEL]) { - LOG_ERROR("server.loading", "StartPlayerLevel ({}) must be in range 1..MaxPlayerLevel({}). Set to 1.", m_int_configs[CONFIG_START_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); - m_int_configs[CONFIG_START_PLAYER_LEVEL] = 1; + LOG_ERROR("server.loading", "StartPlayerLevel ({}) must be in range 1..MaxPlayerLevel({}). Set to 1.", _int_configs[CONFIG_START_PLAYER_LEVEL], _int_configs[CONFIG_MAX_PLAYER_LEVEL]); + _int_configs[CONFIG_START_PLAYER_LEVEL] = 1; } - m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfigMgr->GetOption("StartHeroicPlayerLevel", 55); - if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1 || m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL]) + _int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfigMgr->GetOption("StartHeroicPlayerLevel", 55); + if (_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1 || _int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > _int_configs[CONFIG_MAX_PLAYER_LEVEL]) { LOG_ERROR("server.loading", "StartHeroicPlayerLevel ({}) must be in range 1..MaxPlayerLevel({}). Set to 55.", - m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]); - m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55; + _int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], _int_configs[CONFIG_MAX_PLAYER_LEVEL]); + _int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55; } - m_int_configs[CONFIG_START_PLAYER_MONEY] = sConfigMgr->GetOption("StartPlayerMoney", 0); - if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0 || int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) > MAX_MONEY_AMOUNT) + _int_configs[CONFIG_START_PLAYER_MONEY] = sConfigMgr->GetOption("StartPlayerMoney", 0); + if (int32(_int_configs[CONFIG_START_PLAYER_MONEY]) < 0 || int32(_int_configs[CONFIG_START_PLAYER_MONEY]) > MAX_MONEY_AMOUNT) { - LOG_ERROR("server.loading", "StartPlayerMoney ({}) must be in range 0..{}. Set to {}.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); - m_int_configs[CONFIG_START_PLAYER_MONEY] = 0; + LOG_ERROR("server.loading", "StartPlayerMoney ({}) must be in range 0..{}. Set to {}.", _int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0); + _int_configs[CONFIG_START_PLAYER_MONEY] = 0; } - m_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY] = sConfigMgr->GetOption("StartHeroicPlayerMoney", 2000); - if (int32(m_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY]) < 0 || int32(m_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY]) > MAX_MONEY_AMOUNT) + _int_configs[CONFIG_START_HEROIC_PLAYER_MONEY] = sConfigMgr->GetOption("StartHeroicPlayerMoney", 2000); + if (int32(_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY]) < 0 || int32(_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY]) > MAX_MONEY_AMOUNT) { - LOG_ERROR("server.loading", "StartHeroicPlayerMoney ({}) must be in range 0..{}. Set to {}.", m_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY], MAX_MONEY_AMOUNT, 2000); - m_int_configs[CONFIG_START_HEROIC_PLAYER_MONEY] = 2000; + LOG_ERROR("server.loading", "StartHeroicPlayerMoney ({}) must be in range 0..{}. Set to {}.", _int_configs[CONFIG_START_HEROIC_PLAYER_MONEY], MAX_MONEY_AMOUNT, 2000); + _int_configs[CONFIG_START_HEROIC_PLAYER_MONEY] = 2000; } - m_int_configs[CONFIG_MAX_HONOR_POINTS] = sConfigMgr->GetOption("MaxHonorPoints", 75000); - if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0) + _int_configs[CONFIG_MAX_HONOR_POINTS] = sConfigMgr->GetOption("MaxHonorPoints", 75000); + if (int32(_int_configs[CONFIG_MAX_HONOR_POINTS]) < 0) { - LOG_ERROR("server.loading", "MaxHonorPoints ({}) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS]); - m_int_configs[CONFIG_MAX_HONOR_POINTS] = 0; + LOG_ERROR("server.loading", "MaxHonorPoints ({}) can't be negative. Set to 0.", _int_configs[CONFIG_MAX_HONOR_POINTS]); + _int_configs[CONFIG_MAX_HONOR_POINTS] = 0; } - m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = sConfigMgr->GetOption("MaxHonorPointsMoneyPerPoint", 0); - if (int32(m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]) < 0) + _int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = sConfigMgr->GetOption("MaxHonorPointsMoneyPerPoint", 0); + if (int32(_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]) < 0) { - LOG_ERROR("server.loading", "MaxHonorPointsMoneyPerPoint ({}) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]); - m_int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = 0; + LOG_ERROR("server.loading", "MaxHonorPointsMoneyPerPoint ({}) can't be negative. Set to 0.", _int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]); + _int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = 0; } - m_int_configs[CONFIG_START_HONOR_POINTS] = sConfigMgr->GetOption("StartHonorPoints", 0); - if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0 || int32(m_int_configs[CONFIG_START_HONOR_POINTS]) > int32(m_int_configs[CONFIG_MAX_HONOR_POINTS])) + _int_configs[CONFIG_START_HONOR_POINTS] = sConfigMgr->GetOption("StartHonorPoints", 0); + if (int32(_int_configs[CONFIG_START_HONOR_POINTS]) < 0 || int32(_int_configs[CONFIG_START_HONOR_POINTS]) > int32(_int_configs[CONFIG_MAX_HONOR_POINTS])) { LOG_ERROR("server.loading", "StartHonorPoints ({}) must be in range 0..MaxHonorPoints({}). Set to {}.", - m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0); - m_int_configs[CONFIG_START_HONOR_POINTS] = 0; + _int_configs[CONFIG_START_HONOR_POINTS], _int_configs[CONFIG_MAX_HONOR_POINTS], 0); + _int_configs[CONFIG_START_HONOR_POINTS] = 0; } - m_int_configs[CONFIG_MAX_ARENA_POINTS] = sConfigMgr->GetOption("MaxArenaPoints", 10000); - if (int32(m_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0) + _int_configs[CONFIG_MAX_ARENA_POINTS] = sConfigMgr->GetOption("MaxArenaPoints", 10000); + if (int32(_int_configs[CONFIG_MAX_ARENA_POINTS]) < 0) { - LOG_ERROR("server.loading", "MaxArenaPoints ({}) can't be negative. Set to 0.", m_int_configs[CONFIG_MAX_ARENA_POINTS]); - m_int_configs[CONFIG_MAX_ARENA_POINTS] = 0; + LOG_ERROR("server.loading", "MaxArenaPoints ({}) can't be negative. Set to 0.", _int_configs[CONFIG_MAX_ARENA_POINTS]); + _int_configs[CONFIG_MAX_ARENA_POINTS] = 0; } - m_int_configs[CONFIG_START_ARENA_POINTS] = sConfigMgr->GetOption("StartArenaPoints", 0); - if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0 || int32(m_int_configs[CONFIG_START_ARENA_POINTS]) > int32(m_int_configs[CONFIG_MAX_ARENA_POINTS])) + _int_configs[CONFIG_START_ARENA_POINTS] = sConfigMgr->GetOption("StartArenaPoints", 0); + if (int32(_int_configs[CONFIG_START_ARENA_POINTS]) < 0 || int32(_int_configs[CONFIG_START_ARENA_POINTS]) > int32(_int_configs[CONFIG_MAX_ARENA_POINTS])) { LOG_ERROR("server.loading", "StartArenaPoints ({}) must be in range 0..MaxArenaPoints({}). Set to {}.", - m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0); - m_int_configs[CONFIG_START_ARENA_POINTS] = 0; + _int_configs[CONFIG_START_ARENA_POINTS], _int_configs[CONFIG_MAX_ARENA_POINTS], 0); + _int_configs[CONFIG_START_ARENA_POINTS] = 0; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetOption("RecruitAFriend.MaxLevel", 60); - if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL] - || int32(m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL]) < 0) + _int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetOption("RecruitAFriend.MaxLevel", 60); + if (_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > _int_configs[CONFIG_MAX_PLAYER_LEVEL] + || int32(_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL]) < 0) { LOG_ERROR("server.loading", "RecruitAFriend.MaxLevel ({}) must be in the range 0..MaxLevel({}). Set to {}.", - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 60); - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60; + _int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL], _int_configs[CONFIG_MAX_PLAYER_LEVEL], 60); + _int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60; } - m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfigMgr->GetOption("RecruitAFriend.MaxDifference", 4); - m_bool_configs[CONFIG_ALL_TAXI_PATHS] = sConfigMgr->GetOption("AllFlightPaths", false); - m_int_configs[CONFIG_INSTANT_TAXI] = sConfigMgr->GetOption("InstantFlightPaths", 0); + _int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfigMgr->GetOption("RecruitAFriend.MaxDifference", 4); + _bool_configs[CONFIG_ALL_TAXI_PATHS] = sConfigMgr->GetOption("AllFlightPaths", false); + _int_configs[CONFIG_INSTANT_TAXI] = sConfigMgr->GetOption("InstantFlightPaths", 0); - m_bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfigMgr->GetOption("Instance.IgnoreLevel", false); - m_bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetOption("Instance.IgnoreRaid", false); - m_bool_configs[CONFIG_INSTANCE_GMSUMMON_PLAYER] = sConfigMgr->GetOption("Instance.GMSummonPlayer", false); - m_bool_configs[CONFIG_INSTANCE_SHARED_ID] = sConfigMgr->GetOption("Instance.SharedNormalHeroicId", false); + _bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfigMgr->GetOption("Instance.IgnoreLevel", false); + _bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetOption("Instance.IgnoreRaid", false); + _bool_configs[CONFIG_INSTANCE_GMSUMMON_PLAYER] = sConfigMgr->GetOption("Instance.GMSummonPlayer", false); + _bool_configs[CONFIG_INSTANCE_SHARED_ID] = sConfigMgr->GetOption("Instance.SharedNormalHeroicId", false); - m_int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetOption("Instance.ResetTimeHour", 4); - m_int_configs[CONFIG_INSTANCE_RESET_TIME_RELATIVE_TIMESTAMP] = sConfigMgr->GetOption("Instance.ResetTimeRelativeTimestamp", 1135814400); - m_int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfigMgr->GetOption("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); + _int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetOption("Instance.ResetTimeHour", 4); + _int_configs[CONFIG_INSTANCE_RESET_TIME_RELATIVE_TIMESTAMP] = sConfigMgr->GetOption("Instance.ResetTimeRelativeTimestamp", 1135814400); + _int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfigMgr->GetOption("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfigMgr->GetOption("MaxPrimaryTradeSkill", 2); - m_int_configs[CONFIG_MIN_PETITION_SIGNS] = sConfigMgr->GetOption("MinPetitionSigns", 9); - if (m_int_configs[CONFIG_MIN_PETITION_SIGNS] > 9 || int32(m_int_configs[CONFIG_MIN_PETITION_SIGNS]) < 0) + _int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfigMgr->GetOption("MaxPrimaryTradeSkill", 2); + _int_configs[CONFIG_MIN_PETITION_SIGNS] = sConfigMgr->GetOption("MinPetitionSigns", 9); + if (_int_configs[CONFIG_MIN_PETITION_SIGNS] > 9 || int32(_int_configs[CONFIG_MIN_PETITION_SIGNS]) < 0) { - LOG_ERROR("server.loading", "MinPetitionSigns ({}) must be in range 0..9. Set to 9.", m_int_configs[CONFIG_MIN_PETITION_SIGNS]); - m_int_configs[CONFIG_MIN_PETITION_SIGNS] = 9; + LOG_ERROR("server.loading", "MinPetitionSigns ({}) must be in range 0..9. Set to 9.", _int_configs[CONFIG_MIN_PETITION_SIGNS]); + _int_configs[CONFIG_MIN_PETITION_SIGNS] = 9; } - m_int_configs[CONFIG_GM_LOGIN_STATE] = sConfigMgr->GetOption("GM.LoginState", 2); - m_int_configs[CONFIG_GM_VISIBLE_STATE] = sConfigMgr->GetOption("GM.Visible", 2); - m_int_configs[CONFIG_GM_CHAT] = sConfigMgr->GetOption("GM.Chat", 2); - m_int_configs[CONFIG_GM_WHISPERING_TO] = sConfigMgr->GetOption("GM.WhisperingTo", 2); + _int_configs[CONFIG_GM_LOGIN_STATE] = sConfigMgr->GetOption("GM.LoginState", 2); + _int_configs[CONFIG_GM_VISIBLE_STATE] = sConfigMgr->GetOption("GM.Visible", 2); + _int_configs[CONFIG_GM_CHAT] = sConfigMgr->GetOption("GM.Chat", 2); + _int_configs[CONFIG_GM_WHISPERING_TO] = sConfigMgr->GetOption("GM.WhisperingTo", 2); - m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfigMgr->GetOption("GM.InGMList.Level", SEC_ADMINISTRATOR); - m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfigMgr->GetOption("GM.InWhoList.Level", SEC_ADMINISTRATOR); - m_int_configs[CONFIG_START_GM_LEVEL] = sConfigMgr->GetOption("GM.StartLevel", 1); - if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL]) + _int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfigMgr->GetOption("GM.InGMList.Level", SEC_ADMINISTRATOR); + _int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfigMgr->GetOption("GM.InWhoList.Level", SEC_ADMINISTRATOR); + _int_configs[CONFIG_START_GM_LEVEL] = sConfigMgr->GetOption("GM.StartLevel", 1); + if (_int_configs[CONFIG_START_GM_LEVEL] < _int_configs[CONFIG_START_PLAYER_LEVEL]) { LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range StartPlayerLevel({})..{}. Set to {}.", - m_int_configs[CONFIG_START_GM_LEVEL], m_int_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, m_int_configs[CONFIG_START_PLAYER_LEVEL]); - m_int_configs[CONFIG_START_GM_LEVEL] = m_int_configs[CONFIG_START_PLAYER_LEVEL]; + _int_configs[CONFIG_START_GM_LEVEL], _int_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, _int_configs[CONFIG_START_PLAYER_LEVEL]); + _int_configs[CONFIG_START_GM_LEVEL] = _int_configs[CONFIG_START_PLAYER_LEVEL]; } - else if (m_int_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL) + else if (_int_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL) { - LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range 1..{}. Set to {}.", m_int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL); - m_int_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL; + LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range 1..{}. Set to {}.", _int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL); + _int_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL; } - m_bool_configs[CONFIG_ALLOW_GM_GROUP] = sConfigMgr->GetOption("GM.AllowInvite", false); - m_bool_configs[CONFIG_ALLOW_GM_FRIEND] = sConfigMgr->GetOption("GM.AllowFriend", false); - m_bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfigMgr->GetOption("GM.LowerSecurity", false); - m_float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfigMgr->GetOption("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); + _bool_configs[CONFIG_ALLOW_GM_GROUP] = sConfigMgr->GetOption("GM.AllowInvite", false); + _bool_configs[CONFIG_ALLOW_GM_FRIEND] = sConfigMgr->GetOption("GM.AllowFriend", false); + _bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfigMgr->GetOption("GM.LowerSecurity", false); + _float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfigMgr->GetOption("GM.TicketSystem.ChanceOfGMSurvey", 50.0f); - m_int_configs[CONFIG_GROUP_VISIBILITY] = sConfigMgr->GetOption("Visibility.GroupMode", 1); + _int_configs[CONFIG_GROUP_VISIBILITY] = sConfigMgr->GetOption("Visibility.GroupMode", 1); - m_bool_configs[CONFIG_OBJECT_SPARKLES] = sConfigMgr->GetOption("Visibility.ObjectSparkles", true); + _bool_configs[CONFIG_OBJECT_SPARKLES] = sConfigMgr->GetOption("Visibility.ObjectSparkles", true); - m_bool_configs[CONFIG_LOW_LEVEL_REGEN_BOOST] = sConfigMgr->GetOption("EnableLowLevelRegenBoost", true); + _bool_configs[CONFIG_LOW_LEVEL_REGEN_BOOST] = sConfigMgr->GetOption("EnableLowLevelRegenBoost", true); - m_bool_configs[CONFIG_OBJECT_QUEST_MARKERS] = sConfigMgr->GetOption("Visibility.ObjectQuestMarkers", true); + _bool_configs[CONFIG_OBJECT_QUEST_MARKERS] = sConfigMgr->GetOption("Visibility.ObjectQuestMarkers", true); - m_int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfigMgr->GetOption("MailDeliveryDelay", HOUR); + _int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfigMgr->GetOption("MailDeliveryDelay", HOUR); - m_int_configs[CONFIG_UPTIME_UPDATE] = sConfigMgr->GetOption("UpdateUptimeInterval", 10); - if (int32(m_int_configs[CONFIG_UPTIME_UPDATE]) <= 0) + _int_configs[CONFIG_UPTIME_UPDATE] = sConfigMgr->GetOption("UpdateUptimeInterval", 10); + if (int32(_int_configs[CONFIG_UPTIME_UPDATE]) <= 0) { - LOG_ERROR("server.loading", "UpdateUptimeInterval ({}) must be > 0, set to default 10.", m_int_configs[CONFIG_UPTIME_UPDATE]); - m_int_configs[CONFIG_UPTIME_UPDATE] = 1; + LOG_ERROR("server.loading", "UpdateUptimeInterval ({}) must be > 0, set to default 10.", _int_configs[CONFIG_UPTIME_UPDATE]); + _int_configs[CONFIG_UPTIME_UPDATE] = 1; } if (reload) { - m_timers[WUPDATE_UPTIME].SetInterval(m_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE * IN_MILLISECONDS); - m_timers[WUPDATE_UPTIME].Reset(); + _timers[WUPDATE_UPTIME].SetInterval(_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_UPTIME].Reset(); } // log db cleanup interval - m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfigMgr->GetOption("LogDB.Opt.ClearInterval", 10); - if (int32(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0) + _int_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfigMgr->GetOption("LogDB.Opt.ClearInterval", 10); + if (int32(_int_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0) { - LOG_ERROR("server.loading", "LogDB.Opt.ClearInterval ({}) must be > 0, set to default 10.", m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]); - m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] = 10; + LOG_ERROR("server.loading", "LogDB.Opt.ClearInterval ({}) must be > 0, set to default 10.", _int_configs[CONFIG_LOGDB_CLEARINTERVAL]); + _int_configs[CONFIG_LOGDB_CLEARINTERVAL] = 10; } if (reload) { - m_timers[WUPDATE_CLEANDB].SetInterval(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILLISECONDS); - m_timers[WUPDATE_CLEANDB].Reset(); + _timers[WUPDATE_CLEANDB].SetInterval(_int_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_CLEANDB].Reset(); } - m_int_configs[CONFIG_LOGDB_CLEARTIME] = sConfigMgr->GetOption("LogDB.Opt.ClearTime", 1209600); // 14 days default + _int_configs[CONFIG_LOGDB_CLEARTIME] = sConfigMgr->GetOption("LogDB.Opt.ClearTime", 1209600); // 14 days default LOG_INFO("server.loading", "Will clear `logs` table of entries older than {} seconds every {} minutes.", - m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]); + _int_configs[CONFIG_LOGDB_CLEARTIME], _int_configs[CONFIG_LOGDB_CLEARINTERVAL]); - m_int_configs[CONFIG_TELEPORT_TIMEOUT_NEAR] = sConfigMgr->GetOption("TeleportTimeoutNear", 25); // pussywizard - m_int_configs[CONFIG_TELEPORT_TIMEOUT_FAR] = sConfigMgr->GetOption("TeleportTimeoutFar", 45); // pussywizard - m_int_configs[CONFIG_MAX_ALLOWED_MMR_DROP] = sConfigMgr->GetOption("MaxAllowedMMRDrop", 500); // pussywizard - m_bool_configs[CONFIG_ENABLE_LOGIN_AFTER_DC] = sConfigMgr->GetOption("EnableLoginAfterDC", true); // pussywizard - m_bool_configs[CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS] = sConfigMgr->GetOption("DontCacheRandomMovementPaths", true); // pussywizard + _int_configs[CONFIG_TELEPORT_TIMEOUT_NEAR] = sConfigMgr->GetOption("TeleportTimeoutNear", 25); // pussywizard + _int_configs[CONFIG_TELEPORT_TIMEOUT_FAR] = sConfigMgr->GetOption("TeleportTimeoutFar", 45); // pussywizard + _int_configs[CONFIG_MAX_ALLOWED_MMR_DROP] = sConfigMgr->GetOption("MaxAllowedMMRDrop", 500); // pussywizard + _bool_configs[CONFIG_ENABLE_LOGIN_AFTER_DC] = sConfigMgr->GetOption("EnableLoginAfterDC", true); // pussywizard + _bool_configs[CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS] = sConfigMgr->GetOption("DontCacheRandomMovementPaths", true); // pussywizard - m_int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfigMgr->GetOption("SkillChance.Orange", 100); - m_int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfigMgr->GetOption("SkillChance.Yellow", 75); - m_int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfigMgr->GetOption("SkillChance.Green", 25); - m_int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfigMgr->GetOption("SkillChance.Grey", 0); + _int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfigMgr->GetOption("SkillChance.Orange", 100); + _int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfigMgr->GetOption("SkillChance.Yellow", 75); + _int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfigMgr->GetOption("SkillChance.Green", 25); + _int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfigMgr->GetOption("SkillChance.Grey", 0); - m_int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfigMgr->GetOption("SkillChance.MiningSteps", 75); - m_int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfigMgr->GetOption("SkillChance.SkinningSteps", 75); + _int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfigMgr->GetOption("SkillChance.MiningSteps", 75); + _int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfigMgr->GetOption("SkillChance.SkinningSteps", 75); - m_bool_configs[CONFIG_SKILL_PROSPECTING] = sConfigMgr->GetOption("SkillChance.Prospecting", false); - m_bool_configs[CONFIG_SKILL_MILLING] = sConfigMgr->GetOption("SkillChance.Milling", false); + _bool_configs[CONFIG_SKILL_PROSPECTING] = sConfigMgr->GetOption("SkillChance.Prospecting", false); + _bool_configs[CONFIG_SKILL_MILLING] = sConfigMgr->GetOption("SkillChance.Milling", false); - m_int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfigMgr->GetOption("SkillGain.Crafting", 1); + _int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfigMgr->GetOption("SkillGain.Crafting", 1); - m_int_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfigMgr->GetOption("SkillGain.Defense", 1); + _int_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfigMgr->GetOption("SkillGain.Defense", 1); - m_int_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfigMgr->GetOption("SkillGain.Gathering", 1); + _int_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfigMgr->GetOption("SkillGain.Gathering", 1); - m_int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfigMgr->GetOption("SkillGain.Weapon", 1); + _int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfigMgr->GetOption("SkillGain.Weapon", 1); - m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfigMgr->GetOption("MaxOverspeedPings", 2); - if (m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2) + _int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfigMgr->GetOption("MaxOverspeedPings", 2); + if (_int_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && _int_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2) { - LOG_ERROR("server.loading", "MaxOverspeedPings ({}) must be in range 2..infinity (or 0 to disable check). Set to 2.", m_int_configs[CONFIG_MAX_OVERSPEED_PINGS]); - m_int_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2; + LOG_ERROR("server.loading", "MaxOverspeedPings ({}) must be in range 2..infinity (or 0 to disable check). Set to 2.", _int_configs[CONFIG_MAX_OVERSPEED_PINGS]); + _int_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2; } - m_bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfigMgr->GetOption("SaveRespawnTimeImmediately", true); - m_bool_configs[CONFIG_WEATHER] = sConfigMgr->GetOption("ActivateWeather", true); + _bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfigMgr->GetOption("SaveRespawnTimeImmediately", true); + _bool_configs[CONFIG_WEATHER] = sConfigMgr->GetOption("ActivateWeather", true); - m_int_configs[CONFIG_DISABLE_BREATHING] = sConfigMgr->GetOption("DisableWaterBreath", SEC_CONSOLE); + _int_configs[CONFIG_DISABLE_BREATHING] = sConfigMgr->GetOption("DisableWaterBreath", SEC_CONSOLE); - m_bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfigMgr->GetOption("AlwaysMaxSkillForLevel", false); + _bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfigMgr->GetOption("AlwaysMaxSkillForLevel", false); if (reload) { uint32 val = sConfigMgr->GetOption("Expansion", 2); - if (val != m_int_configs[CONFIG_EXPANSION]) - LOG_ERROR("server.loading", "Expansion option can't be changed at worldserver.conf reload, using current value ({}).", m_int_configs[CONFIG_EXPANSION]); + if (val != _int_configs[CONFIG_EXPANSION]) + LOG_ERROR("server.loading", "Expansion option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_EXPANSION]); } else - m_int_configs[CONFIG_EXPANSION] = sConfigMgr->GetOption("Expansion", 2); + _int_configs[CONFIG_EXPANSION] = sConfigMgr->GetOption("Expansion", 2); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfigMgr->GetOption("ChatFlood.MessageCount", 10); - m_int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfigMgr->GetOption("ChatFlood.MessageDelay", 1); - m_int_configs[CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT] = sConfigMgr->GetOption("ChatFlood.AddonMessageCount", 100); - m_int_configs[CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY] = sConfigMgr->GetOption("ChatFlood.AddonMessageDelay", 1); - m_int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfigMgr->GetOption("ChatFlood.MuteTime", 10); - m_bool_configs[CONFIG_CHAT_MUTE_FIRST_LOGIN] = sConfigMgr->GetOption("Chat.MuteFirstLogin", false); - m_int_configs[CONFIG_CHAT_TIME_MUTE_FIRST_LOGIN] = sConfigMgr->GetOption("Chat.MuteTimeFirstLogin", 120); + _int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfigMgr->GetOption("ChatFlood.MessageCount", 10); + _int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfigMgr->GetOption("ChatFlood.MessageDelay", 1); + _int_configs[CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT] = sConfigMgr->GetOption("ChatFlood.AddonMessageCount", 100); + _int_configs[CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY] = sConfigMgr->GetOption("ChatFlood.AddonMessageDelay", 1); + _int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfigMgr->GetOption("ChatFlood.MuteTime", 10); + _bool_configs[CONFIG_CHAT_MUTE_FIRST_LOGIN] = sConfigMgr->GetOption("Chat.MuteFirstLogin", false); + _int_configs[CONFIG_CHAT_TIME_MUTE_FIRST_LOGIN] = sConfigMgr->GetOption("Chat.MuteTimeFirstLogin", 120); - m_int_configs[CONFIG_EVENT_ANNOUNCE] = sConfigMgr->GetOption("Event.Announce", 0); + _int_configs[CONFIG_EVENT_ANNOUNCE] = sConfigMgr->GetOption("Event.Announce", 0); - m_float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfigMgr->GetOption("CreatureFamilyFleeAssistanceRadius", 30.0f); - m_float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfigMgr->GetOption("CreatureFamilyAssistanceRadius", 10.0f); - m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfigMgr->GetOption("CreatureFamilyAssistanceDelay", 2000); - m_int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD] = sConfigMgr->GetOption("CreatureFamilyAssistancePeriod", 3000); - m_int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfigMgr->GetOption("CreatureFamilyFleeDelay", 7000); + _float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfigMgr->GetOption("CreatureFamilyFleeAssistanceRadius", 30.0f); + _float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfigMgr->GetOption("CreatureFamilyAssistanceRadius", 10.0f); + _int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfigMgr->GetOption("CreatureFamilyAssistanceDelay", 2000); + _int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD] = sConfigMgr->GetOption("CreatureFamilyAssistancePeriod", 3000); + _int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfigMgr->GetOption("CreatureFamilyFleeDelay", 7000); - m_int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfigMgr->GetOption("WorldBossLevelDiff", 3); + _int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfigMgr->GetOption("WorldBossLevelDiff", 3); - m_bool_configs[CONFIG_QUEST_ENABLE_QUEST_TRACKER] = sConfigMgr->GetOption("Quests.EnableQuestTracker", false); + _bool_configs[CONFIG_QUEST_ENABLE_QUEST_TRACKER] = sConfigMgr->GetOption("Quests.EnableQuestTracker", false); // note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100) - m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfigMgr->GetOption("Quests.LowLevelHideDiff", 4); - if (m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL) - m_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = MAX_LEVEL; - m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfigMgr->GetOption("Quests.HighLevelHideDiff", 7); - if (m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL) - m_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL; - m_bool_configs[CONFIG_QUEST_IGNORE_RAID] = sConfigMgr->GetOption("Quests.IgnoreRaid", false); - m_bool_configs[CONFIG_QUEST_IGNORE_AUTO_ACCEPT] = sConfigMgr->GetOption("Quests.IgnoreAutoAccept", false); - m_bool_configs[CONFIG_QUEST_IGNORE_AUTO_COMPLETE] = sConfigMgr->GetOption("Quests.IgnoreAutoComplete", false); + _int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfigMgr->GetOption("Quests.LowLevelHideDiff", 4); + if (_int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL) + _int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = MAX_LEVEL; + _int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfigMgr->GetOption("Quests.HighLevelHideDiff", 7); + if (_int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL) + _int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL; + _bool_configs[CONFIG_QUEST_IGNORE_RAID] = sConfigMgr->GetOption("Quests.IgnoreRaid", false); + _bool_configs[CONFIG_QUEST_IGNORE_AUTO_ACCEPT] = sConfigMgr->GetOption("Quests.IgnoreAutoAccept", false); + _bool_configs[CONFIG_QUEST_IGNORE_AUTO_COMPLETE] = sConfigMgr->GetOption("Quests.IgnoreAutoComplete", false); - m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfigMgr->GetOption("Battleground.Random.ResetHour", 6); - if (m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23) + _int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfigMgr->GetOption("Battleground.Random.ResetHour", 6); + if (_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] > 23) { - LOG_ERROR("server.loading", "Battleground.Random.ResetHour ({}) can't be load. Set to 6.", m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR]); - m_int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6; + LOG_ERROR("server.loading", "Battleground.Random.ResetHour ({}) can't be load. Set to 6.", _int_configs[CONFIG_RANDOM_BG_RESET_HOUR]); + _int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = 6; } - m_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] = sConfigMgr->GetOption("Calendar.DeleteOldEventsHour", 6); - if (m_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] > 23 || int32(m_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR]) < 0) + _int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] = sConfigMgr->GetOption("Calendar.DeleteOldEventsHour", 6); + if (_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] > 23 || int32(_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR]) < 0) { - LOG_ERROR("server.loading", "Calendar.DeleteOldEventsHour ({}) can't be load. Set to 6.", m_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR]); - m_int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] = 6; + LOG_ERROR("server.loading", "Calendar.DeleteOldEventsHour ({}) can't be load. Set to 6.", _int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR]); + _int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] = 6; } - m_int_configs[CONFIG_GUILD_RESET_HOUR] = sConfigMgr->GetOption("Guild.ResetHour", 6); - if (m_int_configs[CONFIG_GUILD_RESET_HOUR] > 23) + _int_configs[CONFIG_GUILD_RESET_HOUR] = sConfigMgr->GetOption("Guild.ResetHour", 6); + if (_int_configs[CONFIG_GUILD_RESET_HOUR] > 23) { - LOG_ERROR("server.loading", "Guild.ResetHour ({}) can't be load. Set to 6.", m_int_configs[CONFIG_GUILD_RESET_HOUR]); - m_int_configs[CONFIG_GUILD_RESET_HOUR] = 6; + LOG_ERROR("server.loading", "Guild.ResetHour ({}) can't be load. Set to 6.", _int_configs[CONFIG_GUILD_RESET_HOUR]); + _int_configs[CONFIG_GUILD_RESET_HOUR] = 6; } - m_int_configs[CONFIG_GUILD_BANK_INITIAL_TABS] = sConfigMgr->GetOption("Guild.BankInitialTabs", 0); - m_int_configs[CONFIG_GUILD_BANK_TAB_COST_0] = sConfigMgr->GetOption("Guild.BankTabCost0", 1000000); - m_int_configs[CONFIG_GUILD_BANK_TAB_COST_1] = sConfigMgr->GetOption("Guild.BankTabCost1", 2500000); - m_int_configs[CONFIG_GUILD_BANK_TAB_COST_2] = sConfigMgr->GetOption("Guild.BankTabCost2", 5000000); - m_int_configs[CONFIG_GUILD_BANK_TAB_COST_3] = sConfigMgr->GetOption("Guild.BankTabCost3", 10000000); - m_int_configs[CONFIG_GUILD_BANK_TAB_COST_4] = sConfigMgr->GetOption("Guild.BankTabCost4", 25000000); - m_int_configs[CONFIG_GUILD_BANK_TAB_COST_5] = sConfigMgr->GetOption("Guild.BankTabCost5", 50000000); + _int_configs[CONFIG_GUILD_BANK_INITIAL_TABS] = sConfigMgr->GetOption("Guild.BankInitialTabs", 0); + _int_configs[CONFIG_GUILD_BANK_TAB_COST_0] = sConfigMgr->GetOption("Guild.BankTabCost0", 1000000); + _int_configs[CONFIG_GUILD_BANK_TAB_COST_1] = sConfigMgr->GetOption("Guild.BankTabCost1", 2500000); + _int_configs[CONFIG_GUILD_BANK_TAB_COST_2] = sConfigMgr->GetOption("Guild.BankTabCost2", 5000000); + _int_configs[CONFIG_GUILD_BANK_TAB_COST_3] = sConfigMgr->GetOption("Guild.BankTabCost3", 10000000); + _int_configs[CONFIG_GUILD_BANK_TAB_COST_4] = sConfigMgr->GetOption("Guild.BankTabCost4", 25000000); + _int_configs[CONFIG_GUILD_BANK_TAB_COST_5] = sConfigMgr->GetOption("Guild.BankTabCost5", 50000000); - m_bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfigMgr->GetOption("DetectPosCollision", true); + _bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfigMgr->GetOption("DetectPosCollision", true); - m_bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfigMgr->GetOption("Channel.RestrictedLfg", true); - m_bool_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = sConfigMgr->GetOption("Channel.SilentlyGMJoin", false); + _bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfigMgr->GetOption("Channel.RestrictedLfg", true); + _bool_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = sConfigMgr->GetOption("Channel.SilentlyGMJoin", false); - m_bool_configs[CONFIG_TALENTS_INSPECTING] = sConfigMgr->GetOption("TalentsInspecting", true); - m_bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfigMgr->GetOption("ChatFakeMessagePreventing", false); - m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfigMgr->GetOption("ChatStrictLinkChecking.Severity", 0); - m_int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfigMgr->GetOption("ChatStrictLinkChecking.Kick", 0); + _bool_configs[CONFIG_TALENTS_INSPECTING] = sConfigMgr->GetOption("TalentsInspecting", true); + _bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfigMgr->GetOption("ChatFakeMessagePreventing", false); + _int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfigMgr->GetOption("ChatStrictLinkChecking.Severity", 0); + _int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfigMgr->GetOption("ChatStrictLinkChecking.Kick", 0); - m_int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfigMgr->GetOption("Corpse.Decay.NORMAL", 60); - m_int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfigMgr->GetOption("Corpse.Decay.RARE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfigMgr->GetOption("Corpse.Decay.ELITE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfigMgr->GetOption("Corpse.Decay.RAREELITE", 300); - m_int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfigMgr->GetOption("Corpse.Decay.WORLDBOSS", 3600); + _int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfigMgr->GetOption("Corpse.Decay.NORMAL", 60); + _int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfigMgr->GetOption("Corpse.Decay.RARE", 300); + _int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfigMgr->GetOption("Corpse.Decay.ELITE", 300); + _int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfigMgr->GetOption("Corpse.Decay.RAREELITE", 300); + _int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfigMgr->GetOption("Corpse.Decay.WORLDBOSS", 3600); - m_int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfigMgr->GetOption ("Death.SicknessLevel", 11); - m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfigMgr->GetOption("Death.CorpseReclaimDelay.PvP", true); - m_bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfigMgr->GetOption("Death.CorpseReclaimDelay.PvE", true); - m_bool_configs[CONFIG_DEATH_BONES_WORLD] = sConfigMgr->GetOption("Death.Bones.World", true); - m_bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfigMgr->GetOption("Death.Bones.BattlegroundOrArena", true); + _int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfigMgr->GetOption ("Death.SicknessLevel", 11); + _bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfigMgr->GetOption("Death.CorpseReclaimDelay.PvP", true); + _bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfigMgr->GetOption("Death.CorpseReclaimDelay.PvE", true); + _bool_configs[CONFIG_DEATH_BONES_WORLD] = sConfigMgr->GetOption("Death.Bones.World", true); + _bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfigMgr->GetOption("Death.Bones.BattlegroundOrArena", true); - m_bool_configs[CONFIG_DIE_COMMAND_MODE] = sConfigMgr->GetOption("Die.Command.Mode", true); + _bool_configs[CONFIG_DIE_COMMAND_MODE] = sConfigMgr->GetOption("Die.Command.Mode", true); // always use declined names in the russian client - m_bool_configs[CONFIG_DECLINED_NAMES_USED] = - (m_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfigMgr->GetOption("DeclinedNames", false); + _bool_configs[CONFIG_DECLINED_NAMES_USED] = + (_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfigMgr->GetOption("DeclinedNames", false); - m_float_configs[CONFIG_LISTEN_RANGE_SAY] = sConfigMgr->GetOption("ListenRange.Say", 25.0f); - m_float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfigMgr->GetOption("ListenRange.TextEmote", 25.0f); - m_float_configs[CONFIG_LISTEN_RANGE_YELL] = sConfigMgr->GetOption("ListenRange.Yell", 300.0f); + _float_configs[CONFIG_LISTEN_RANGE_SAY] = sConfigMgr->GetOption("ListenRange.Say", 25.0f); + _float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfigMgr->GetOption("ListenRange.TextEmote", 25.0f); + _float_configs[CONFIG_LISTEN_RANGE_YELL] = sConfigMgr->GetOption("ListenRange.Yell", 300.0f); - m_bool_configs[CONFIG_BATTLEGROUND_DISABLE_QUEST_SHARE_IN_BG] = sConfigMgr->GetOption("Battleground.DisableQuestShareInBG", false); - m_bool_configs[CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG] = sConfigMgr->GetOption("Battleground.DisableReadyCheckInBG", false); - m_bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfigMgr->GetOption("Battleground.CastDeserter", true); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Enable", false); - m_int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_LEVEL] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Limit.MinLevel", 0); - m_int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_PLAYERS] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Limit.MinPlayers", 3); - m_int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.SpamProtection.Delay", 30); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.PlayerOnly", false); - m_bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Timed", false); - m_int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMER] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Timer", 30000); - m_bool_configs[CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE] = sConfigMgr->GetOption("Battleground.StoreStatistics.Enable", false); - m_bool_configs[CONFIG_BATTLEGROUND_TRACK_DESERTERS] = sConfigMgr->GetOption("Battleground.TrackDeserters.Enable", false); - m_int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfigMgr->GetOption ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfigMgr->GetOption("Battleground.InvitationType", 0); - m_int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetOption ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); - m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetOption("Battleground.GiveXPForKills", false); - m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK_TIMER] = sConfigMgr->GetOption("Battleground.ReportAFK.Timer", 4); - m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = sConfigMgr->GetOption("Battleground.ReportAFK", 3); - if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] < 1) + _bool_configs[CONFIG_BATTLEGROUND_DISABLE_QUEST_SHARE_IN_BG] = sConfigMgr->GetOption("Battleground.DisableQuestShareInBG", false); + _bool_configs[CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG] = sConfigMgr->GetOption("Battleground.DisableReadyCheckInBG", false); + _bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfigMgr->GetOption("Battleground.CastDeserter", true); + _bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Enable", false); + _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_LEVEL] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Limit.MinLevel", 0); + _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_PLAYERS] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Limit.MinPlayers", 3); + _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.SpamProtection.Delay", 30); + _bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.PlayerOnly", false); + _bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Timed", false); + _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMER] = sConfigMgr->GetOption("Battleground.QueueAnnouncer.Timer", 30000); + _bool_configs[CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE] = sConfigMgr->GetOption("Battleground.StoreStatistics.Enable", false); + _bool_configs[CONFIG_BATTLEGROUND_TRACK_DESERTERS] = sConfigMgr->GetOption("Battleground.TrackDeserters.Enable", false); + _int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfigMgr->GetOption ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS); + _int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfigMgr->GetOption("Battleground.InvitationType", 0); + _int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetOption ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS); + _bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetOption("Battleground.GiveXPForKills", false); + _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK_TIMER] = sConfigMgr->GetOption("Battleground.ReportAFK.Timer", 4); + _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = sConfigMgr->GetOption("Battleground.ReportAFK", 3); + if (_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] < 1) { - LOG_ERROR("server.loading", "Battleground.ReportAFK ({}) must be >0. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]); - m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3; + LOG_ERROR("server.loading", "Battleground.ReportAFK ({}) must be >0. Using 3 instead.", _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]); + _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3; } - else if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] > 9) + else if (_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] > 9) { - LOG_ERROR("server.loading", "Battleground.ReportAFK ({}) must be <10. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]); - m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3; + LOG_ERROR("server.loading", "Battleground.ReportAFK ({}) must be <10. Using 3 instead.", _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]); + _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3; } - m_int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] = sConfigMgr->GetOption("Battleground.PlayerRespawn", 30); - if (m_int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] < 3) + _int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] = sConfigMgr->GetOption("Battleground.PlayerRespawn", 30); + if (_int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] < 3) { - LOG_ERROR("server.loading", "Battleground.PlayerRespawn ({}) must be >2. Using 30 instead.", m_int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN]); - m_int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] = 30; + LOG_ERROR("server.loading", "Battleground.PlayerRespawn ({}) must be >2. Using 30 instead.", _int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN]); + _int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] = 30; } - m_int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] = sConfigMgr->GetOption("Battleground.RestorationBuffRespawn", 20); - if (m_int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] < 1) + _int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] = sConfigMgr->GetOption("Battleground.RestorationBuffRespawn", 20); + if (_int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] < 1) { - LOG_ERROR("server.loading", "Battleground.RestorationBuffRespawn ({}) must be > 0. Using 20 instead.", m_int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN]); - m_int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] = 20; + LOG_ERROR("server.loading", "Battleground.RestorationBuffRespawn ({}) must be > 0. Using 20 instead.", _int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN]); + _int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] = 20; } - m_int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] = sConfigMgr->GetOption("Battleground.BerserkingBuffRespawn", 120); - if (m_int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] < 1) + _int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] = sConfigMgr->GetOption("Battleground.BerserkingBuffRespawn", 120); + if (_int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] < 1) { - LOG_ERROR("server.loading", "Battleground.BerserkingBuffRespawn ({}) must be > 0. Using 120 instead.", m_int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN]); - m_int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] = 120; + LOG_ERROR("server.loading", "Battleground.BerserkingBuffRespawn ({}) must be > 0. Using 120 instead.", _int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN]); + _int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] = 120; } - m_int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] = sConfigMgr->GetOption("Battleground.SpeedBuffRespawn", 150); - if (m_int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] < 1) + _int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] = sConfigMgr->GetOption("Battleground.SpeedBuffRespawn", 150); + if (_int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] < 1) { - LOG_ERROR("server.loading", "Battleground.SpeedBuffRespawn ({}) must be > 0. Using 150 instead.", m_int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN]); - m_int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] = 150; + LOG_ERROR("server.loading", "Battleground.SpeedBuffRespawn ({}) must be > 0. Using 150 instead.", _int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN]); + _int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] = 150; } - m_int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfigMgr->GetOption("Arena.MaxRatingDifference", 150); - m_int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfigMgr->GetOption("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_ARENA_PREV_OPPONENTS_DISCARD_TIMER] = sConfigMgr->GetOption("Arena.PreviousOpponentsDiscardTimer", 2 * MINUTE * IN_MILLISECONDS); - m_bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfigMgr->GetOption("Arena.AutoDistributePoints", false); - m_int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfigMgr->GetOption("Arena.AutoDistributeInterval", 7); // pussywizard: spoiled by implementing constant day and hour, always 7 now - m_int_configs[CONFIG_ARENA_GAMES_REQUIRED] = sConfigMgr->GetOption("Arena.GamesRequired", 10); - m_int_configs[CONFIG_ARENA_SEASON_ID] = sConfigMgr->GetOption("Arena.ArenaSeason.ID", 1); - m_int_configs[CONFIG_ARENA_START_RATING] = sConfigMgr->GetOption("Arena.ArenaStartRating", 0); - m_int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetOption("Arena.ArenaStartPersonalRating", 1000); - m_int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetOption("Arena.ArenaStartMatchmakerRating", 1500); - m_bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetOption("Arena.ArenaSeason.InProgress", true); - m_float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_1] = sConfigMgr->GetOption("Arena.ArenaWinRatingModifier1", 48.0f); - m_float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_2] = sConfigMgr->GetOption("Arena.ArenaWinRatingModifier2", 24.0f); - m_float_configs[CONFIG_ARENA_LOSE_RATING_MODIFIER] = sConfigMgr->GetOption("Arena.ArenaLoseRatingModifier", 24.0f); - m_float_configs[CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER] = sConfigMgr->GetOption("Arena.ArenaMatchmakerRatingModifier", 24.0f); - m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption("Arena.QueueAnnouncer.Enable", false); - m_bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption("Arena.QueueAnnouncer.PlayerOnly", false); + _int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfigMgr->GetOption("Arena.MaxRatingDifference", 150); + _int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfigMgr->GetOption("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS); + _int_configs[CONFIG_ARENA_PREV_OPPONENTS_DISCARD_TIMER] = sConfigMgr->GetOption("Arena.PreviousOpponentsDiscardTimer", 2 * MINUTE * IN_MILLISECONDS); + _bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfigMgr->GetOption("Arena.AutoDistributePoints", false); + _int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfigMgr->GetOption("Arena.AutoDistributeInterval", 7); // pussywizard: spoiled by implementing constant day and hour, always 7 now + _int_configs[CONFIG_ARENA_GAMES_REQUIRED] = sConfigMgr->GetOption("Arena.GamesRequired", 10); + _int_configs[CONFIG_ARENA_SEASON_ID] = sConfigMgr->GetOption("Arena.ArenaSeason.ID", 1); + _int_configs[CONFIG_ARENA_START_RATING] = sConfigMgr->GetOption("Arena.ArenaStartRating", 0); + _int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetOption("Arena.ArenaStartPersonalRating", 1000); + _int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetOption("Arena.ArenaStartMatchmakerRating", 1500); + _bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetOption("Arena.ArenaSeason.InProgress", true); + _float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_1] = sConfigMgr->GetOption("Arena.ArenaWinRatingModifier1", 48.0f); + _float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_2] = sConfigMgr->GetOption("Arena.ArenaWinRatingModifier2", 24.0f); + _float_configs[CONFIG_ARENA_LOSE_RATING_MODIFIER] = sConfigMgr->GetOption("Arena.ArenaLoseRatingModifier", 24.0f); + _float_configs[CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER] = sConfigMgr->GetOption("Arena.ArenaMatchmakerRatingModifier", 24.0f); + _bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption("Arena.QueueAnnouncer.Enable", false); + _bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption("Arena.QueueAnnouncer.PlayerOnly", false); - m_bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetOption("OffhandCheckAtSpellUnlearn", true); - m_int_configs[CONFIG_CREATURE_STOP_FOR_PLAYER] = sConfigMgr->GetOption("Creature.MovingStopTimeForPlayer", 3 * MINUTE * IN_MILLISECONDS); + _bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetOption("OffhandCheckAtSpellUnlearn", true); + _int_configs[CONFIG_CREATURE_STOP_FOR_PLAYER] = sConfigMgr->GetOption("Creature.MovingStopTimeForPlayer", 3 * MINUTE * IN_MILLISECONDS); - m_int_configs[CONFIG_WATER_BREATH_TIMER] = sConfigMgr->GetOption("WaterBreath.Timer", 180000); - if (m_int_configs[CONFIG_WATER_BREATH_TIMER] <= 0) + _int_configs[CONFIG_WATER_BREATH_TIMER] = sConfigMgr->GetOption("WaterBreath.Timer", 180000); + if (_int_configs[CONFIG_WATER_BREATH_TIMER] <= 0) { - LOG_ERROR("server.loading", "WaterBreath.Timer ({}) must be > 0. Using 180000 instead.", m_int_configs[CONFIG_WATER_BREATH_TIMER]); - m_int_configs[CONFIG_WATER_BREATH_TIMER] = 180000; + LOG_ERROR("server.loading", "WaterBreath.Timer ({}) must be > 0. Using 180000 instead.", _int_configs[CONFIG_WATER_BREATH_TIMER]); + _int_configs[CONFIG_WATER_BREATH_TIMER] = 180000; } if (int32 clientCacheId = sConfigMgr->GetOption("ClientCacheVersion", 0)) @@ -1203,85 +1202,85 @@ void World::LoadConfigSettings(bool reload) // overwrite DB/old value if (clientCacheId > 0) { - m_int_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId; + _int_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId; LOG_INFO("server.loading", "Client cache version set to: {}", clientCacheId); } else LOG_ERROR("server.loading", "ClientCacheVersion can't be negative {}, ignored.", clientCacheId); } - m_int_configs[CONFIG_INSTANT_LOGOUT] = sConfigMgr->GetOption("InstantLogout", SEC_MODERATOR); + _int_configs[CONFIG_INSTANT_LOGOUT] = sConfigMgr->GetOption("InstantLogout", SEC_MODERATOR); - m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = sConfigMgr->GetOption("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); - if (m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] > GUILD_EVENTLOG_MAX_RECORDS) - m_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = GUILD_EVENTLOG_MAX_RECORDS; - m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = sConfigMgr->GetOption("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS); - if (m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] > GUILD_BANKLOG_MAX_RECORDS) - m_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = GUILD_BANKLOG_MAX_RECORDS; + _int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = sConfigMgr->GetOption("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS); + if (_int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] > GUILD_EVENTLOG_MAX_RECORDS) + _int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = GUILD_EVENTLOG_MAX_RECORDS; + _int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = sConfigMgr->GetOption("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS); + if (_int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] > GUILD_BANKLOG_MAX_RECORDS) + _int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = GUILD_BANKLOG_MAX_RECORDS; //visibility on continents - m_MaxVisibleDistanceOnContinents = sConfigMgr->GetOption("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); - if (m_MaxVisibleDistanceOnContinents < 45 * sWorld->getRate(RATE_CREATURE_AGGRO)) + _maxVisibleDistanceOnContinents = sConfigMgr->GetOption("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE); + if (_maxVisibleDistanceOnContinents < 45 * sWorld->getRate(RATE_CREATURE_AGGRO)) { LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceOnContinents = 45 * sWorld->getRate(RATE_CREATURE_AGGRO); + _maxVisibleDistanceOnContinents = 45 * sWorld->getRate(RATE_CREATURE_AGGRO); } - else if (m_MaxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE) + else if (_maxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE) { LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be greater {}", MAX_VISIBILITY_DISTANCE); - m_MaxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE; + _maxVisibleDistanceOnContinents = MAX_VISIBILITY_DISTANCE; } //visibility in instances - m_MaxVisibleDistanceInInstances = sConfigMgr->GetOption("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); - if (m_MaxVisibleDistanceInInstances < 45 * sWorld->getRate(RATE_CREATURE_AGGRO)) + _maxVisibleDistanceInInstances = sConfigMgr->GetOption("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE); + if (_maxVisibleDistanceInInstances < 45 * sWorld->getRate(RATE_CREATURE_AGGRO)) { LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceInInstances = 45 * sWorld->getRate(RATE_CREATURE_AGGRO); + _maxVisibleDistanceInInstances = 45 * sWorld->getRate(RATE_CREATURE_AGGRO); } - else if (m_MaxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE) + else if (_maxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE) { LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be greater {}", MAX_VISIBILITY_DISTANCE); - m_MaxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE; + _maxVisibleDistanceInInstances = MAX_VISIBILITY_DISTANCE; } //visibility in BG/Arenas - m_MaxVisibleDistanceInBGArenas = sConfigMgr->GetOption("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); - if (m_MaxVisibleDistanceInBGArenas < 45 * sWorld->getRate(RATE_CREATURE_AGGRO)) + _maxVisibleDistanceInBGArenas = sConfigMgr->GetOption("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS); + if (_maxVisibleDistanceInBGArenas < 45 * sWorld->getRate(RATE_CREATURE_AGGRO)) { LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO)); - m_MaxVisibleDistanceInBGArenas = 45 * sWorld->getRate(RATE_CREATURE_AGGRO); + _maxVisibleDistanceInBGArenas = 45 * sWorld->getRate(RATE_CREATURE_AGGRO); } - else if (m_MaxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE) + else if (_maxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE) { LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be greater {}", MAX_VISIBILITY_DISTANCE); - m_MaxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE; + _maxVisibleDistanceInBGArenas = MAX_VISIBILITY_DISTANCE; } ///- Load the CharDelete related config options - m_int_configs[CONFIG_CHARDELETE_METHOD] = sConfigMgr->GetOption("CharDelete.Method", 0); - m_int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfigMgr->GetOption("CharDelete.MinLevel", 0); - m_int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfigMgr->GetOption("CharDelete.KeepDays", 30); + _int_configs[CONFIG_CHARDELETE_METHOD] = sConfigMgr->GetOption("CharDelete.Method", 0); + _int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfigMgr->GetOption("CharDelete.MinLevel", 0); + _int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfigMgr->GetOption("CharDelete.KeepDays", 30); ///- Load the ItemDelete related config options - m_bool_configs[CONFIG_ITEMDELETE_METHOD] = sConfigMgr->GetOption("ItemDelete.Method", 0); - m_bool_configs[CONFIG_ITEMDELETE_VENDOR] = sConfigMgr->GetOption("ItemDelete.Vendor", 0); - m_int_configs[CONFIG_ITEMDELETE_QUALITY] = sConfigMgr->GetOption("ItemDelete.Quality", 3); - m_int_configs[CONFIG_ITEMDELETE_ITEM_LEVEL] = sConfigMgr->GetOption("ItemDelete.ItemLevel", 80); + _bool_configs[CONFIG_ITEMDELETE_METHOD] = sConfigMgr->GetOption("ItemDelete.Method", 0); + _bool_configs[CONFIG_ITEMDELETE_VENDOR] = sConfigMgr->GetOption("ItemDelete.Vendor", 0); + _int_configs[CONFIG_ITEMDELETE_QUALITY] = sConfigMgr->GetOption("ItemDelete.Quality", 3); + _int_configs[CONFIG_ITEMDELETE_ITEM_LEVEL] = sConfigMgr->GetOption("ItemDelete.ItemLevel", 80); - m_int_configs[CONFIG_FFA_PVP_TIMER] = sConfigMgr->GetOption("FFAPvPTimer", 30); + _int_configs[CONFIG_FFA_PVP_TIMER] = sConfigMgr->GetOption("FFAPvPTimer", 30); - m_int_configs[CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION] = sConfigMgr->GetOption("LootNeedBeforeGreedILvlRestriction", 70); + _int_configs[CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION] = sConfigMgr->GetOption("LootNeedBeforeGreedILvlRestriction", 70); - m_bool_configs[CONFIG_PLAYER_SETTINGS_ENABLED] = sConfigMgr->GetOption("EnablePlayerSettings", 0); + _bool_configs[CONFIG_PLAYER_SETTINGS_ENABLED] = sConfigMgr->GetOption("EnablePlayerSettings", 0); - m_bool_configs[CONFIG_ALLOW_JOIN_BG_AND_LFG] = sConfigMgr->GetOption("JoinBGAndLFG.Enable", false); + _bool_configs[CONFIG_ALLOW_JOIN_BG_AND_LFG] = sConfigMgr->GetOption("JoinBGAndLFG.Enable", false); - m_bool_configs[CONFIG_LEAVE_GROUP_ON_LOGOUT] = sConfigMgr->GetOption("LeaveGroupOnLogout.Enabled", true); + _bool_configs[CONFIG_LEAVE_GROUP_ON_LOGOUT] = sConfigMgr->GetOption("LeaveGroupOnLogout.Enabled", true); - m_bool_configs[CONFIG_QUEST_POI_ENABLED] = sConfigMgr->GetOption("QuestPOI.Enabled", true); + _bool_configs[CONFIG_QUEST_POI_ENABLED] = sConfigMgr->GetOption("QuestPOI.Enabled", true); - m_int_configs[CONFIG_CHANGE_FACTION_MAX_MONEY] = sConfigMgr->GetOption("ChangeFaction.MaxMoney", 0); + _int_configs[CONFIG_CHANGE_FACTION_MAX_MONEY] = sConfigMgr->GetOption("ChangeFaction.MaxMoney", 0); ///- Read the "Data" directory from the config file std::string dataPath = sConfigMgr->GetOption("DataDir", "./"); @@ -1299,21 +1298,21 @@ void World::LoadConfigSettings(bool reload) if (reload) { - if (dataPath != m_dataPath) - LOG_ERROR("server.loading", "DataDir option can't be changed at worldserver.conf reload, using current value ({}).", m_dataPath); + if (dataPath != _dataPath) + LOG_ERROR("server.loading", "DataDir option can't be changed at worldserver.conf reload, using current value ({}).", _dataPath); } else { - m_dataPath = dataPath; - LOG_INFO("server.loading", "Using DataDir {}", m_dataPath); + _dataPath = dataPath; + LOG_INFO("server.loading", "Using DataDir {}", _dataPath); } - m_bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfigMgr->GetOption("vmap.enableIndoorCheck", 0); + _bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfigMgr->GetOption("vmap.enableIndoorCheck", 0); bool enableIndoor = sConfigMgr->GetOption("vmap.enableIndoorCheck", true); bool enableLOS = sConfigMgr->GetOption("vmap.enableLOS", true); bool enableHeight = sConfigMgr->GetOption("vmap.enableHeight", true); bool enablePetLOS = sConfigMgr->GetOption("vmap.petLOS", true); - m_bool_configs[CONFIG_VMAP_BLIZZLIKE_PVP_LOS] = sConfigMgr->GetOption("vmap.BlizzlikePvPLOS", true); + _bool_configs[CONFIG_VMAP_BLIZZLIKE_PVP_LOS] = sConfigMgr->GetOption("vmap.BlizzlikePvPLOS", true); if (!enableHeight) LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support."); @@ -1322,155 +1321,155 @@ void World::LoadConfigSettings(bool reload) VMAP::VMapFactory::createOrGetVMapMgr()->setEnableHeightCalc(enableHeight); LOG_INFO("server.loading", "WORLD: VMap support included. LineOfSight:{}, getHeight:{}, indoorCheck:{} PetLOS:{}", enableLOS, enableHeight, enableIndoor, enablePetLOS); - m_bool_configs[CONFIG_PET_LOS] = sConfigMgr->GetOption("vmap.petLOS", true); - m_bool_configs[CONFIG_START_CUSTOM_SPELLS] = sConfigMgr->GetOption("PlayerStart.CustomSpells", false); - m_int_configs[CONFIG_HONOR_AFTER_DUEL] = sConfigMgr->GetOption("HonorPointsAfterDuel", 0); - m_bool_configs[CONFIG_START_ALL_EXPLORED] = sConfigMgr->GetOption("PlayerStart.MapsExplored", false); - m_bool_configs[CONFIG_START_ALL_REP] = sConfigMgr->GetOption("PlayerStart.AllReputation", false); - m_bool_configs[CONFIG_ALWAYS_MAXSKILL] = sConfigMgr->GetOption("AlwaysMaxWeaponSkill", false); - m_bool_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfigMgr->GetOption("PvPToken.Enable", false); - m_int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfigMgr->GetOption("PvPToken.MapAllowType", 4); - m_int_configs[CONFIG_PVP_TOKEN_ID] = sConfigMgr->GetOption("PvPToken.ItemID", 29434); - m_int_configs[CONFIG_PVP_TOKEN_COUNT] = sConfigMgr->GetOption("PvPToken.ItemCount", 1); - if (m_int_configs[CONFIG_PVP_TOKEN_COUNT] < 1) - m_int_configs[CONFIG_PVP_TOKEN_COUNT] = 1; + _bool_configs[CONFIG_PET_LOS] = sConfigMgr->GetOption("vmap.petLOS", true); + _bool_configs[CONFIG_START_CUSTOM_SPELLS] = sConfigMgr->GetOption("PlayerStart.CustomSpells", false); + _int_configs[CONFIG_HONOR_AFTER_DUEL] = sConfigMgr->GetOption("HonorPointsAfterDuel", 0); + _bool_configs[CONFIG_START_ALL_EXPLORED] = sConfigMgr->GetOption("PlayerStart.MapsExplored", false); + _bool_configs[CONFIG_START_ALL_REP] = sConfigMgr->GetOption("PlayerStart.AllReputation", false); + _bool_configs[CONFIG_ALWAYS_MAXSKILL] = sConfigMgr->GetOption("AlwaysMaxWeaponSkill", false); + _bool_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfigMgr->GetOption("PvPToken.Enable", false); + _int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfigMgr->GetOption("PvPToken.MapAllowType", 4); + _int_configs[CONFIG_PVP_TOKEN_ID] = sConfigMgr->GetOption("PvPToken.ItemID", 29434); + _int_configs[CONFIG_PVP_TOKEN_COUNT] = sConfigMgr->GetOption("PvPToken.ItemCount", 1); + if (_int_configs[CONFIG_PVP_TOKEN_COUNT] < 1) + _int_configs[CONFIG_PVP_TOKEN_COUNT] = 1; - m_bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfigMgr->GetOption("NoResetTalentsCost", false); - m_int_configs[CONFIG_TOGGLE_XP_COST] = sConfigMgr->GetOption("ToggleXP.Cost", 100000); - m_bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfigMgr->GetOption("ShowKickInWorld", false); - m_bool_configs[CONFIG_SHOW_MUTE_IN_WORLD] = sConfigMgr->GetOption("ShowMuteInWorld", false); - m_bool_configs[CONFIG_SHOW_BAN_IN_WORLD] = sConfigMgr->GetOption("ShowBanInWorld", false); - m_int_configs[CONFIG_NUMTHREADS] = sConfigMgr->GetOption("MapUpdate.Threads", 1); - m_int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = sConfigMgr->GetOption("Command.LookupMaxResults", 0); + _bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfigMgr->GetOption("NoResetTalentsCost", false); + _int_configs[CONFIG_TOGGLE_XP_COST] = sConfigMgr->GetOption("ToggleXP.Cost", 100000); + _bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfigMgr->GetOption("ShowKickInWorld", false); + _bool_configs[CONFIG_SHOW_MUTE_IN_WORLD] = sConfigMgr->GetOption("ShowMuteInWorld", false); + _bool_configs[CONFIG_SHOW_BAN_IN_WORLD] = sConfigMgr->GetOption("ShowBanInWorld", false); + _int_configs[CONFIG_NUMTHREADS] = sConfigMgr->GetOption("MapUpdate.Threads", 1); + _int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = sConfigMgr->GetOption("Command.LookupMaxResults", 0); // Warden - m_bool_configs[CONFIG_WARDEN_ENABLED] = sConfigMgr->GetOption("Warden.Enabled", true); - m_int_configs[CONFIG_WARDEN_NUM_MEM_CHECKS] = sConfigMgr->GetOption("Warden.NumMemChecks", 3); - m_int_configs[CONFIG_WARDEN_NUM_LUA_CHECKS] = sConfigMgr->GetOption("Warden.NumLuaChecks", 1); - m_int_configs[CONFIG_WARDEN_NUM_OTHER_CHECKS] = sConfigMgr->GetOption("Warden.NumOtherChecks", 7); - m_int_configs[CONFIG_WARDEN_CLIENT_BAN_DURATION] = sConfigMgr->GetOption("Warden.BanDuration", 86400); - m_int_configs[CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF] = sConfigMgr->GetOption("Warden.ClientCheckHoldOff", 30); - m_int_configs[CONFIG_WARDEN_CLIENT_FAIL_ACTION] = sConfigMgr->GetOption("Warden.ClientCheckFailAction", 0); - m_int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = sConfigMgr->GetOption("Warden.ClientResponseDelay", 600); + _bool_configs[CONFIG_WARDEN_ENABLED] = sConfigMgr->GetOption("Warden.Enabled", true); + _int_configs[CONFIG_WARDEN_NUM_MEM_CHECKS] = sConfigMgr->GetOption("Warden.NumMemChecks", 3); + _int_configs[CONFIG_WARDEN_NUM_LUA_CHECKS] = sConfigMgr->GetOption("Warden.NumLuaChecks", 1); + _int_configs[CONFIG_WARDEN_NUM_OTHER_CHECKS] = sConfigMgr->GetOption("Warden.NumOtherChecks", 7); + _int_configs[CONFIG_WARDEN_CLIENT_BAN_DURATION] = sConfigMgr->GetOption("Warden.BanDuration", 86400); + _int_configs[CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF] = sConfigMgr->GetOption("Warden.ClientCheckHoldOff", 30); + _int_configs[CONFIG_WARDEN_CLIENT_FAIL_ACTION] = sConfigMgr->GetOption("Warden.ClientCheckFailAction", 0); + _int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = sConfigMgr->GetOption("Warden.ClientResponseDelay", 600); // Dungeon finder - m_int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetOption("DungeonFinder.OptionsMask", 5); + _int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetOption("DungeonFinder.OptionsMask", 5); // Max instances per hour - m_int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = sConfigMgr->GetOption("AccountInstancesPerHour", 5); + _int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = sConfigMgr->GetOption("AccountInstancesPerHour", 5); // AutoBroadcast - m_bool_configs[CONFIG_AUTOBROADCAST] = sConfigMgr->GetOption("AutoBroadcast.On", false); - m_int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfigMgr->GetOption("AutoBroadcast.Center", 0); - m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = sConfigMgr->GetOption("AutoBroadcast.Timer", 60000); - m_int_configs[CONFIG_AUTOBROADCAST_MIN_LEVEL_DISABLE] = sConfigMgr->GetOption("AutoBroadcast.MinDisableLevel", 0); + _bool_configs[CONFIG_AUTOBROADCAST] = sConfigMgr->GetOption("AutoBroadcast.On", false); + _int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfigMgr->GetOption("AutoBroadcast.Center", 0); + _int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = sConfigMgr->GetOption("AutoBroadcast.Timer", 60000); + _int_configs[CONFIG_AUTOBROADCAST_MIN_LEVEL_DISABLE] = sConfigMgr->GetOption("AutoBroadcast.MinDisableLevel", 0); if (reload) { - m_timers[WUPDATE_AUTOBROADCAST].SetInterval(m_int_configs[CONFIG_AUTOBROADCAST_INTERVAL]); - m_timers[WUPDATE_AUTOBROADCAST].Reset(); + _timers[WUPDATE_AUTOBROADCAST].SetInterval(_int_configs[CONFIG_AUTOBROADCAST_INTERVAL]); + _timers[WUPDATE_AUTOBROADCAST].Reset(); } // MySQL ping time interval - m_int_configs[CONFIG_DB_PING_INTERVAL] = sConfigMgr->GetOption("MaxPingTime", 30); + _int_configs[CONFIG_DB_PING_INTERVAL] = sConfigMgr->GetOption("MaxPingTime", 30); // misc - m_bool_configs[CONFIG_PDUMP_NO_PATHS] = sConfigMgr->GetOption("PlayerDump.DisallowPaths", true); - m_bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = sConfigMgr->GetOption("PlayerDump.DisallowOverwrite", true); - m_bool_configs[CONFIG_ENABLE_MMAPS] = sConfigMgr->GetOption("MoveMaps.Enable", true); + _bool_configs[CONFIG_PDUMP_NO_PATHS] = sConfigMgr->GetOption("PlayerDump.DisallowPaths", true); + _bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = sConfigMgr->GetOption("PlayerDump.DisallowOverwrite", true); + _bool_configs[CONFIG_ENABLE_MMAPS] = sConfigMgr->GetOption("MoveMaps.Enable", true); MMAP::MMapFactory::InitializeDisabledMaps(); // Wintergrasp - m_int_configs[CONFIG_WINTERGRASP_ENABLE] = sConfigMgr->GetOption("Wintergrasp.Enable", 1); - m_int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption("Wintergrasp.PlayerMax", 100); - m_int_configs[CONFIG_WINTERGRASP_PLR_MIN] = sConfigMgr->GetOption("Wintergrasp.PlayerMin", 0); - m_int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption("Wintergrasp.PlayerMinLvl", 77); - m_int_configs[CONFIG_WINTERGRASP_BATTLETIME] = sConfigMgr->GetOption("Wintergrasp.BattleTimer", 30); - m_int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = sConfigMgr->GetOption("Wintergrasp.NoBattleTimer", 150); - m_int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = sConfigMgr->GetOption("Wintergrasp.CrashRestartTimer", 10); + _int_configs[CONFIG_WINTERGRASP_ENABLE] = sConfigMgr->GetOption("Wintergrasp.Enable", 1); + _int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption("Wintergrasp.PlayerMax", 100); + _int_configs[CONFIG_WINTERGRASP_PLR_MIN] = sConfigMgr->GetOption("Wintergrasp.PlayerMin", 0); + _int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption("Wintergrasp.PlayerMinLvl", 77); + _int_configs[CONFIG_WINTERGRASP_BATTLETIME] = sConfigMgr->GetOption("Wintergrasp.BattleTimer", 30); + _int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = sConfigMgr->GetOption("Wintergrasp.NoBattleTimer", 150); + _int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = sConfigMgr->GetOption("Wintergrasp.CrashRestartTimer", 10); - m_int_configs[CONFIG_BIRTHDAY_TIME] = sConfigMgr->GetOption("BirthdayTime", 1222964635); - m_bool_configs[CONFIG_MINIGOB_MANABONK] = sConfigMgr->GetOption("Minigob.Manabonk.Enable", true); + _int_configs[CONFIG_BIRTHDAY_TIME] = sConfigMgr->GetOption("BirthdayTime", 1222964635); + _bool_configs[CONFIG_MINIGOB_MANABONK] = sConfigMgr->GetOption("Minigob.Manabonk.Enable", true); - m_bool_configs[CONFIG_ENABLE_CONTINENT_TRANSPORT] = sConfigMgr->GetOption("IsContinentTransport.Enabled", true); - m_bool_configs[CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING] = sConfigMgr->GetOption("IsPreloadedContinentTransport.Enabled", false); + _bool_configs[CONFIG_ENABLE_CONTINENT_TRANSPORT] = sConfigMgr->GetOption("IsContinentTransport.Enabled", true); + _bool_configs[CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING] = sConfigMgr->GetOption("IsPreloadedContinentTransport.Enabled", false); - m_bool_configs[CONFIG_IP_BASED_ACTION_LOGGING] = sConfigMgr->GetOption("Allow.IP.Based.Action.Logging", false); + _bool_configs[CONFIG_IP_BASED_ACTION_LOGGING] = sConfigMgr->GetOption("Allow.IP.Based.Action.Logging", false); // Whether to use LoS from game objects - m_bool_configs[CONFIG_CHECK_GOBJECT_LOS] = sConfigMgr->GetOption("CheckGameObjectLoS", true); + _bool_configs[CONFIG_CHECK_GOBJECT_LOS] = sConfigMgr->GetOption("CheckGameObjectLoS", true); - m_bool_configs[CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA] = sConfigMgr->GetOption("Calculate.Creature.Zone.Area.Data", false); - m_bool_configs[CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA] = sConfigMgr->GetOption("Calculate.Gameoject.Zone.Area.Data", false); + _bool_configs[CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA] = sConfigMgr->GetOption("Calculate.Creature.Zone.Area.Data", false); + _bool_configs[CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA] = sConfigMgr->GetOption("Calculate.Gameoject.Zone.Area.Data", false); // Player can join LFG anywhere - m_bool_configs[CONFIG_LFG_LOCATION_ALL] = sConfigMgr->GetOption("LFG.Location.All", false); + _bool_configs[CONFIG_LFG_LOCATION_ALL] = sConfigMgr->GetOption("LFG.Location.All", false); // Prevent players AFK from being logged out - m_int_configs[CONFIG_AFK_PREVENT_LOGOUT] = sConfigMgr->GetOption("PreventAFKLogout", 0); + _int_configs[CONFIG_AFK_PREVENT_LOGOUT] = sConfigMgr->GetOption("PreventAFKLogout", 0); // Preload all grids of all non-instanced maps - m_bool_configs[CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS] = sConfigMgr->GetOption("PreloadAllNonInstancedMapGrids", false); + _bool_configs[CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS] = sConfigMgr->GetOption("PreloadAllNonInstancedMapGrids", false); // ICC buff override - m_int_configs[CONFIG_ICC_BUFF_HORDE] = sConfigMgr->GetOption("ICC.Buff.Horde", 73822); - m_int_configs[CONFIG_ICC_BUFF_ALLIANCE] = sConfigMgr->GetOption("ICC.Buff.Alliance", 73828); + _int_configs[CONFIG_ICC_BUFF_HORDE] = sConfigMgr->GetOption("ICC.Buff.Horde", 73822); + _int_configs[CONFIG_ICC_BUFF_ALLIANCE] = sConfigMgr->GetOption("ICC.Buff.Alliance", 73828); - m_bool_configs[CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE] = sConfigMgr->GetOption("SetAllCreaturesWithWaypointMovementActive", false); + _bool_configs[CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE] = sConfigMgr->GetOption("SetAllCreaturesWithWaypointMovementActive", false); // packet spoof punishment - m_int_configs[CONFIG_PACKET_SPOOF_POLICY] = sConfigMgr->GetOption("PacketSpoof.Policy", (uint32)WorldSession::DosProtection::POLICY_KICK); - m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] = sConfigMgr->GetOption("PacketSpoof.BanMode", (uint32)0); - if (m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] > 1) - m_int_configs[CONFIG_PACKET_SPOOF_BANMODE] = (uint32)0; + _int_configs[CONFIG_PACKET_SPOOF_POLICY] = sConfigMgr->GetOption("PacketSpoof.Policy", (uint32)WorldSession::DosProtection::POLICY_KICK); + _int_configs[CONFIG_PACKET_SPOOF_BANMODE] = sConfigMgr->GetOption("PacketSpoof.BanMode", (uint32)0); + if (_int_configs[CONFIG_PACKET_SPOOF_BANMODE] > 1) + _int_configs[CONFIG_PACKET_SPOOF_BANMODE] = (uint32)0; - m_int_configs[CONFIG_PACKET_SPOOF_BANDURATION] = sConfigMgr->GetOption("PacketSpoof.BanDuration", 86400); + _int_configs[CONFIG_PACKET_SPOOF_BANDURATION] = sConfigMgr->GetOption("PacketSpoof.BanDuration", 86400); // Random Battleground Rewards - m_int_configs[CONFIG_BG_REWARD_WINNER_HONOR_FIRST] = sConfigMgr->GetOption("Battleground.RewardWinnerHonorFirst", 30); - m_int_configs[CONFIG_BG_REWARD_WINNER_ARENA_FIRST] = sConfigMgr->GetOption("Battleground.RewardWinnerArenaFirst", 25); - m_int_configs[CONFIG_BG_REWARD_WINNER_HONOR_LAST] = sConfigMgr->GetOption("Battleground.RewardWinnerHonorLast", 15); - m_int_configs[CONFIG_BG_REWARD_WINNER_ARENA_LAST] = sConfigMgr->GetOption("Battleground.RewardWinnerArenaLast", 0); - m_int_configs[CONFIG_BG_REWARD_LOSER_HONOR_FIRST] = sConfigMgr->GetOption("Battleground.RewardLoserHonorFirst", 5); - m_int_configs[CONFIG_BG_REWARD_LOSER_HONOR_LAST] = sConfigMgr->GetOption("Battleground.RewardLoserHonorLast", 5); + _int_configs[CONFIG_BG_REWARD_WINNER_HONOR_FIRST] = sConfigMgr->GetOption("Battleground.RewardWinnerHonorFirst", 30); + _int_configs[CONFIG_BG_REWARD_WINNER_ARENA_FIRST] = sConfigMgr->GetOption("Battleground.RewardWinnerArenaFirst", 25); + _int_configs[CONFIG_BG_REWARD_WINNER_HONOR_LAST] = sConfigMgr->GetOption("Battleground.RewardWinnerHonorLast", 15); + _int_configs[CONFIG_BG_REWARD_WINNER_ARENA_LAST] = sConfigMgr->GetOption("Battleground.RewardWinnerArenaLast", 0); + _int_configs[CONFIG_BG_REWARD_LOSER_HONOR_FIRST] = sConfigMgr->GetOption("Battleground.RewardLoserHonorFirst", 5); + _int_configs[CONFIG_BG_REWARD_LOSER_HONOR_LAST] = sConfigMgr->GetOption("Battleground.RewardLoserHonorLast", 5); - m_int_configs[CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER] = sConfigMgr->GetOption("WaypointMovementStopTimeForPlayer", 120); + _int_configs[CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER] = sConfigMgr->GetOption("WaypointMovementStopTimeForPlayer", 120); - m_int_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PRINT_MODE] = sConfigMgr->GetOption("DungeonAccessRequirements.PrintMode", 1); - m_bool_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PORTAL_CHECK_ILVL] = sConfigMgr->GetOption("DungeonAccessRequirements.PortalAvgIlevelCheck", false); - m_bool_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_LFG_DBC_LEVEL_OVERRIDE] = sConfigMgr->GetOption("DungeonAccessRequirements.LFGLevelDBCOverride", false); - m_int_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_OPTIONAL_STRING_ID] = sConfigMgr->GetOption("DungeonAccessRequirements.OptionalStringID", 0); - m_int_configs[CONFIG_NPC_EVADE_IF_NOT_REACHABLE] = sConfigMgr->GetOption("NpcEvadeIfTargetIsUnreachable", 5); - m_int_configs[CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID] = sConfigMgr->GetOption("NpcRegenHPTimeIfTargetIsUnreachable", 10); - m_bool_configs[CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID] = sConfigMgr->GetOption("NpcRegenHPIfTargetIsUnreachable", true); + _int_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PRINT_MODE] = sConfigMgr->GetOption("DungeonAccessRequirements.PrintMode", 1); + _bool_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PORTAL_CHECK_ILVL] = sConfigMgr->GetOption("DungeonAccessRequirements.PortalAvgIlevelCheck", false); + _bool_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_LFG_DBC_LEVEL_OVERRIDE] = sConfigMgr->GetOption("DungeonAccessRequirements.LFGLevelDBCOverride", false); + _int_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_OPTIONAL_STRING_ID] = sConfigMgr->GetOption("DungeonAccessRequirements.OptionalStringID", 0); + _int_configs[CONFIG_NPC_EVADE_IF_NOT_REACHABLE] = sConfigMgr->GetOption("NpcEvadeIfTargetIsUnreachable", 5); + _int_configs[CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID] = sConfigMgr->GetOption("NpcRegenHPTimeIfTargetIsUnreachable", 10); + _bool_configs[CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID] = sConfigMgr->GetOption("NpcRegenHPIfTargetIsUnreachable", true); //Debug - m_bool_configs[CONFIG_DEBUG_BATTLEGROUND] = sConfigMgr->GetOption("Debug.Battleground", false); - m_bool_configs[CONFIG_DEBUG_ARENA] = sConfigMgr->GetOption("Debug.Arena", false); + _bool_configs[CONFIG_DEBUG_BATTLEGROUND] = sConfigMgr->GetOption("Debug.Battleground", false); + _bool_configs[CONFIG_DEBUG_ARENA] = sConfigMgr->GetOption("Debug.Arena", false); - m_int_configs[CONFIG_GM_LEVEL_CHANNEL_MODERATION] = sConfigMgr->GetOption("Channel.ModerationGMLevel", 1); + _int_configs[CONFIG_GM_LEVEL_CHANNEL_MODERATION] = sConfigMgr->GetOption("Channel.ModerationGMLevel", 1); - m_bool_configs[CONFIG_SET_BOP_ITEM_TRADEABLE] = sConfigMgr->GetOption("Item.SetItemTradeable", true); + _bool_configs[CONFIG_SET_BOP_ITEM_TRADEABLE] = sConfigMgr->GetOption("Item.SetItemTradeable", true); // Specifies if IP addresses can be logged to the database - m_bool_configs[CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE] = sConfigMgr->GetOption("AllowLoggingIPAddressesInDatabase", true, true); + _bool_configs[CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE] = sConfigMgr->GetOption("AllowLoggingIPAddressesInDatabase", true, true); // LFG group mechanics. - m_int_configs[CONFIG_LFG_MAX_KICK_COUNT] = sConfigMgr->GetOption("LFG.MaxKickCount", 2); - if (m_int_configs[CONFIG_LFG_MAX_KICK_COUNT] > 3) + _int_configs[CONFIG_LFG_MAX_KICK_COUNT] = sConfigMgr->GetOption("LFG.MaxKickCount", 2); + if (_int_configs[CONFIG_LFG_MAX_KICK_COUNT] > 3) { - m_int_configs[CONFIG_LFG_MAX_KICK_COUNT] = 3; + _int_configs[CONFIG_LFG_MAX_KICK_COUNT] = 3; LOG_ERROR("server.loading", "LFG.MaxKickCount can't be higher than 3."); } - m_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = sConfigMgr->GetOption("LFG.KickPreventionTimer", 15 * MINUTE * IN_MILLISECONDS) * IN_MILLISECONDS; - if (m_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] > 15 * MINUTE * IN_MILLISECONDS) + _int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = sConfigMgr->GetOption("LFG.KickPreventionTimer", 15 * MINUTE * IN_MILLISECONDS) * IN_MILLISECONDS; + if (_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] > 15 * MINUTE * IN_MILLISECONDS) { - m_int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = 15 * MINUTE * IN_MILLISECONDS; + _int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = 15 * MINUTE * IN_MILLISECONDS; LOG_ERROR("server.loading", "LFG.KickPreventionTimer can't be higher than 15 minutes."); } // Realm Availability - m_bool_configs[CONFIG_REALM_LOGIN_ENABLED] = sConfigMgr->GetOption("World.RealmAvailability", true); + _bool_configs[CONFIG_REALM_LOGIN_ENABLED] = sConfigMgr->GetOption("World.RealmAvailability", true); // call ScriptMgr if we're reloading the configuration sScriptMgr->OnAfterConfigLoad(reload); @@ -1511,7 +1510,7 @@ void World::SetInitialWorldSettings() || !MapMgr::ExistMapAndVMap(0, 1676.35f, 1677.45f) || !MapMgr::ExistMapAndVMap(1, 10311.3f, 832.463f) || !MapMgr::ExistMapAndVMap(1, -2917.58f, -257.98f) - || (m_int_configs[CONFIG_EXPANSION] && ( + || (_int_configs[CONFIG_EXPANSION] && ( !MapMgr::ExistMapAndVMap(530, 10349.6f, -6357.29f) || !MapMgr::ExistMapAndVMap(530, -3961.64f, -13931.2f)))) { @@ -1550,11 +1549,11 @@ void World::SetInitialWorldSettings() ///- Load the DBC files LOG_INFO("server.loading", "Initialize Data Stores..."); - LoadDBCStores(m_dataPath); + LoadDBCStores(_dataPath); DetectDBCLang(); // Load cinematic cameras - LoadM2Cameras(m_dataPath); + LoadM2Cameras(_dataPath); // Load IP Location Database sIPLocation->Load(); @@ -1598,7 +1597,7 @@ void World::SetInitialWorldSettings() sSpellMgr->LoadSpellInfoCustomAttributes(); LOG_INFO("server.loading", "Loading GameObject Models..."); - LoadGameObjectModelList(m_dataPath); + LoadGameObjectModelList(_dataPath); LOG_INFO("server.loading", "Loading Script Names..."); sObjectMgr->LoadScriptNames(); @@ -2026,26 +2025,26 @@ void World::SetInitialWorldSettings() LoginDatabase.Execute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES ({}, {}, 0, '{}')", realm.Id.Realm, uint32(GameTime::GetStartTime().count()), GitRevision::GetFullVersion()); // One-time query - m_timers[WUPDATE_WEATHERS].SetInterval(1 * IN_MILLISECONDS); - m_timers[WUPDATE_AUCTIONS].SetInterval(MINUTE * IN_MILLISECONDS); - m_timers[WUPDATE_AUCTIONS].SetCurrent(MINUTE * IN_MILLISECONDS); - m_timers[WUPDATE_UPTIME].SetInterval(m_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_WEATHERS].SetInterval(1 * IN_MILLISECONDS); + _timers[WUPDATE_AUCTIONS].SetInterval(MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_AUCTIONS].SetCurrent(MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_UPTIME].SetInterval(_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE * IN_MILLISECONDS); //Update "uptime" table based on configuration entry in minutes. - m_timers[WUPDATE_CORPSES].SetInterval(20 * MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_CORPSES].SetInterval(20 * MINUTE * IN_MILLISECONDS); //erase corpses every 20 minutes - m_timers[WUPDATE_CLEANDB].SetInterval(m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]*MINUTE * IN_MILLISECONDS); + _timers[WUPDATE_CLEANDB].SetInterval(_int_configs[CONFIG_LOGDB_CLEARINTERVAL]*MINUTE * IN_MILLISECONDS); // clean logs table every 14 days by default - m_timers[WUPDATE_AUTOBROADCAST].SetInterval(getIntConfig(CONFIG_AUTOBROADCAST_INTERVAL)); + _timers[WUPDATE_AUTOBROADCAST].SetInterval(getIntConfig(CONFIG_AUTOBROADCAST_INTERVAL)); - m_timers[WUPDATE_PINGDB].SetInterval(getIntConfig(CONFIG_DB_PING_INTERVAL)*MINUTE * IN_MILLISECONDS); // Mysql ping time in minutes + _timers[WUPDATE_PINGDB].SetInterval(getIntConfig(CONFIG_DB_PING_INTERVAL)*MINUTE * IN_MILLISECONDS); // Mysql ping time in minutes // our speed up - m_timers[WUPDATE_5_SECS].SetInterval(5 * IN_MILLISECONDS); + _timers[WUPDATE_5_SECS].SetInterval(5 * IN_MILLISECONDS); - m_timers[WUPDATE_WHO_LIST].SetInterval(5 * IN_MILLISECONDS); // update who list cache every 5 seconds + _timers[WUPDATE_WHO_LIST].SetInterval(5 * IN_MILLISECONDS); // update who list cache every 5 seconds - mail_expire_check_timer = GameTime::GetGameTime() + 6h; + _mail_expire_check_timer = GameTime::GetGameTime() + 6h; ///- Initialize MapMgr LOG_INFO("server.loading", "Starting Map System"); @@ -2055,7 +2054,7 @@ void World::SetInitialWorldSettings() LOG_INFO("server.loading", "Starting Game Event system..."); LOG_INFO("server.loading", " "); uint32 nextGameEvent = sGameEventMgr->StartSystem(); - m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event + _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event // Delete all characters which have been deleted X days before Player::DeleteOldCharacters(); @@ -2190,14 +2189,14 @@ void World::DetectDBCLang() if (race->name[i][0] != '\0') // check by race names { default_locale = i; - m_availableDbcLocaleMask |= (1 << i); + _availableDbcLocaleMask |= (1 << i); availableLocalsStr += localeNames[i]; availableLocalsStr += " "; } } if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES && - (m_availableDbcLocaleMask & (1 << m_lang_confid))) + (_availableDbcLocaleMask & (1 << m_lang_confid))) { default_locale = m_lang_confid; } @@ -2208,7 +2207,7 @@ void World::DetectDBCLang() exit(1); } - m_defaultDbcLocale = LocaleConstant(default_locale); + _defaultDbcLocale = LocaleConstant(default_locale); LOG_INFO("server.loading", "Using {} DBC Locale As Default. All Available DBC locales: {}", localeNames[GetDefaultDbcLocale()], availableLocalsStr.empty() ? "" : availableLocalsStr); LOG_INFO("server.loading", " "); @@ -2218,8 +2217,8 @@ void World::LoadAutobroadcasts() { uint32 oldMSTime = getMSTime(); - m_Autobroadcasts.clear(); - m_AutobroadcastsWeights.clear(); + _autobroadcasts.clear(); + _autobroadcastsWeights.clear(); uint32 realmId = sConfigMgr->GetOption("RealmID", 0); LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_AUTOBROADCAST); @@ -2240,8 +2239,8 @@ void World::LoadAutobroadcasts() Field* fields = result->Fetch(); uint8 id = fields[0].Get(); - m_Autobroadcasts[id] = fields[2].Get(); - m_AutobroadcastsWeights[id] = fields[1].Get(); + _autobroadcasts[id] = fields[2].Get(); + _autobroadcastsWeights[id] = fields[1].Get(); ++count; } while (result->NextRow()); @@ -2269,16 +2268,16 @@ void World::Update(uint32 diff) ///- Update the different timers for (int i = 0; i < WUPDATE_COUNT; ++i) { - if (m_timers[i].GetCurrent() >= 0) - m_timers[i].Update(diff); + if (_timers[i].GetCurrent() >= 0) + _timers[i].Update(diff); else - m_timers[i].SetCurrent(0); + _timers[i].SetCurrent(0); } // pussywizard: our speed up and functionality - if (m_timers[WUPDATE_5_SECS].Passed()) + if (_timers[WUPDATE_5_SECS].Passed()) { - m_timers[WUPDATE_5_SECS].Reset(); + _timers[WUPDATE_5_SECS].Reset(); // moved here from HandleCharEnumOpcode CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_EXPIRED_BANS); @@ -2286,10 +2285,10 @@ void World::Update(uint32 diff) } ///- Update Who List Cache - if (m_timers[WUPDATE_WHO_LIST].Passed()) + if (_timers[WUPDATE_WHO_LIST].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update who list")); - m_timers[WUPDATE_WHO_LIST].Reset(); + _timers[WUPDATE_WHO_LIST].Reset(); sWhoListCacheMgr->Update(); } @@ -2297,37 +2296,37 @@ void World::Update(uint32 diff) METRIC_TIMER("world_update_time", METRIC_TAG("type", "Check quest reset times")); /// Handle daily quests reset time - if (currentGameTime > m_NextDailyQuestReset) + if (currentGameTime > _nextDailyQuestReset) { ResetDailyQuests(); } /// Handle weekly quests reset time - if (currentGameTime > m_NextWeeklyQuestReset) + if (currentGameTime > _nextWeeklyQuestReset) { ResetWeeklyQuests(); } /// Handle monthly quests reset time - if (currentGameTime > m_NextMonthlyQuestReset) + if (currentGameTime > _nextMonthlyQuestReset) { ResetMonthlyQuests(); } } - if (currentGameTime > m_NextRandomBGReset) + if (currentGameTime > _nextRandomBGReset) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Reset random BG")); ResetRandomBG(); } - if (currentGameTime > m_NextCalendarOldEventsDeletionTime) + if (currentGameTime > _nextCalendarOldEventsDeletionTime) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Delete old calendar events")); CalendarDeleteOldEvents(); } - if (currentGameTime > m_NextGuildReset) + if (currentGameTime > _nextGuildReset) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Reset guild cap")); ResetGuildCap(); @@ -2341,11 +2340,11 @@ void World::Update(uint32 diff) std::lock_guard guard(AsyncAuctionListingMgr::GetLock()); // pussywizard: handle auctions when the timer has passed - if (m_timers[WUPDATE_AUCTIONS].Passed()) + if (_timers[WUPDATE_AUCTIONS].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update expired auctions")); - m_timers[WUPDATE_AUCTIONS].Reset(); + _timers[WUPDATE_AUCTIONS].Reset(); // pussywizard: handle expired auctions, auctions expired when realm was offline are also handled here (not during loading when many required things aren't loaded yet) sAuctionMgr->Update(); @@ -2353,10 +2352,10 @@ void World::Update(uint32 diff) AsyncAuctionListingMgr::Update(diff); - if (currentGameTime > mail_expire_check_timer) + if (currentGameTime > _mail_expire_check_timer) { sObjectMgr->ReturnOrDeleteOldMails(true); - mail_expire_check_timer = currentGameTime + 6h; + _mail_expire_check_timer = currentGameTime + 6h; } { @@ -2370,20 +2369,20 @@ void World::Update(uint32 diff) AsyncAuctionListingMgr::SetAuctionListingAllowed(true); ///
  • Handle weather updates when the timer has passed - if (m_timers[WUPDATE_WEATHERS].Passed()) + if (_timers[WUPDATE_WEATHERS].Passed()) { - m_timers[WUPDATE_WEATHERS].Reset(); - WeatherMgr::Update(uint32(m_timers[WUPDATE_WEATHERS].GetInterval())); + _timers[WUPDATE_WEATHERS].Reset(); + WeatherMgr::Update(uint32(_timers[WUPDATE_WEATHERS].GetInterval())); } ///
  • Clean logs table if (sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer { - if (m_timers[WUPDATE_CLEANDB].Passed()) + if (_timers[WUPDATE_CLEANDB].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Clean logs table")); - m_timers[WUPDATE_CLEANDB].Reset(); + _timers[WUPDATE_CLEANDB].Reset(); LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_DEL_OLD_LOGS); stmt->SetData(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME)); @@ -2405,10 +2404,10 @@ void World::Update(uint32 diff) if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST)) { - if (m_timers[WUPDATE_AUTOBROADCAST].Passed()) + if (_timers[WUPDATE_AUTOBROADCAST].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Send autobroadcast")); - m_timers[WUPDATE_AUTOBROADCAST].Reset(); + _timers[WUPDATE_AUTOBROADCAST].Reset(); SendAutoBroadcast(); } } @@ -2440,11 +2439,11 @@ void World::Update(uint32 diff) } ///
  • Update uptime table - if (m_timers[WUPDATE_UPTIME].Passed()) + if (_timers[WUPDATE_UPTIME].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update uptime")); - m_timers[WUPDATE_UPTIME].Reset(); + _timers[WUPDATE_UPTIME].Reset(); LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_UPTIME_PLAYERS); stmt->SetData(0, uint32(GameTime::GetUptime().count())); @@ -2455,10 +2454,10 @@ void World::Update(uint32 diff) } ///- Erase corpses once every 20 minutes - if (m_timers[WUPDATE_CORPSES].Passed()) + if (_timers[WUPDATE_CORPSES].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Remove old corpses")); - m_timers[WUPDATE_CORPSES].Reset(); + _timers[WUPDATE_CORPSES].Reset(); sMapMgr->DoForAllMaps([](Map* map) { @@ -2467,20 +2466,20 @@ void World::Update(uint32 diff) } ///- Process Game events when necessary - if (m_timers[WUPDATE_EVENTS].Passed()) + if (_timers[WUPDATE_EVENTS].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update game events")); - m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed + _timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed uint32 nextGameEvent = sGameEventMgr->Update(); - m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); - m_timers[WUPDATE_EVENTS].Reset(); + _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); + _timers[WUPDATE_EVENTS].Reset(); } ///- Ping to keep MySQL connections alive - if (m_timers[WUPDATE_PINGDB].Passed()) + if (_timers[WUPDATE_PINGDB].Passed()) { METRIC_TIMER("world_update_time", METRIC_TAG("type", "Ping MySQL")); - m_timers[WUPDATE_PINGDB].Reset(); + _timers[WUPDATE_PINGDB].Reset(); LOG_DEBUG("sql.driver", "Ping MySQL to keep connection alive"); CharacterDatabase.KeepAlive(); LoginDatabase.KeepAlive(); @@ -2519,17 +2518,17 @@ void World::Update(uint32 diff) void World::ForceGameEventUpdate() { - m_timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed + _timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed uint32 nextGameEvent = sGameEventMgr->Update(); - m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); - m_timers[WUPDATE_EVENTS].Reset(); + _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); + _timers[WUPDATE_EVENTS].Reset(); } /// Send a packet to all players (except self if mentioned) void World::SendGlobalMessage(WorldPacket const* packet, WorldSession* self, TeamId teamId) { SessionMap::const_iterator itr; - for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (itr = _sessions.begin(); itr != _sessions.end(); ++itr) { if (itr->second && itr->second->GetPlayer() && @@ -2546,7 +2545,7 @@ void World::SendGlobalMessage(WorldPacket const* packet, WorldSession* self, Tea void World::SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self, TeamId teamId) { SessionMap::iterator itr; - for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (itr = _sessions.begin(); itr != _sessions.end(); ++itr) { if (itr->second && itr->second->GetPlayer() && @@ -2612,7 +2611,7 @@ void World::SendWorldText(uint32 string_id, ...) Acore::WorldWorldTextBuilder wt_builder(string_id, &ap); Acore::LocalizedPacketListDo wt_do(wt_builder); - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) { if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld()) continue; @@ -2630,7 +2629,7 @@ void World::SendWorldTextOptional(uint32 string_id, uint32 flag, ...) Acore::WorldWorldTextBuilder wt_builder(string_id, &ap); Acore::LocalizedPacketListDo wt_do(wt_builder); - for (auto const& itr : m_sessions) + for (auto const& itr : _sessions) { if (!itr.second || !itr.second->GetPlayer() || !itr.second->GetPlayer()->IsInWorld()) { @@ -2659,7 +2658,7 @@ void World::SendGMText(uint32 string_id, ...) Acore::WorldWorldTextBuilder wt_builder(string_id, &ap); Acore::LocalizedPacketListDo wt_do(wt_builder); - for (SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) { // Session should have permissions to receive global gm messages WorldSession* session = itr->second; @@ -2701,7 +2700,7 @@ bool World::SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession bool foundPlayerToSend = false; SessionMap::const_iterator itr; - for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (itr = _sessions.begin(); itr != _sessions.end(); ++itr) { if (itr->second && itr->second->GetPlayer() && @@ -2729,14 +2728,14 @@ void World::SendZoneText(uint32 zone, const char* text, WorldSession* self, Team /// Kick (and save) all players void World::KickAll() { - m_QueuedPlayer.clear(); // prevent send queue update packet and login queued sessions + _queuedPlayer.clear(); // prevent send queue update packet and login queued sessions // session not removed at kick and will removed in next update tick - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) itr->second->KickPlayer("KickAll sessions"); // pussywizard: kick offline sessions - for (SessionMap::const_iterator itr = m_offlineSessions.begin(); itr != m_offlineSessions.end(); ++itr) + for (SessionMap::const_iterator itr = _offlineSessions.begin(); itr != _offlineSessions.end(); ++itr) itr->second->KickPlayer("KickAll offline sessions"); } @@ -2744,7 +2743,7 @@ void World::KickAll() void World::KickAllLess(AccountTypes sec) { // session not removed at kick and will removed in next update tick - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second->GetSecurity() < sec) itr->second->KickPlayer("KickAllLess"); } @@ -2759,20 +2758,20 @@ void World::_UpdateGameTime() Seconds elapsed = GameTime::GetGameTime() - lastGameTime; ///- if there is a shutdown timer - if (!IsStopped() && m_ShutdownTimer > 0 && elapsed > 0s) + if (!IsStopped() && _shutdownTimer > 0 && elapsed > 0s) { ///- ... and it is overdue, stop the world (set m_stopEvent) - if (m_ShutdownTimer <= elapsed.count()) + if (_shutdownTimer <= elapsed.count()) { - if (!(m_ShutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0) - m_stopEvent = true; // exist code already set + if (!(_shutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0) + _stopEvent = true; // exist code already set else - m_ShutdownTimer = 1; // minimum timer value to wait idle state + _shutdownTimer = 1; // minimum timer value to wait idle state } ///- ... else decrease it and if necessary display a shutdown countdown to the users else { - m_ShutdownTimer -= elapsed.count(); + _shutdownTimer -= elapsed.count(); ShutdownMsg(); } @@ -2786,8 +2785,8 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std: if (IsStopped()) return; - m_ShutdownMask = options; - m_ExitCode = exitcode; + _shutdownMask = options; + _exitCode = exitcode; auto const& playersOnline = GetActiveSessionCount(); @@ -2820,14 +2819,14 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std: if (time == 0) { if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0) - m_stopEvent = true; // exist code already set + _stopEvent = true; // exist code already set else - m_ShutdownTimer = 1; //So that the session count is re-evaluated at next world tick + _shutdownTimer = 1; //So that the session count is re-evaluated at next world tick } ///- Else set the shutdown timer and warn users else { - m_ShutdownTimer = time; + _shutdownTimer = time; ShutdownMsg(true, nullptr, reason); } @@ -2838,28 +2837,28 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std: void World::ShutdownMsg(bool show, Player* player, const std::string& reason) { // not show messages for idle shutdown mode - if (m_ShutdownMask & SHUTDOWN_MASK_IDLE) + if (_shutdownMask & SHUTDOWN_MASK_IDLE) return; ///- Display a message every 12 hours, hours, 5 minutes, minute, 5 seconds and finally seconds if (show || - (m_ShutdownTimer < 5 * MINUTE && (m_ShutdownTimer % 15) == 0) || // < 5 min; every 15 sec - (m_ShutdownTimer < 15 * MINUTE && (m_ShutdownTimer % MINUTE) == 0) || // < 15 min ; every 1 min - (m_ShutdownTimer < 30 * MINUTE && (m_ShutdownTimer % (5 * MINUTE)) == 0) || // < 30 min ; every 5 min - (m_ShutdownTimer < 12 * HOUR && (m_ShutdownTimer % HOUR) == 0) || // < 12 h ; every 1 h - (m_ShutdownTimer > 12 * HOUR && (m_ShutdownTimer % (12 * HOUR)) == 0)) // > 12 h ; every 12 h + (_shutdownTimer < 5 * MINUTE && (_shutdownTimer % 15) == 0) || // < 5 min; every 15 sec + (_shutdownTimer < 15 * MINUTE && (_shutdownTimer % MINUTE) == 0) || // < 15 min ; every 1 min + (_shutdownTimer < 30 * MINUTE && (_shutdownTimer % (5 * MINUTE)) == 0) || // < 30 min ; every 5 min + (_shutdownTimer < 12 * HOUR && (_shutdownTimer % HOUR) == 0) || // < 12 h ; every 1 h + (_shutdownTimer > 12 * HOUR && (_shutdownTimer % (12 * HOUR)) == 0)) // > 12 h ; every 12 h { - std::string str = secsToTimeString(m_ShutdownTimer).append("."); + std::string str = secsToTimeString(_shutdownTimer).append("."); if (!reason.empty()) { str += " - " + reason; } - ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME; + ServerMessageType msgid = (_shutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_TIME : SERVER_MSG_SHUTDOWN_TIME; SendServerMessage(msgid, str, player); - LOG_DEBUG("server.worldserver", "Server is {} in {}", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str); + LOG_DEBUG("server.worldserver", "Server is {} in {}", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str); } } @@ -2867,17 +2866,17 @@ void World::ShutdownMsg(bool show, Player* player, const std::string& reason) void World::ShutdownCancel() { // nothing cancel or too later - if (!m_ShutdownTimer || m_stopEvent) + if (!_shutdownTimer || _stopEvent) return; - ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; + ServerMessageType msgid = (_shutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED; - m_ShutdownMask = 0; - m_ShutdownTimer = 0; - m_ExitCode = SHUTDOWN_EXIT_CODE; // to default value + _shutdownMask = 0; + _shutdownTimer = 0; + _exitCode = SHUTDOWN_EXIT_CODE; // to default value SendServerMessage(msgid); - LOG_DEBUG("server.worldserver", "Server {} cancelled.", (m_ShutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); + LOG_DEBUG("server.worldserver", "Server {} cancelled.", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown")); sScriptMgr->OnShutdownCancel(); } @@ -2905,14 +2904,14 @@ void World::UpdateSessions(uint32 diff) ///- Add new sessions WorldSession* sess = nullptr; - while (addSessQueue.next(sess)) + while (_addSessQueue.next(sess)) { AddSession_(sess); } } ///- Then send an update signal to remaining ones - for (SessionMap::iterator itr = m_sessions.begin(), next; itr != m_sessions.end(); itr = next) + for (SessionMap::iterator itr = _sessions.begin(), next; itr != _sessions.end(); itr = next) { next = itr; ++next; @@ -2925,19 +2924,19 @@ void World::UpdateSessions(uint32 diff) if (pSession->HandleSocketClosed()) { if (!RemoveQueuedPlayer(pSession) && getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE)) - m_disconnects[pSession->GetAccountId()] = GameTime::GetGameTime().count(); - m_sessions.erase(itr); + _disconnects[pSession->GetAccountId()] = GameTime::GetGameTime().count(); + _sessions.erase(itr); // there should be no offline session if current one is logged onto a character SessionMap::iterator iter; - if ((iter = m_offlineSessions.find(pSession->GetAccountId())) != m_offlineSessions.end()) + if ((iter = _offlineSessions.find(pSession->GetAccountId())) != _offlineSessions.end()) { WorldSession* tmp = iter->second; - m_offlineSessions.erase(iter); + _offlineSessions.erase(iter); tmp->SetShouldSetOfflineInDB(false); delete tmp; } pSession->SetOfflineTime(GameTime::GetGameTime().count()); - m_offlineSessions[pSession->GetAccountId()] = pSession; + _offlineSessions[pSession->GetAccountId()] = pSession; continue; } @@ -2947,27 +2946,27 @@ void World::UpdateSessions(uint32 diff) if (!pSession->Update(diff, updater)) { if (!RemoveQueuedPlayer(pSession) && getIntConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE)) - m_disconnects[pSession->GetAccountId()] = GameTime::GetGameTime().count(); - m_sessions.erase(itr); - if (m_offlineSessions.find(pSession->GetAccountId()) != m_offlineSessions.end()) // pussywizard: don't set offline in db because offline session for that acc is present (character is in world) + _disconnects[pSession->GetAccountId()] = GameTime::GetGameTime().count(); + _sessions.erase(itr); + if (_offlineSessions.find(pSession->GetAccountId()) != _offlineSessions.end()) // pussywizard: don't set offline in db because offline session for that acc is present (character is in world) pSession->SetShouldSetOfflineInDB(false); delete pSession; } } // pussywizard: - if (m_offlineSessions.empty()) + if (_offlineSessions.empty()) return; uint32 currTime = GameTime::GetGameTime().count(); - for (SessionMap::iterator itr = m_offlineSessions.begin(), next; itr != m_offlineSessions.end(); itr = next) + for (SessionMap::iterator itr = _offlineSessions.begin(), next; itr != _offlineSessions.end(); itr = next) { next = itr; ++next; WorldSession* pSession = itr->second; if (!pSession->GetPlayer() || pSession->GetOfflineTime() + 60 < currTime || pSession->IsKicked()) { - m_offlineSessions.erase(itr); - if (m_sessions.find(pSession->GetAccountId()) != m_sessions.end()) + _offlineSessions.erase(itr); + if (_sessions.find(pSession->GetAccountId()) != _sessions.end()) pSession->SetShouldSetOfflineInDB(false); // pussywizard: don't set offline in db because new session for that acc is already created delete pSession; } @@ -2980,7 +2979,7 @@ void World::ProcessCliCommands() CliCommandHolder::Print zprint = nullptr; void* callbackArg = nullptr; CliCommandHolder* command = nullptr; - while (cliCmdQueue.next(command)) + while (_cliCmdQueue.next(command)) { LOG_DEBUG("server.worldserver", "CLI command under processing..."); zprint = command->m_print; @@ -2995,7 +2994,7 @@ void World::ProcessCliCommands() void World::SendAutoBroadcast() { - if (m_Autobroadcasts.empty()) + if (_autobroadcasts.empty()) return; uint32 weight = 0; @@ -3003,7 +3002,7 @@ void World::SendAutoBroadcast() std::string msg; - for (AutobroadcastsWeightMap::const_iterator it = m_AutobroadcastsWeights.begin(); it != m_AutobroadcastsWeights.end(); ++it) + for (AutobroadcastsWeightMap::const_iterator it = _autobroadcastsWeights.begin(); it != _autobroadcastsWeights.end(); ++it) { if (it->second) { @@ -3021,13 +3020,13 @@ void World::SendAutoBroadcast() weight += it->second; if (selectedWeight < weight) { - msg = m_Autobroadcasts[it->first]; + msg = _autobroadcasts[it->first]; break; } } } else - msg = m_Autobroadcasts[urand(0, m_Autobroadcasts.size())]; + msg = _autobroadcasts[urand(0, _autobroadcasts.size())]; uint32 abcenter = sWorld->getIntConfig(CONFIG_AUTOBROADCAST_CENTER); @@ -3085,44 +3084,44 @@ void World::_UpdateRealmCharCount(PreparedQueryResult resultCharCount) void World::InitWeeklyQuestResetTime() { Seconds wstime = Seconds(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME)); - m_NextWeeklyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6)); + _nextWeeklyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, m_NextWeeklyQuestReset.count()); + sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count()); } } void World::InitDailyQuestResetTime() { Seconds wstime = Seconds(sWorld->getWorldState(WS_DAILY_QUEST_RESET_TIME)); - m_NextDailyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + _nextDailyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, m_NextDailyQuestReset.count()); + sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count()); } } void World::InitMonthlyQuestResetTime() { Seconds wstime = Seconds(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME)); - m_NextMonthlyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + _nextMonthlyQuestReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, m_NextMonthlyQuestReset.count()); + sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count()); } } void World::InitRandomBGResetTime() { Seconds wstime = Seconds(sWorld->getWorldState(WS_BG_DAILY_RESET_TIME)); - m_NextRandomBGReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + _nextRandomBGReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, m_NextRandomBGReset.count()); + sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count()); } } @@ -3135,27 +3134,27 @@ void World::InitCalendarOldEventsDeletionTime() // In this case we set the reset time in the past and next world update will do the reset and schedule next one in the future. if (currentDeletionTime < GameTime::GetGameTime()) { - m_NextCalendarOldEventsDeletionTime = nextDeletionTime - 1_days; + _nextCalendarOldEventsDeletionTime = nextDeletionTime - 1_days; } else { - m_NextCalendarOldEventsDeletionTime = nextDeletionTime; + _nextCalendarOldEventsDeletionTime = nextDeletionTime; } if (currentDeletionTime == 0s) { - sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, m_NextCalendarOldEventsDeletionTime.count()); + sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, _nextCalendarOldEventsDeletionTime.count()); } } void World::InitGuildResetTime() { Seconds wstime = Seconds(getWorldState(WS_GUILD_DAILY_RESET_TIME)); - m_NextGuildReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + _nextGuildReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); if (wstime == 0s) { - sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, m_NextGuildReset.count()); + sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count()); } } @@ -3164,12 +3163,12 @@ void World::ResetDailyQuests() CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_DAILY); CharacterDatabase.Execute(stmt); - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second->GetPlayer()) itr->second->GetPlayer()->ResetDailyQuestStatus(); - m_NextDailyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); - sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, m_NextDailyQuestReset.count()); + _nextDailyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count()); // change available dailies sPoolMgr->ChangeDailyQuests(); @@ -3188,10 +3187,10 @@ void World::LoadDBAllowedSecurityLevel() void World::SetPlayerSecurityLimit(AccountTypes _sec) { AccountTypes sec = _sec < SEC_CONSOLE ? _sec : SEC_PLAYER; - bool update = sec > m_allowedSecurityLevel; - m_allowedSecurityLevel = sec; + bool update = sec > _allowedSecurityLevel; + _allowedSecurityLevel = sec; if (update) - KickAllLess(m_allowedSecurityLevel); + KickAllLess(_allowedSecurityLevel); } void World::ResetWeeklyQuests() @@ -3199,12 +3198,12 @@ void World::ResetWeeklyQuests() CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_WEEKLY); CharacterDatabase.Execute(stmt); - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second->GetPlayer()) itr->second->GetPlayer()->ResetWeeklyQuestStatus(); - m_NextWeeklyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6)); - sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, m_NextWeeklyQuestReset.count()); + _nextWeeklyQuestReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(4, 6)); + sWorld->setWorldState(WS_WEEKLY_QUEST_RESET_TIME, _nextWeeklyQuestReset.count()); // change available weeklies sPoolMgr->ChangeWeeklyQuests(); @@ -3217,12 +3216,12 @@ void World::ResetMonthlyQuests() CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_MONTHLY); CharacterDatabase.Execute(stmt); - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second->GetPlayer()) itr->second->GetPlayer()->ResetMonthlyQuestStatus(); - m_NextMonthlyQuestReset = Seconds(Acore::Time::GetNextTimeWithMonthAndHour(-1, 6)); - sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, m_NextMonthlyQuestReset.count()); + _nextMonthlyQuestReset = Seconds(Acore::Time::GetNextTimeWithMonthAndHour(-1, 6)); + sWorld->setWorldState(WS_MONTHLY_QUEST_RESET_TIME, _nextMonthlyQuestReset.count()); } void World::ResetEventSeasonalQuests(uint16 event_id) @@ -3231,7 +3230,7 @@ void World::ResetEventSeasonalQuests(uint16 event_id) stmt->SetData(0, event_id); CharacterDatabase.Execute(stmt); - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second->GetPlayer()) itr->second->GetPlayer()->ResetSeasonalQuestStatus(event_id); } @@ -3243,20 +3242,20 @@ void World::ResetRandomBG() CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_BATTLEGROUND_RANDOM); CharacterDatabase.Execute(stmt); - for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second->GetPlayer()) itr->second->GetPlayer()->SetRandomWinner(false); - m_NextRandomBGReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); - sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, m_NextRandomBGReset.count()); + _nextRandomBGReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count()); } void World::CalendarDeleteOldEvents() { LOG_INFO("server.worldserver", "Calendar deletion of old events."); - m_NextCalendarOldEventsDeletionTime += 1_days; - sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, m_NextCalendarOldEventsDeletionTime.count()); + _nextCalendarOldEventsDeletionTime += 1_days; + sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, _nextCalendarOldEventsDeletionTime.count()); sCalendarMgr->DeleteOldEvents(); } @@ -3264,16 +3263,16 @@ void World::ResetGuildCap() { LOG_INFO("server.worldserver", "Guild Daily Cap reset."); - m_NextGuildReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); - sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, m_NextGuildReset.count()); + _nextGuildReset = Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6)); + sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count()); sGuildMgr->ResetTimes(); } void World::UpdateMaxSessionCounters() { - m_maxActiveSessionCount = std::max(m_maxActiveSessionCount, uint32(m_sessions.size() - m_QueuedPlayer.size())); - m_maxQueuedSessionCount = std::max(m_maxQueuedSessionCount, uint32(m_QueuedPlayer.size())); + _maxActiveSessionCount = std::max(_maxActiveSessionCount, uint32(_sessions.size() - _queuedPlayer.size())); + _maxQueuedSessionCount = std::max(_maxQueuedSessionCount, uint32(_queuedPlayer.size())); } void World::LoadDBVersion() @@ -3283,20 +3282,20 @@ void World::LoadDBVersion() { Field* fields = result->Fetch(); - m_DBVersion = fields[0].Get(); + _dbVersion = fields[0].Get(); // will be overwrite by config values if different and non-0 - m_int_configs[CONFIG_CLIENTCACHE_VERSION] = fields[1].Get(); + _int_configs[CONFIG_CLIENTCACHE_VERSION] = fields[1].Get(); } - if (m_DBVersion.empty()) - m_DBVersion = "Unknown world database."; + if (_dbVersion.empty()) + _dbVersion = "Unknown world database."; } void World::UpdateAreaDependentAuras() { SessionMap::const_iterator itr; - for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr) + for (itr = _sessions.begin(); itr != _sessions.end(); ++itr) if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld()) { itr->second->GetPlayer()->UpdateAreaDependentAuras(itr->second->GetPlayer()->GetAreaId()); @@ -3320,18 +3319,18 @@ void World::LoadWorldStates() do { Field* fields = result->Fetch(); - m_worldstates[fields[0].Get()] = fields[1].Get(); + _worldstates[fields[0].Get()] = fields[1].Get(); } while (result->NextRow()); - LOG_INFO("server.loading", ">> Loaded {} World States in {} ms", m_worldstates.size(), GetMSTimeDiffToNow(oldMSTime)); + LOG_INFO("server.loading", ">> Loaded {} World States in {} ms", _worldstates.size(), GetMSTimeDiffToNow(oldMSTime)); LOG_INFO("server.loading", " "); } // Setting a worldstate will save it to DB void World::setWorldState(uint32 index, uint64 timeValue) { - auto const& it = m_worldstates.find(index); - if (it != m_worldstates.end()) + auto const& it = _worldstates.find(index); + if (it != _worldstates.end()) { CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_WORLDSTATE); stmt->SetData(0, uint32(timeValue)); @@ -3346,13 +3345,13 @@ void World::setWorldState(uint32 index, uint64 timeValue) CharacterDatabase.Execute(stmt); } - m_worldstates[index] = timeValue; + _worldstates[index] = timeValue; } uint64 World::getWorldState(uint32 index) const { - auto const& itr = m_worldstates.find(index); - return itr != m_worldstates.end() ? itr->second : 0; + auto const& itr = _worldstates.find(index); + return itr != _worldstates.end() ? itr->second : 0; } void World::ProcessQueryCallbacks() @@ -3362,7 +3361,7 @@ void World::ProcessQueryCallbacks() void World::RemoveOldCorpses() { - m_timers[WUPDATE_CORPSES].SetCurrent(m_timers[WUPDATE_CORPSES].GetInterval()); + _timers[WUPDATE_CORPSES].SetCurrent(_timers[WUPDATE_CORPSES].GetInterval()); } bool World::IsPvPRealm() const @@ -3377,11 +3376,11 @@ bool World::IsFFAPvPRealm() const uint32 World::GetNextWhoListUpdateDelaySecs() { - if (m_timers[WUPDATE_5_SECS].Passed()) + if (_timers[WUPDATE_5_SECS].Passed()) return 1; - uint32 t = m_timers[WUPDATE_5_SECS].GetInterval() - m_timers[WUPDATE_5_SECS].GetCurrent(); - t = std::min(t, (uint32)m_timers[WUPDATE_5_SECS].GetInterval()); + uint32 t = _timers[WUPDATE_5_SECS].GetInterval() - _timers[WUPDATE_5_SECS].GetCurrent(); + t = std::min(t, (uint32)_timers[WUPDATE_5_SECS].GetInterval()); return uint32(std::ceil(t / 1000.0f)); } diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h index 7e7380d56..20ce7f137 100644 --- a/src/server/game/World/World.h +++ b/src/server/game/World/World.h @@ -167,24 +167,24 @@ public: bool KickSession(uint32 id) override; /// Get the number of current active sessions void UpdateMaxSessionCounters() override; - [[nodiscard]] const SessionMap& GetAllSessions() const override { return m_sessions; } - [[nodiscard]] uint32 GetActiveAndQueuedSessionCount() const override { return m_sessions.size(); } - [[nodiscard]] uint32 GetActiveSessionCount() const override { return m_sessions.size() - m_QueuedPlayer.size(); } - [[nodiscard]] uint32 GetQueuedSessionCount() const override { return m_QueuedPlayer.size(); } + [[nodiscard]] const SessionMap& GetAllSessions() const override { return _sessions; } + [[nodiscard]] uint32 GetActiveAndQueuedSessionCount() const override { return _sessions.size(); } + [[nodiscard]] uint32 GetActiveSessionCount() const override { return _sessions.size() - _queuedPlayer.size(); } + [[nodiscard]] uint32 GetQueuedSessionCount() const override { return _queuedPlayer.size(); } /// Get the maximum number of parallel sessions on the server since last reboot - [[nodiscard]] uint32 GetMaxQueuedSessionCount() const override { return m_maxQueuedSessionCount; } - [[nodiscard]] uint32 GetMaxActiveSessionCount() const override { return m_maxActiveSessionCount; } + [[nodiscard]] uint32 GetMaxQueuedSessionCount() const override { return _maxQueuedSessionCount; } + [[nodiscard]] uint32 GetMaxActiveSessionCount() const override { return _maxActiveSessionCount; } /// Get number of players - [[nodiscard]] inline uint32 GetPlayerCount() const override { return m_PlayerCount; } - [[nodiscard]] inline uint32 GetMaxPlayerCount() const override { return m_MaxPlayerCount; } + [[nodiscard]] inline uint32 GetPlayerCount() const override { return _playerCount; } + [[nodiscard]] inline uint32 GetMaxPlayerCount() const override { return _maxPlayerCount; } /// Increase/Decrease number of players inline void IncreasePlayerCount() override { - m_PlayerCount++; - m_MaxPlayerCount = std::max(m_MaxPlayerCount, m_PlayerCount); + _playerCount++; + _maxPlayerCount = std::max(_maxPlayerCount, _playerCount); } - inline void DecreasePlayerCount() override { m_PlayerCount--; } + inline void DecreasePlayerCount() override { _playerCount--; } Player* FindPlayerInZone(uint32 zone) override; @@ -195,13 +195,13 @@ public: void SetClosed(bool val) override; /// Security level limitations - [[nodiscard]] AccountTypes GetPlayerSecurityLimit() const override { return m_allowedSecurityLevel; } + [[nodiscard]] AccountTypes GetPlayerSecurityLimit() const override { return _allowedSecurityLevel; } void SetPlayerSecurityLimit(AccountTypes sec) override; void LoadDBAllowedSecurityLevel() override; /// Active session server limit - void SetPlayerAmountLimit(uint32 limit) override { m_playerLimit = limit; } - [[nodiscard]] uint32 GetPlayerAmountLimit() const override { return m_playerLimit; } + void SetPlayerAmountLimit(uint32 limit) override { _playerLimit = limit; } + [[nodiscard]] uint32 GetPlayerAmountLimit() const override { return _playerLimit; } //player Queue typedef std::list Queue; @@ -212,24 +212,24 @@ public: /// \todo Actions on m_allowMovement still to be implemented /// Is movement allowed? - [[nodiscard]] bool getAllowMovement() const override { return m_allowMovement; } + [[nodiscard]] bool getAllowMovement() const override { return _allowMovement; } /// Allow/Disallow object movements - void SetAllowMovement(bool allow) override { m_allowMovement = allow; } + void SetAllowMovement(bool allow) override { _allowMovement = allow; } /// Set the string for new characters (first login) - void SetNewCharString(std::string const& str) override { m_newCharString = str; } + void SetNewCharString(std::string const& str) override { _newCharString = str; } /// Get the string for new characters (first login) - [[nodiscard]] std::string const& GetNewCharString() const override { return m_newCharString; } + [[nodiscard]] std::string const& GetNewCharString() const override { return _newCharString; } - [[nodiscard]] LocaleConstant GetDefaultDbcLocale() const override { return m_defaultDbcLocale; } + [[nodiscard]] LocaleConstant GetDefaultDbcLocale() const override { return _defaultDbcLocale; } /// Get the path where data (dbc, maps) are stored on disk - [[nodiscard]] std::string const& GetDataPath() const override { return m_dataPath; } + [[nodiscard]] std::string const& GetDataPath() const override { return _dataPath; } /// Next daily quests and random bg reset time - [[nodiscard]] Seconds GetNextDailyQuestsResetTime() const override { return m_NextDailyQuestReset; } - [[nodiscard]] Seconds GetNextWeeklyQuestsResetTime() const override { return m_NextWeeklyQuestReset; } - [[nodiscard]] Seconds GetNextRandomBGResetTime() const override { return m_NextRandomBGReset; } + [[nodiscard]] Seconds GetNextDailyQuestsResetTime() const override { return _nextDailyQuestReset; } + [[nodiscard]] Seconds GetNextWeeklyQuestsResetTime() const override { return _nextWeeklyQuestReset; } + [[nodiscard]] Seconds GetNextRandomBGResetTime() const override { return _nextRandomBGReset; } /// Get the maximum skill level a player can reach [[nodiscard]] uint16 GetConfigMaxSkillValue() const override @@ -253,60 +253,60 @@ public: void SendWorldTextOptional(uint32 string_id, uint32 flag, ...) override; /// Are we in the middle of a shutdown? - [[nodiscard]] bool IsShuttingDown() const override { return m_ShutdownTimer > 0; } - [[nodiscard]] uint32 GetShutDownTimeLeft() const override { return m_ShutdownTimer; } + [[nodiscard]] bool IsShuttingDown() const override { return _shutdownTimer > 0; } + [[nodiscard]] uint32 GetShutDownTimeLeft() const override { return _shutdownTimer; } void ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason = std::string()) override; void ShutdownCancel() override; void ShutdownMsg(bool show = false, Player* player = nullptr, const std::string& reason = std::string()) override; - static uint8 GetExitCode() { return m_ExitCode; } - static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; } - static bool IsStopped() { return m_stopEvent; } + static uint8 GetExitCode() { return _exitCode; } + static void StopNow(uint8 exitcode) { _stopEvent = true; _exitCode = exitcode; } + static bool IsStopped() { return _stopEvent; } void Update(uint32 diff) override; void UpdateSessions(uint32 diff) override; /// Set a server rate (see #Rates) - void setRate(Rates rate, float value) override { rate_values[rate] = value; } + void setRate(Rates rate, float value) override { _rate_values[rate] = value; } /// Get a server rate (see #Rates) - [[nodiscard]] float getRate(Rates rate) const override { return rate_values[rate]; } + [[nodiscard]] float getRate(Rates rate) const override { return _rate_values[rate]; } /// Set a server configuration element (see #WorldConfigs) void setBoolConfig(WorldBoolConfigs index, bool value) override { if (index < BOOL_CONFIG_VALUE_COUNT) - m_bool_configs[index] = value; + _bool_configs[index] = value; } /// Get a server configuration element (see #WorldConfigs) [[nodiscard]] bool getBoolConfig(WorldBoolConfigs index) const override { - return index < BOOL_CONFIG_VALUE_COUNT ? m_bool_configs[index] : false; + return index < BOOL_CONFIG_VALUE_COUNT ? _bool_configs[index] : false; } /// Set a server configuration element (see #WorldConfigs) void setFloatConfig(WorldFloatConfigs index, float value) override { if (index < FLOAT_CONFIG_VALUE_COUNT) - m_float_configs[index] = value; + _float_configs[index] = value; } /// Get a server configuration element (see #WorldConfigs) [[nodiscard]] float getFloatConfig(WorldFloatConfigs index) const override { - return index < FLOAT_CONFIG_VALUE_COUNT ? m_float_configs[index] : 0; + return index < FLOAT_CONFIG_VALUE_COUNT ? _float_configs[index] : 0; } /// Set a server configuration element (see #WorldConfigs) void setIntConfig(WorldIntConfigs index, uint32 value) override { if (index < INT_CONFIG_VALUE_COUNT) - m_int_configs[index] = value; + _int_configs[index] = value; } /// Get a server configuration element (see #WorldConfigs) [[nodiscard]] uint32 getIntConfig(WorldIntConfigs index) const override { - return index < INT_CONFIG_VALUE_COUNT ? m_int_configs[index] : 0; + return index < INT_CONFIG_VALUE_COUNT ? _int_configs[index] : 0; } void setWorldState(uint32 index, uint64 value) override; @@ -321,32 +321,32 @@ public: void KickAllLess(AccountTypes sec) override; // for max speed access - static float GetMaxVisibleDistanceOnContinents() { return m_MaxVisibleDistanceOnContinents; } - static float GetMaxVisibleDistanceInInstances() { return m_MaxVisibleDistanceInInstances; } - static float GetMaxVisibleDistanceInBGArenas() { return m_MaxVisibleDistanceInBGArenas; } + static float GetMaxVisibleDistanceOnContinents() { return _maxVisibleDistanceOnContinents; } + static float GetMaxVisibleDistanceInInstances() { return _maxVisibleDistanceInInstances; } + static float GetMaxVisibleDistanceInBGArenas() { return _maxVisibleDistanceInBGArenas; } // our: needed for arena spectator subscriptions uint32 GetNextWhoListUpdateDelaySecs() override; void ProcessCliCommands() override; - void QueueCliCommand(CliCommandHolder* commandHolder) override { cliCmdQueue.add(commandHolder); } + void QueueCliCommand(CliCommandHolder* commandHolder) override { _cliCmdQueue.add(commandHolder); } void ForceGameEventUpdate() override; void UpdateRealmCharCount(uint32 accid) override; - [[nodiscard]] LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const override { if (m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; } + [[nodiscard]] LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const override { if (_availableDbcLocaleMask & (1 << locale)) return locale; else return _defaultDbcLocale; } // used World DB version void LoadDBVersion() override; - [[nodiscard]] char const* GetDBVersion() const override { return m_DBVersion.c_str(); } + [[nodiscard]] char const* GetDBVersion() const override { return _dbVersion.c_str(); } void LoadAutobroadcasts() override; void UpdateAreaDependentAuras() override; - [[nodiscard]] uint32 GetCleaningFlags() const override { return m_CleaningFlags; } - void SetCleaningFlags(uint32 flags) override { m_CleaningFlags = flags; } + [[nodiscard]] uint32 GetCleaningFlags() const override { return _cleaningFlags; } + void SetCleaningFlags(uint32 flags) override { _cleaningFlags = flags; } void ResetEventSeasonalQuests(uint16 event_id) override; [[nodiscard]] std::string const& GetRealmName() const override { return _realmName; } // pussywizard @@ -372,76 +372,76 @@ protected: void CalendarDeleteOldEvents(); void ResetGuildCap(); private: - static std::atomic_long m_stopEvent; - static uint8 m_ExitCode; - uint32 m_ShutdownTimer; - uint32 m_ShutdownMask; + static std::atomic_long _stopEvent; + static uint8 _exitCode; + uint32 _shutdownTimer; + uint32 _shutdownMask; - uint32 m_CleaningFlags; + uint32 _cleaningFlags; - bool m_isClosed; + bool _isClosed; - IntervalTimer m_timers[WUPDATE_COUNT]; - Seconds mail_expire_check_timer; + IntervalTimer _timers[WUPDATE_COUNT]; + Seconds _mail_expire_check_timer; - SessionMap m_sessions; - SessionMap m_offlineSessions; + SessionMap _sessions; + SessionMap _offlineSessions; typedef std::unordered_map DisconnectMap; - DisconnectMap m_disconnects; - uint32 m_maxActiveSessionCount; - uint32 m_maxQueuedSessionCount; - uint32 m_PlayerCount; - uint32 m_MaxPlayerCount; + DisconnectMap _disconnects; + uint32 _maxActiveSessionCount; + uint32 _maxQueuedSessionCount; + uint32 _playerCount; + uint32 _maxPlayerCount; - std::string m_newCharString; + std::string _newCharString; - float rate_values[MAX_RATES]; - uint32 m_int_configs[INT_CONFIG_VALUE_COUNT]; - bool m_bool_configs[BOOL_CONFIG_VALUE_COUNT]; - float m_float_configs[FLOAT_CONFIG_VALUE_COUNT]; + float _rate_values[MAX_RATES]; + uint32 _int_configs[INT_CONFIG_VALUE_COUNT]; + bool _bool_configs[BOOL_CONFIG_VALUE_COUNT]; + float _float_configs[FLOAT_CONFIG_VALUE_COUNT]; typedef std::map WorldStatesMap; - WorldStatesMap m_worldstates; - uint32 m_playerLimit; - AccountTypes m_allowedSecurityLevel; - LocaleConstant m_defaultDbcLocale; // from config for one from loaded DBC locales - uint32 m_availableDbcLocaleMask; // by loaded DBC + WorldStatesMap _worldstates; + uint32 _playerLimit; + AccountTypes _allowedSecurityLevel; + LocaleConstant _defaultDbcLocale; // from config for one from loaded DBC locales + uint32 _availableDbcLocaleMask; // by loaded DBC void DetectDBCLang(); - bool m_allowMovement; - std::string m_dataPath; + bool _allowMovement; + std::string _dataPath; // for max speed access - static float m_MaxVisibleDistanceOnContinents; - static float m_MaxVisibleDistanceInInstances; - static float m_MaxVisibleDistanceInBGArenas; + static float _maxVisibleDistanceOnContinents; + static float _maxVisibleDistanceInInstances; + static float _maxVisibleDistanceInBGArenas; std::string _realmName; // CLI command holder to be thread safe - LockedQueue cliCmdQueue; + LockedQueue _cliCmdQueue; // next daily quests and random bg reset time - Seconds m_NextDailyQuestReset; - Seconds m_NextWeeklyQuestReset; - Seconds m_NextMonthlyQuestReset; - Seconds m_NextRandomBGReset; - Seconds m_NextCalendarOldEventsDeletionTime; - Seconds m_NextGuildReset; + Seconds _nextDailyQuestReset; + Seconds _nextWeeklyQuestReset; + Seconds _nextMonthlyQuestReset; + Seconds _nextRandomBGReset; + Seconds _nextCalendarOldEventsDeletionTime; + Seconds _nextGuildReset; //Player Queue - Queue m_QueuedPlayer; + Queue _queuedPlayer; // sessions that are added async void AddSession_(WorldSession* s); - LockedQueue addSessQueue; + LockedQueue _addSessQueue; // used versions - std::string m_DBVersion; + std::string _dbVersion; typedef std::map AutobroadcastsMap; - AutobroadcastsMap m_Autobroadcasts; + AutobroadcastsMap _autobroadcasts; typedef std::map AutobroadcastsWeightMap; - AutobroadcastsWeightMap m_AutobroadcastsWeights; + AutobroadcastsWeightMap _autobroadcastsWeights; void ProcessQueryCallbacks(); QueryCallbackProcessor _queryProcessor;