mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-25 22:56:24 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -334,7 +334,7 @@ bool World::HasRecentlyDisconnected(WorldSession* session)
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
int32 World::GetQueuePos(WorldSession* sess)
|
||||
{
|
||||
@@ -581,7 +581,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
else if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] > NOMINAL_MELEE_RANGE)
|
||||
{
|
||||
sLog->outError("TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.",
|
||||
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE);
|
||||
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE);
|
||||
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = NOMINAL_MELEE_RANGE;
|
||||
}
|
||||
|
||||
@@ -639,7 +639,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Channel", 1);
|
||||
m_int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Whisper", 1);
|
||||
m_int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetIntDefault("ChatLevelReq.Say", 1);
|
||||
m_int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetIntDefault("PartyLevelReq", 1);
|
||||
m_int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetIntDefault("PartyLevelReq", 1);
|
||||
m_int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Trade", 1);
|
||||
m_int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Ticket", 1);
|
||||
m_int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetIntDefault("LevelReq.Auction", 1);
|
||||
@@ -822,13 +822,13 @@ void World::LoadConfigSettings(bool reload)
|
||||
if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1)
|
||||
{
|
||||
sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). 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], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
|
||||
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55;
|
||||
}
|
||||
else if (m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
|
||||
{
|
||||
sLog->outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
|
||||
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
|
||||
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], m_int_configs[CONFIG_MAX_PLAYER_LEVEL]);
|
||||
m_int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = m_int_configs[CONFIG_MAX_PLAYER_LEVEL];
|
||||
}
|
||||
|
||||
@@ -836,12 +836,12 @@ void World::LoadConfigSettings(bool reload)
|
||||
if (int32(m_int_configs[CONFIG_START_PLAYER_MONEY]) < 0)
|
||||
{
|
||||
sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.", m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY] = 0;
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY] = 0;
|
||||
}
|
||||
else if (m_int_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT)
|
||||
{
|
||||
sLog->outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT);
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, MAX_MONEY_AMOUNT);
|
||||
m_int_configs[CONFIG_START_PLAYER_MONEY] = MAX_MONEY_AMOUNT;
|
||||
}
|
||||
|
||||
@@ -856,13 +856,13 @@ void World::LoadConfigSettings(bool reload)
|
||||
if (int32(m_int_configs[CONFIG_START_HONOR_POINTS]) < 0)
|
||||
{
|
||||
sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0);
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], 0);
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS] = 0;
|
||||
}
|
||||
else if (m_int_configs[CONFIG_START_HONOR_POINTS] > m_int_configs[CONFIG_MAX_HONOR_POINTS])
|
||||
{
|
||||
sLog->outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS]);
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS], m_int_configs[CONFIG_MAX_HONOR_POINTS]);
|
||||
m_int_configs[CONFIG_START_HONOR_POINTS] = m_int_configs[CONFIG_MAX_HONOR_POINTS];
|
||||
}
|
||||
|
||||
@@ -877,21 +877,21 @@ void World::LoadConfigSettings(bool reload)
|
||||
if (int32(m_int_configs[CONFIG_START_ARENA_POINTS]) < 0)
|
||||
{
|
||||
sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
|
||||
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0);
|
||||
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], 0);
|
||||
m_int_configs[CONFIG_START_ARENA_POINTS] = 0;
|
||||
}
|
||||
else if (m_int_configs[CONFIG_START_ARENA_POINTS] > m_int_configs[CONFIG_MAX_ARENA_POINTS])
|
||||
{
|
||||
sLog->outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
|
||||
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS]);
|
||||
m_int_configs[CONFIG_START_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS], m_int_configs[CONFIG_MAX_ARENA_POINTS]);
|
||||
m_int_configs[CONFIG_START_ARENA_POINTS] = m_int_configs[CONFIG_MAX_ARENA_POINTS];
|
||||
}
|
||||
|
||||
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 60);
|
||||
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetIntDefault("RecruitAFriend.MaxLevel", 60);
|
||||
if (m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] > m_int_configs[CONFIG_MAX_PLAYER_LEVEL])
|
||||
{
|
||||
sLog->outError("RecruitAFriend.MaxLevel (%i) must be in the range 0..MaxLevel(%u). Set to %u.",
|
||||
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], m_int_configs[CONFIG_MAX_PLAYER_LEVEL], 60);
|
||||
m_int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = 60;
|
||||
}
|
||||
|
||||
@@ -928,7 +928,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL])
|
||||
{
|
||||
sLog->outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
|
||||
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], MAX_LEVEL, m_int_configs[CONFIG_START_PLAYER_LEVEL]);
|
||||
m_int_configs[CONFIG_START_GM_LEVEL] = m_int_configs[CONFIG_START_PLAYER_LEVEL];
|
||||
}
|
||||
else if (m_int_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL)
|
||||
@@ -954,7 +954,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
if (reload)
|
||||
{
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(m_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_UPTIME].SetInterval(m_int_configs[CONFIG_UPTIME_UPDATE]*MINUTE * IN_MILLISECONDS);
|
||||
m_timers[WUPDATE_UPTIME].Reset();
|
||||
}
|
||||
|
||||
@@ -972,7 +972,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
}
|
||||
m_int_configs[CONFIG_LOGDB_CLEARTIME] = sConfigMgr->GetIntDefault("LogDB.Opt.ClearTime", 1209600); // 14 days default
|
||||
sLog->outString("Will clear `logs` table of entries older than %i seconds every %u minutes.",
|
||||
m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
|
||||
m_int_configs[CONFIG_LOGDB_CLEARTIME], m_int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
|
||||
|
||||
m_int_configs[CONFIG_TELEPORT_TIMEOUT_NEAR] = sConfigMgr->GetIntDefault("TeleportTimeoutNear", 25); // pussywizard
|
||||
m_int_configs[CONFIG_TELEPORT_TIMEOUT_FAR] = sConfigMgr->GetIntDefault("TeleportTimeoutFar", 45); // pussywizard
|
||||
@@ -1116,10 +1116,13 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetBoolDefault("Battleground.GiveXPForKills", false);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK_TIMER] = sConfigMgr->GetIntDefault("Battleground.ReportAFK.Timer", 4);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = sConfigMgr->GetIntDefault("Battleground.ReportAFK", 3);
|
||||
if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] < 1) {
|
||||
if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] < 1)
|
||||
{
|
||||
sLog->outError("Battleground.ReportAFK (%d) must be >0. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3;
|
||||
} else if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] > 9) {
|
||||
}
|
||||
else if (m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] > 9)
|
||||
{
|
||||
sLog->outError("Battleground.ReportAFK (%d) must be <10. Using 3 instead.", m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
|
||||
m_int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = 3;
|
||||
}
|
||||
@@ -1164,10 +1167,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
//visibility on continents
|
||||
m_MaxVisibleDistanceOnContinents = sConfigMgr->GetFloatDefault("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
|
||||
if (m_MaxVisibleDistanceOnContinents < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
if (m_MaxVisibleDistanceOnContinents < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
{
|
||||
sLog->outError("Visibility.Distance.Continents can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
m_MaxVisibleDistanceOnContinents = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
sLog->outError("Visibility.Distance.Continents can't be less max aggro radius %f", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
m_MaxVisibleDistanceOnContinents = 45 * sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
}
|
||||
else if (m_MaxVisibleDistanceOnContinents > MAX_VISIBILITY_DISTANCE)
|
||||
{
|
||||
@@ -1177,10 +1180,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
//visibility in instances
|
||||
m_MaxVisibleDistanceInInstances = sConfigMgr->GetFloatDefault("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
|
||||
if (m_MaxVisibleDistanceInInstances < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
if (m_MaxVisibleDistanceInInstances < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
{
|
||||
sLog->outError("Visibility.Distance.Instances can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
m_MaxVisibleDistanceInInstances = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
sLog->outError("Visibility.Distance.Instances can't be less max aggro radius %f", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
m_MaxVisibleDistanceInInstances = 45 * sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
}
|
||||
else if (m_MaxVisibleDistanceInInstances > MAX_VISIBILITY_DISTANCE)
|
||||
{
|
||||
@@ -1190,10 +1193,10 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
//visibility in BG/Arenas
|
||||
m_MaxVisibleDistanceInBGArenas = sConfigMgr->GetFloatDefault("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
|
||||
if (m_MaxVisibleDistanceInBGArenas < 45*sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
if (m_MaxVisibleDistanceInBGArenas < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
|
||||
{
|
||||
sLog->outError("Visibility.Distance.BGArenas can't be less max aggro radius %f", 45*sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
m_MaxVisibleDistanceInBGArenas = 45*sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
sLog->outError("Visibility.Distance.BGArenas can't be less max aggro radius %f", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
|
||||
m_MaxVisibleDistanceInBGArenas = 45 * sWorld->getRate(RATE_CREATURE_AGGRO);
|
||||
}
|
||||
else if (m_MaxVisibleDistanceInBGArenas > MAX_VISIBILITY_DISTANCE)
|
||||
{
|
||||
@@ -1214,7 +1217,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
///- Read the "Data" directory from the config file
|
||||
std::string dataPath = sConfigMgr->GetStringDefault("DataDir", "./");
|
||||
if (dataPath.empty() || (dataPath.at(dataPath.length()-1) != '/' && dataPath.at(dataPath.length()-1) != '\\'))
|
||||
if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
|
||||
dataPath.push_back('/');
|
||||
|
||||
#if AC_PLATFORM == AC_PLATFORM_UNIX || AC_PLATFORM == AC_PLATFORM_APPLE
|
||||
@@ -1419,14 +1422,14 @@ void World::SetInitialWorldSettings()
|
||||
{
|
||||
///- Check the existence of the map files for all starting areas.
|
||||
if (!MapManager::ExistMapAndVMap(0, -6240.32f, 331.033f)
|
||||
|| !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f)
|
||||
|| !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f)
|
||||
|| !MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f)
|
||||
|| !MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
|
||||
|| !MapManager::ExistMapAndVMap(1, -2917.58f, -257.98f)
|
||||
|| (m_int_configs[CONFIG_EXPANSION] && (
|
||||
!MapManager::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
|
||||
!MapManager::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
|
||||
|| !MapManager::ExistMapAndVMap(0, -8949.95f, -132.493f)
|
||||
|| !MapManager::ExistMapAndVMap(1, -618.518f, -4251.67f)
|
||||
|| !MapManager::ExistMapAndVMap(0, 1676.35f, 1677.45f)
|
||||
|| !MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
|
||||
|| !MapManager::ExistMapAndVMap(1, -2917.58f, -257.98f)
|
||||
|| (m_int_configs[CONFIG_EXPANSION] && (
|
||||
!MapManager::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
|
||||
!MapManager::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
|
||||
{
|
||||
exit(1);
|
||||
}
|
||||
@@ -1901,28 +1904,28 @@ void World::SetInitialWorldSettings()
|
||||
m_startTime = m_gameTime;
|
||||
|
||||
LoginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES(%u, %u, 0, '%s')",
|
||||
realmID, uint32(m_startTime), GitRevision::GetFullVersion()); // One-time query
|
||||
realmID, uint32(m_startTime), 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);
|
||||
//Update "uptime" table based on configuration entry in minutes.
|
||||
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);
|
||||
//Update "uptime" table based on configuration entry in minutes.
|
||||
|
||||
m_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);
|
||||
// clean logs table every 14 days by default
|
||||
//erase corpses every 20 minutes
|
||||
m_timers[WUPDATE_CLEANDB].SetInterval(m_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));
|
||||
|
||||
m_timers[WUPDATE_PINGDB].SetInterval(getIntConfig(CONFIG_DB_PING_INTERVAL)*MINUTE*IN_MILLISECONDS); // Mysql ping time in minutes
|
||||
m_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);
|
||||
m_timers[WUPDATE_5_SECS].SetInterval(5 * IN_MILLISECONDS);
|
||||
|
||||
mail_expire_check_timer = time(nullptr) + 6*3600;
|
||||
mail_expire_check_timer = time(nullptr) + 6 * 3600;
|
||||
|
||||
///- Initilize static helper structures
|
||||
AIRegistry::Initialize();
|
||||
@@ -2012,7 +2015,7 @@ void World::SetInitialWorldSettings()
|
||||
///- Run eluna scripts.
|
||||
// in multithread foreach: run scripts
|
||||
sEluna->RunScripts();
|
||||
sEluna->OnConfigLoad(false,false); // Must be done after Eluna is initialized and scripts have run.
|
||||
sEluna->OnConfigLoad(false, false); // Must be done after Eluna is initialized and scripts have run.
|
||||
#endif
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS))
|
||||
@@ -2048,7 +2051,8 @@ void World::SetInitialWorldSettings()
|
||||
sLog->SetLogDB(true);
|
||||
}
|
||||
|
||||
if (sConfigMgr->isDryRun()) {
|
||||
if (sConfigMgr->isDryRun())
|
||||
{
|
||||
sLog->outString("AzerothCore dry run completed, terminating.");
|
||||
exit(0);
|
||||
}
|
||||
@@ -2068,7 +2072,7 @@ void World::DetectDBCLang()
|
||||
std::string availableLocalsStr;
|
||||
|
||||
uint8 default_locale = TOTAL_LOCALES;
|
||||
for (uint8 i = default_locale -1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
|
||||
for (uint8 i = default_locale - 1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
|
||||
{
|
||||
if (race->name[i][0] != '\0') // check by race names
|
||||
{
|
||||
@@ -2080,7 +2084,7 @@ void World::DetectDBCLang()
|
||||
}
|
||||
|
||||
if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES &&
|
||||
(m_availableDbcLocaleMask & (1 << m_lang_confid)))
|
||||
(m_availableDbcLocaleMask & (1 << m_lang_confid)))
|
||||
{
|
||||
default_locale = m_lang_confid;
|
||||
}
|
||||
@@ -2215,7 +2219,7 @@ void World::Update(uint32 diff)
|
||||
if (m_gameTime > mail_expire_check_timer)
|
||||
{
|
||||
sObjectMgr->ReturnOrDeleteOldMails(true);
|
||||
mail_expire_check_timer = m_gameTime + 6*3600;
|
||||
mail_expire_check_timer = m_gameTime + 6 * 3600;
|
||||
}
|
||||
|
||||
UpdateSessions(diff);
|
||||
@@ -2342,10 +2346,10 @@ void World::SendGlobalMessage(WorldPacket* packet, WorldSession* self, TeamId te
|
||||
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
{
|
||||
if (itr->second &&
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second != self &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second != self &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
}
|
||||
@@ -2359,11 +2363,11 @@ void World::SendGlobalGMMessage(WorldPacket* packet, WorldSession* self, TeamId
|
||||
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
{
|
||||
if (itr->second &&
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second != self &&
|
||||
!AccountMgr::IsPlayerAccount(itr->second->GetSecurity()) &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second != self &&
|
||||
!AccountMgr::IsPlayerAccount(itr->second->GetSecurity()) &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
}
|
||||
@@ -2374,44 +2378,44 @@ namespace acore
|
||||
{
|
||||
class WorldWorldTextBuilder
|
||||
{
|
||||
public:
|
||||
typedef std::vector<WorldPacket*> WorldPacketList;
|
||||
explicit WorldWorldTextBuilder(uint32 textId, va_list* args = nullptr) : i_textId(textId), i_args(args) {}
|
||||
void operator()(WorldPacketList& data_list, LocaleConstant loc_idx)
|
||||
public:
|
||||
typedef std::vector<WorldPacket*> WorldPacketList;
|
||||
explicit WorldWorldTextBuilder(uint32 textId, va_list* args = nullptr) : i_textId(textId), i_args(args) {}
|
||||
void operator()(WorldPacketList& data_list, LocaleConstant loc_idx)
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(i_textId, loc_idx);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
char const* text = sObjectMgr->GetAcoreString(i_textId, loc_idx);
|
||||
// we need copy va_list before use or original va_list will corrupted
|
||||
va_list ap;
|
||||
va_copy(ap, *i_args);
|
||||
|
||||
if (i_args)
|
||||
{
|
||||
// we need copy va_list before use or original va_list will corrupted
|
||||
va_list ap;
|
||||
va_copy(ap, *i_args);
|
||||
char str[2048];
|
||||
vsnprintf(str, 2048, text, ap);
|
||||
va_end(ap);
|
||||
|
||||
char str[2048];
|
||||
vsnprintf(str, 2048, text, ap);
|
||||
va_end(ap);
|
||||
|
||||
do_helper(data_list, &str[0]);
|
||||
}
|
||||
else
|
||||
do_helper(data_list, (char*)text);
|
||||
do_helper(data_list, &str[0]);
|
||||
}
|
||||
private:
|
||||
char* lineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; }
|
||||
void do_helper(WorldPacketList& data_list, char* text)
|
||||
else
|
||||
do_helper(data_list, (char*)text);
|
||||
}
|
||||
private:
|
||||
char* lineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = nullptr; return start; }
|
||||
void do_helper(WorldPacketList& data_list, char* text)
|
||||
{
|
||||
char* pos = text;
|
||||
while (char* line = lineFromMessage(pos))
|
||||
{
|
||||
char* pos = text;
|
||||
while (char* line = lineFromMessage(pos))
|
||||
{
|
||||
WorldPacket* data = new WorldPacket();
|
||||
ChatHandler::BuildChatPacket(*data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
|
||||
data_list.push_back(data);
|
||||
}
|
||||
WorldPacket* data = new WorldPacket();
|
||||
ChatHandler::BuildChatPacket(*data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
|
||||
data_list.push_back(data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint32 i_textId;
|
||||
va_list* i_args;
|
||||
uint32 i_textId;
|
||||
va_list* i_args;
|
||||
};
|
||||
} // namespace acore
|
||||
|
||||
@@ -2483,11 +2487,11 @@ bool World::SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self
|
||||
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
{
|
||||
if (itr->second &&
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second->GetPlayer()->GetZoneId() == zone &&
|
||||
itr->second != self &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
itr->second->GetPlayer() &&
|
||||
itr->second->GetPlayer()->IsInWorld() &&
|
||||
itr->second->GetPlayer()->GetZoneId() == zone &&
|
||||
itr->second != self &&
|
||||
(teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
|
||||
{
|
||||
itr->second->SendPacket(packet);
|
||||
foundPlayerToSend = true;
|
||||
@@ -2595,11 +2599,11 @@ void World::ShutdownMsg(bool show, Player* player)
|
||||
|
||||
///- 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
|
||||
(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
|
||||
{
|
||||
std::string str = secsToTimeString(m_ShutdownTimer).append(".");
|
||||
|
||||
@@ -2634,7 +2638,7 @@ void World::ShutdownCancel()
|
||||
}
|
||||
|
||||
/// Send a server message to the user(s)
|
||||
void World::SendServerMessage(ServerMessageType type, const char *text, Player* player)
|
||||
void World::SendServerMessage(ServerMessageType type, const char* text, Player* player)
|
||||
{
|
||||
WorldPacket data(SMSG_SERVER_MESSAGE, 50); // guess size
|
||||
data << uint32(type);
|
||||
@@ -2704,7 +2708,7 @@ void World::UpdateSessions(uint32 diff)
|
||||
next = itr;
|
||||
++next;
|
||||
WorldSession* pSession = itr->second;
|
||||
if (!pSession->GetPlayer() || pSession->GetOfflineTime()+60 < currTime || pSession->IsKicked())
|
||||
if (!pSession->GetPlayer() || pSession->GetOfflineTime() + 60 < currTime || pSession->IsKicked())
|
||||
{
|
||||
m_offlineSessions.erase(itr);
|
||||
if (m_sessions.find(pSession->GetAccountId()) != m_sessions.end())
|
||||
@@ -2778,7 +2782,7 @@ void World::SendAutoBroadcast()
|
||||
|
||||
else if (abcenter == 1)
|
||||
{
|
||||
WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1));
|
||||
WorldPacket data(SMSG_NOTIFICATION, (msg.size() + 1));
|
||||
data << msg;
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
}
|
||||
@@ -2787,7 +2791,7 @@ void World::SendAutoBroadcast()
|
||||
{
|
||||
sWorld->SendWorldText(LANG_AUTO_BROADCAST, msg.c_str());
|
||||
|
||||
WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1));
|
||||
WorldPacket data(SMSG_NOTIFICATION, (msg.size() + 1));
|
||||
data << msg;
|
||||
sWorld->SendGlobalMessage(&data);
|
||||
}
|
||||
@@ -2844,7 +2848,7 @@ time_t World::GetNextTimeWithDayAndHour(int8 dayOfWeek, int8 hour)
|
||||
localTm.tm_sec = 0;
|
||||
uint32 add;
|
||||
if (dayOfWeek < 0 || dayOfWeek > 6)
|
||||
dayOfWeek = (localTm.tm_wday+1)%7;
|
||||
dayOfWeek = (localTm.tm_wday + 1) % 7;
|
||||
if (localTm.tm_wday >= dayOfWeek)
|
||||
add = (7 - (localTm.tm_wday - dayOfWeek)) * DAY;
|
||||
else
|
||||
@@ -2866,7 +2870,7 @@ time_t World::GetNextTimeWithMonthAndHour(int8 month, int8 hour)
|
||||
localTm.tm_sec = 0;
|
||||
if (month < 0 || month > 11)
|
||||
{
|
||||
month = (localTm.tm_mon+1)%12;
|
||||
month = (localTm.tm_mon + 1) % 12;
|
||||
if (month == 0)
|
||||
localTm.tm_year += 1;
|
||||
}
|
||||
@@ -3002,7 +3006,7 @@ void World::ResetMonthlyQuests()
|
||||
void World::ResetEventSeasonalQuests(uint16 event_id)
|
||||
{
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_QUEST_STATUS_SEASONAL);
|
||||
stmt->setUInt16(0,event_id);
|
||||
stmt->setUInt16(0, event_id);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
|
||||
@@ -3048,7 +3052,7 @@ void World::ResetGuildCap()
|
||||
|
||||
void World::UpdateMaxSessionCounters()
|
||||
{
|
||||
m_maxActiveSessionCount = std::max(m_maxActiveSessionCount, uint32(m_sessions.size()-m_QueuedPlayer.size()));
|
||||
m_maxActiveSessionCount = std::max(m_maxActiveSessionCount, uint32(m_sessions.size() - m_QueuedPlayer.size()));
|
||||
m_maxQueuedSessionCount = std::max(m_maxQueuedSessionCount, uint32(m_QueuedPlayer.size()));
|
||||
}
|
||||
|
||||
@@ -3100,8 +3104,7 @@ void World::LoadWorldStates()
|
||||
Field* fields = result->Fetch();
|
||||
m_worldstates[fields[0].GetUInt32()] = fields[1].GetUInt32();
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u world states in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
@@ -3181,8 +3184,7 @@ void World::LoadGlobalPlayerDataStore()
|
||||
{
|
||||
Field* fields = mailCountResult->Fetch();
|
||||
_mailCountMap[fields[0].GetUInt32()] = uint16(fields[1].GetUInt64());
|
||||
}
|
||||
while (mailCountResult->NextRow());
|
||||
} while (mailCountResult->NextRow());
|
||||
}
|
||||
|
||||
do
|
||||
@@ -3208,8 +3210,7 @@ void World::LoadGlobalPlayerDataStore()
|
||||
0 /*guild id*/);
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %d Players data in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
|
||||
@@ -484,7 +484,7 @@ enum RealmType
|
||||
REALM_TYPE_RP = 6,
|
||||
REALM_TYPE_RPPVP = 8,
|
||||
REALM_TYPE_FFA_PVP = 16 // custom, free for all pvp mode like arena PvP in all zones except rest activated places and sanctuaries
|
||||
// replaced by REALM_PVP in realm list
|
||||
// replaced by REALM_PVP in realm list
|
||||
};
|
||||
|
||||
enum RealmZone
|
||||
@@ -548,15 +548,15 @@ struct CliCommandHolder
|
||||
typedef void CommandFinished(void*, bool success);
|
||||
|
||||
void* m_callbackArg;
|
||||
char *m_command;
|
||||
char* m_command;
|
||||
Print* m_print;
|
||||
|
||||
CommandFinished* m_commandFinished;
|
||||
|
||||
CliCommandHolder(void* callbackArg, const char *command, Print* zprint, CommandFinished* commandFinished)
|
||||
CliCommandHolder(void* callbackArg, const char* command, Print* zprint, CommandFinished* commandFinished)
|
||||
: m_callbackArg(callbackArg), m_print(zprint), m_commandFinished(commandFinished)
|
||||
{
|
||||
size_t len = strlen(command)+1;
|
||||
size_t len = strlen(command) + 1;
|
||||
m_command = new char[len];
|
||||
memcpy(m_command, command, len);
|
||||
}
|
||||
@@ -604,339 +604,339 @@ struct PetitionData
|
||||
/// The World
|
||||
class World
|
||||
{
|
||||
public:
|
||||
World();
|
||||
~World();
|
||||
public:
|
||||
World();
|
||||
~World();
|
||||
|
||||
static World* instance();
|
||||
static World* instance();
|
||||
|
||||
static uint32 m_worldLoopCounter;
|
||||
static uint32 m_worldLoopCounter;
|
||||
|
||||
WorldSession* FindSession(uint32 id) const;
|
||||
WorldSession* FindOfflineSession(uint32 id) const;
|
||||
WorldSession* FindOfflineSessionForCharacterGUID(uint32 guidLow) const;
|
||||
void AddSession(WorldSession* s);
|
||||
void SendAutoBroadcast();
|
||||
bool KickSession(uint32 id);
|
||||
/// Get the number of current active sessions
|
||||
void UpdateMaxSessionCounters();
|
||||
const SessionMap& GetAllSessions() const { return m_sessions; }
|
||||
uint32 GetActiveAndQueuedSessionCount() const { return m_sessions.size(); }
|
||||
uint32 GetActiveSessionCount() const { return m_sessions.size() - m_QueuedPlayer.size(); }
|
||||
uint32 GetQueuedSessionCount() const { return m_QueuedPlayer.size(); }
|
||||
/// Get the maximum number of parallel sessions on the server since last reboot
|
||||
uint32 GetMaxQueuedSessionCount() const { return m_maxQueuedSessionCount; }
|
||||
uint32 GetMaxActiveSessionCount() const { return m_maxActiveSessionCount; }
|
||||
/// Get number of players
|
||||
inline uint32 GetPlayerCount() const { return m_PlayerCount; }
|
||||
inline uint32 GetMaxPlayerCount() const { return m_MaxPlayerCount; }
|
||||
WorldSession* FindSession(uint32 id) const;
|
||||
WorldSession* FindOfflineSession(uint32 id) const;
|
||||
WorldSession* FindOfflineSessionForCharacterGUID(uint32 guidLow) const;
|
||||
void AddSession(WorldSession* s);
|
||||
void SendAutoBroadcast();
|
||||
bool KickSession(uint32 id);
|
||||
/// Get the number of current active sessions
|
||||
void UpdateMaxSessionCounters();
|
||||
const SessionMap& GetAllSessions() const { return m_sessions; }
|
||||
uint32 GetActiveAndQueuedSessionCount() const { return m_sessions.size(); }
|
||||
uint32 GetActiveSessionCount() const { return m_sessions.size() - m_QueuedPlayer.size(); }
|
||||
uint32 GetQueuedSessionCount() const { return m_QueuedPlayer.size(); }
|
||||
/// Get the maximum number of parallel sessions on the server since last reboot
|
||||
uint32 GetMaxQueuedSessionCount() const { return m_maxQueuedSessionCount; }
|
||||
uint32 GetMaxActiveSessionCount() const { return m_maxActiveSessionCount; }
|
||||
/// Get number of players
|
||||
inline uint32 GetPlayerCount() const { return m_PlayerCount; }
|
||||
inline uint32 GetMaxPlayerCount() const { return m_MaxPlayerCount; }
|
||||
|
||||
/// Increase/Decrease number of players
|
||||
inline void IncreasePlayerCount()
|
||||
{
|
||||
m_PlayerCount++;
|
||||
m_MaxPlayerCount = std::max(m_MaxPlayerCount, m_PlayerCount);
|
||||
}
|
||||
inline void DecreasePlayerCount() { m_PlayerCount--; }
|
||||
/// Increase/Decrease number of players
|
||||
inline void IncreasePlayerCount()
|
||||
{
|
||||
m_PlayerCount++;
|
||||
m_MaxPlayerCount = std::max(m_MaxPlayerCount, m_PlayerCount);
|
||||
}
|
||||
inline void DecreasePlayerCount() { m_PlayerCount--; }
|
||||
|
||||
Player* FindPlayerInZone(uint32 zone);
|
||||
Player* FindPlayerInZone(uint32 zone);
|
||||
|
||||
/// Deny clients?
|
||||
bool IsClosed() const;
|
||||
/// Deny clients?
|
||||
bool IsClosed() const;
|
||||
|
||||
/// Close world
|
||||
void SetClosed(bool val);
|
||||
/// Close world
|
||||
void SetClosed(bool val);
|
||||
|
||||
/// Security level limitations
|
||||
AccountTypes GetPlayerSecurityLimit() const { return m_allowedSecurityLevel; }
|
||||
void SetPlayerSecurityLimit(AccountTypes sec);
|
||||
void LoadDBAllowedSecurityLevel();
|
||||
/// Security level limitations
|
||||
AccountTypes GetPlayerSecurityLimit() const { return m_allowedSecurityLevel; }
|
||||
void SetPlayerSecurityLimit(AccountTypes sec);
|
||||
void LoadDBAllowedSecurityLevel();
|
||||
|
||||
/// Active session server limit
|
||||
void SetPlayerAmountLimit(uint32 limit) { m_playerLimit = limit; }
|
||||
uint32 GetPlayerAmountLimit() const { return m_playerLimit; }
|
||||
/// Active session server limit
|
||||
void SetPlayerAmountLimit(uint32 limit) { m_playerLimit = limit; }
|
||||
uint32 GetPlayerAmountLimit() const { return m_playerLimit; }
|
||||
|
||||
//player Queue
|
||||
typedef std::list<WorldSession*> Queue;
|
||||
void AddQueuedPlayer(WorldSession*);
|
||||
bool RemoveQueuedPlayer(WorldSession* session);
|
||||
int32 GetQueuePos(WorldSession*);
|
||||
bool HasRecentlyDisconnected(WorldSession*);
|
||||
//player Queue
|
||||
typedef std::list<WorldSession*> Queue;
|
||||
void AddQueuedPlayer(WorldSession*);
|
||||
bool RemoveQueuedPlayer(WorldSession* session);
|
||||
int32 GetQueuePos(WorldSession*);
|
||||
bool HasRecentlyDisconnected(WorldSession*);
|
||||
|
||||
/// \todo Actions on m_allowMovement still to be implemented
|
||||
/// Is movement allowed?
|
||||
bool getAllowMovement() const { return m_allowMovement; }
|
||||
/// Allow/Disallow object movements
|
||||
void SetAllowMovement(bool allow) { m_allowMovement = allow; }
|
||||
/// \todo Actions on m_allowMovement still to be implemented
|
||||
/// Is movement allowed?
|
||||
bool getAllowMovement() const { return m_allowMovement; }
|
||||
/// Allow/Disallow object movements
|
||||
void SetAllowMovement(bool allow) { m_allowMovement = allow; }
|
||||
|
||||
/// Set the string for new characters (first login)
|
||||
void SetNewCharString(std::string const& str) { m_newCharString = str; }
|
||||
/// Get the string for new characters (first login)
|
||||
std::string const& GetNewCharString() const { return m_newCharString; }
|
||||
/// Set the string for new characters (first login)
|
||||
void SetNewCharString(std::string const& str) { m_newCharString = str; }
|
||||
/// Get the string for new characters (first login)
|
||||
std::string const& GetNewCharString() const { return m_newCharString; }
|
||||
|
||||
LocaleConstant GetDefaultDbcLocale() const { return m_defaultDbcLocale; }
|
||||
LocaleConstant GetDefaultDbcLocale() const { return m_defaultDbcLocale; }
|
||||
|
||||
/// Get the path where data (dbc, maps) are stored on disk
|
||||
std::string const& GetDataPath() const { return m_dataPath; }
|
||||
/// Get the path where data (dbc, maps) are stored on disk
|
||||
std::string const& GetDataPath() const { return m_dataPath; }
|
||||
|
||||
/// When server started?
|
||||
time_t const& GetStartTime() const { return m_startTime; }
|
||||
/// What time is it?
|
||||
time_t const& GetGameTime() const { return m_gameTime; }
|
||||
/// What time is it? in ms
|
||||
static uint32 GetGameTimeMS() { return m_gameMSTime; }
|
||||
/// Uptime (in secs)
|
||||
uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
|
||||
/// Update time
|
||||
uint32 GetUpdateTime() const { return m_updateTime; }
|
||||
void SetRecordDiffInterval(int32 t) { if (t >= 0) m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
|
||||
/// When server started?
|
||||
time_t const& GetStartTime() const { return m_startTime; }
|
||||
/// What time is it?
|
||||
time_t const& GetGameTime() const { return m_gameTime; }
|
||||
/// What time is it? in ms
|
||||
static uint32 GetGameTimeMS() { return m_gameMSTime; }
|
||||
/// Uptime (in secs)
|
||||
uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
|
||||
/// Update time
|
||||
uint32 GetUpdateTime() const { return m_updateTime; }
|
||||
void SetRecordDiffInterval(int32 t) { if (t >= 0) m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
|
||||
|
||||
/// Next daily quests and random bg reset time
|
||||
time_t GetNextDailyQuestsResetTime() const { return m_NextDailyQuestReset; }
|
||||
time_t GetNextWeeklyQuestsResetTime() const { return m_NextWeeklyQuestReset; }
|
||||
time_t GetNextRandomBGResetTime() const { return m_NextRandomBGReset; }
|
||||
/// Next daily quests and random bg reset time
|
||||
time_t GetNextDailyQuestsResetTime() const { return m_NextDailyQuestReset; }
|
||||
time_t GetNextWeeklyQuestsResetTime() const { return m_NextWeeklyQuestReset; }
|
||||
time_t GetNextRandomBGResetTime() const { return m_NextRandomBGReset; }
|
||||
|
||||
/// Get the maximum skill level a player can reach
|
||||
uint16 GetConfigMaxSkillValue() const
|
||||
{
|
||||
uint16 lvl = uint16(getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
|
||||
}
|
||||
/// Get the maximum skill level a player can reach
|
||||
uint16 GetConfigMaxSkillValue() const
|
||||
{
|
||||
uint16 lvl = uint16(getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
|
||||
}
|
||||
|
||||
void SetInitialWorldSettings();
|
||||
void LoadConfigSettings(bool reload = false);
|
||||
void SetInitialWorldSettings();
|
||||
void LoadConfigSettings(bool reload = false);
|
||||
|
||||
void SendWorldText(uint32 string_id, ...);
|
||||
void SendGlobalText(const char* text, WorldSession* self);
|
||||
void SendGMText(uint32 string_id, ...);
|
||||
void SendGlobalMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendGlobalGMMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendZoneText(uint32 zone, const char *text, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendServerMessage(ServerMessageType type, const char *text = "", Player* player = nullptr);
|
||||
void SendWorldText(uint32 string_id, ...);
|
||||
void SendGlobalText(const char* text, WorldSession* self);
|
||||
void SendGMText(uint32 string_id, ...);
|
||||
void SendGlobalMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendGlobalGMMessage(WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
bool SendZoneMessage(uint32 zone, WorldPacket* packet, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendZoneText(uint32 zone, const char* text, WorldSession* self = 0, TeamId teamId = TEAM_NEUTRAL);
|
||||
void SendServerMessage(ServerMessageType type, const char* text = "", Player* player = nullptr);
|
||||
|
||||
/// Are we in the middle of a shutdown?
|
||||
bool IsShuttingDown() const { return m_ShutdownTimer > 0; }
|
||||
uint32 GetShutDownTimeLeft() const { return m_ShutdownTimer; }
|
||||
void ShutdownServ(uint32 time, uint32 options, uint8 exitcode);
|
||||
void ShutdownCancel();
|
||||
void ShutdownMsg(bool show = false, Player* player = nullptr);
|
||||
static uint8 GetExitCode() { return m_ExitCode; }
|
||||
static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; }
|
||||
static bool IsStopped() { return m_stopEvent; }
|
||||
/// Are we in the middle of a shutdown?
|
||||
bool IsShuttingDown() const { return m_ShutdownTimer > 0; }
|
||||
uint32 GetShutDownTimeLeft() const { return m_ShutdownTimer; }
|
||||
void ShutdownServ(uint32 time, uint32 options, uint8 exitcode);
|
||||
void ShutdownCancel();
|
||||
void ShutdownMsg(bool show = false, Player* player = nullptr);
|
||||
static uint8 GetExitCode() { return m_ExitCode; }
|
||||
static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; }
|
||||
static bool IsStopped() { return m_stopEvent; }
|
||||
|
||||
void Update(uint32 diff);
|
||||
void Update(uint32 diff);
|
||||
|
||||
void UpdateSessions(uint32 diff);
|
||||
/// Set a server rate (see #Rates)
|
||||
void setRate(Rates rate, float value) { rate_values[rate]=value; }
|
||||
/// Get a server rate (see #Rates)
|
||||
float getRate(Rates rate) const { return rate_values[rate]; }
|
||||
void UpdateSessions(uint32 diff);
|
||||
/// Set a server rate (see #Rates)
|
||||
void setRate(Rates rate, float value) { rate_values[rate] = value; }
|
||||
/// Get a server rate (see #Rates)
|
||||
float getRate(Rates rate) const { return rate_values[rate]; }
|
||||
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setBoolConfig(WorldBoolConfigs index, bool value)
|
||||
{
|
||||
if (index < BOOL_CONFIG_VALUE_COUNT)
|
||||
m_bool_configs[index] = value;
|
||||
}
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setBoolConfig(WorldBoolConfigs index, bool value)
|
||||
{
|
||||
if (index < BOOL_CONFIG_VALUE_COUNT)
|
||||
m_bool_configs[index] = value;
|
||||
}
|
||||
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
bool getBoolConfig(WorldBoolConfigs index) const
|
||||
{
|
||||
return index < BOOL_CONFIG_VALUE_COUNT ? m_bool_configs[index] : 0;
|
||||
}
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
bool getBoolConfig(WorldBoolConfigs index) const
|
||||
{
|
||||
return index < BOOL_CONFIG_VALUE_COUNT ? m_bool_configs[index] : 0;
|
||||
}
|
||||
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setFloatConfig(WorldFloatConfigs index, float value)
|
||||
{
|
||||
if (index < FLOAT_CONFIG_VALUE_COUNT)
|
||||
m_float_configs[index] = value;
|
||||
}
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setFloatConfig(WorldFloatConfigs index, float value)
|
||||
{
|
||||
if (index < FLOAT_CONFIG_VALUE_COUNT)
|
||||
m_float_configs[index] = value;
|
||||
}
|
||||
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
float getFloatConfig(WorldFloatConfigs index) const
|
||||
{
|
||||
return index < FLOAT_CONFIG_VALUE_COUNT ? m_float_configs[index] : 0;
|
||||
}
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
float getFloatConfig(WorldFloatConfigs index) const
|
||||
{
|
||||
return index < FLOAT_CONFIG_VALUE_COUNT ? m_float_configs[index] : 0;
|
||||
}
|
||||
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setIntConfig(WorldIntConfigs index, uint32 value)
|
||||
{
|
||||
if (index < INT_CONFIG_VALUE_COUNT)
|
||||
m_int_configs[index] = value;
|
||||
}
|
||||
/// Set a server configuration element (see #WorldConfigs)
|
||||
void setIntConfig(WorldIntConfigs index, uint32 value)
|
||||
{
|
||||
if (index < INT_CONFIG_VALUE_COUNT)
|
||||
m_int_configs[index] = value;
|
||||
}
|
||||
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
uint32 getIntConfig(WorldIntConfigs index) const
|
||||
{
|
||||
return index < INT_CONFIG_VALUE_COUNT ? m_int_configs[index] : 0;
|
||||
}
|
||||
/// Get a server configuration element (see #WorldConfigs)
|
||||
uint32 getIntConfig(WorldIntConfigs index) const
|
||||
{
|
||||
return index < INT_CONFIG_VALUE_COUNT ? m_int_configs[index] : 0;
|
||||
}
|
||||
|
||||
void setWorldState(uint32 index, uint64 value);
|
||||
uint64 getWorldState(uint32 index) const;
|
||||
void LoadWorldStates();
|
||||
void setWorldState(uint32 index, uint64 value);
|
||||
uint64 getWorldState(uint32 index) const;
|
||||
void LoadWorldStates();
|
||||
|
||||
/// Are we on a "Player versus Player" server?
|
||||
bool IsPvPRealm() const { return (getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP); }
|
||||
bool IsFFAPvPRealm() const { return getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP; }
|
||||
/// Are we on a "Player versus Player" server?
|
||||
bool IsPvPRealm() const { return (getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP); }
|
||||
bool IsFFAPvPRealm() const { return getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP; }
|
||||
|
||||
void KickAll();
|
||||
void KickAllLess(AccountTypes sec);
|
||||
void KickAll();
|
||||
void KickAllLess(AccountTypes sec);
|
||||
|
||||
// for max speed access
|
||||
static float GetMaxVisibleDistanceOnContinents() { return m_MaxVisibleDistanceOnContinents; }
|
||||
static float GetMaxVisibleDistanceInInstances() { return m_MaxVisibleDistanceInInstances; }
|
||||
static float GetMaxVisibleDistanceInBGArenas() { return m_MaxVisibleDistanceInBGArenas; }
|
||||
// for max speed access
|
||||
static float GetMaxVisibleDistanceOnContinents() { return m_MaxVisibleDistanceOnContinents; }
|
||||
static float GetMaxVisibleDistanceInInstances() { return m_MaxVisibleDistanceInInstances; }
|
||||
static float GetMaxVisibleDistanceInBGArenas() { return m_MaxVisibleDistanceInBGArenas; }
|
||||
|
||||
// our: needed for arena spectator subscriptions
|
||||
uint32 GetNextWhoListUpdateDelaySecs()
|
||||
{
|
||||
if (m_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());
|
||||
return uint32(ceil(t/1000.0f));
|
||||
}
|
||||
// our: needed for arena spectator subscriptions
|
||||
uint32 GetNextWhoListUpdateDelaySecs()
|
||||
{
|
||||
if (m_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());
|
||||
return uint32(ceil(t / 1000.0f));
|
||||
}
|
||||
|
||||
// xinef: Global Player Data Storage system
|
||||
void LoadGlobalPlayerDataStore();
|
||||
uint32 GetGlobalPlayerGUID(std::string const& name) const;
|
||||
GlobalPlayerData const* GetGlobalPlayerData(uint32 guid) const;
|
||||
void AddGlobalPlayerData(uint32 guid, uint32 accountId, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level, uint16 mailCount, uint32 guildId);
|
||||
void UpdateGlobalPlayerData(uint32 guid, uint8 mask, std::string const& name, uint8 level = 0, uint8 gender = 0, uint8 race = 0, uint8 playerClass = 0);
|
||||
void UpdateGlobalPlayerMails(uint32 guid, int16 count, bool add = true);
|
||||
void UpdateGlobalPlayerGuild(uint32 guid, uint32 guildId);
|
||||
void UpdateGlobalPlayerGroup(uint32 guid, uint32 groupId);
|
||||
void UpdateGlobalPlayerArenaTeam(uint32 guid, uint8 slot, uint32 arenaTeamId);
|
||||
void UpdateGlobalNameData(uint32 guidLow, std::string const& oldName, std::string const& newName);
|
||||
void DeleteGlobalPlayerData(uint32 guid, std::string const& name);
|
||||
// xinef: Global Player Data Storage system
|
||||
void LoadGlobalPlayerDataStore();
|
||||
uint32 GetGlobalPlayerGUID(std::string const& name) const;
|
||||
GlobalPlayerData const* GetGlobalPlayerData(uint32 guid) const;
|
||||
void AddGlobalPlayerData(uint32 guid, uint32 accountId, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level, uint16 mailCount, uint32 guildId);
|
||||
void UpdateGlobalPlayerData(uint32 guid, uint8 mask, std::string const& name, uint8 level = 0, uint8 gender = 0, uint8 race = 0, uint8 playerClass = 0);
|
||||
void UpdateGlobalPlayerMails(uint32 guid, int16 count, bool add = true);
|
||||
void UpdateGlobalPlayerGuild(uint32 guid, uint32 guildId);
|
||||
void UpdateGlobalPlayerGroup(uint32 guid, uint32 groupId);
|
||||
void UpdateGlobalPlayerArenaTeam(uint32 guid, uint8 slot, uint32 arenaTeamId);
|
||||
void UpdateGlobalNameData(uint32 guidLow, std::string const& oldName, std::string const& newName);
|
||||
void DeleteGlobalPlayerData(uint32 guid, std::string const& name);
|
||||
|
||||
void ProcessCliCommands();
|
||||
void QueueCliCommand(CliCommandHolder* commandHolder) { cliCmdQueue.add(commandHolder); }
|
||||
void ProcessCliCommands();
|
||||
void QueueCliCommand(CliCommandHolder* commandHolder) { cliCmdQueue.add(commandHolder); }
|
||||
|
||||
void ForceGameEventUpdate();
|
||||
void ForceGameEventUpdate();
|
||||
|
||||
void UpdateRealmCharCount(uint32 accid);
|
||||
void UpdateRealmCharCount(uint32 accid);
|
||||
|
||||
LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if (m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; }
|
||||
LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if (m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; }
|
||||
|
||||
// used World DB version
|
||||
void LoadDBVersion();
|
||||
char const* GetDBVersion() const { return m_DBVersion.c_str(); }
|
||||
// used World DB version
|
||||
void LoadDBVersion();
|
||||
char const* GetDBVersion() const { return m_DBVersion.c_str(); }
|
||||
|
||||
void LoadAutobroadcasts();
|
||||
void LoadAutobroadcasts();
|
||||
|
||||
void UpdateAreaDependentAuras();
|
||||
void UpdateAreaDependentAuras();
|
||||
|
||||
uint32 GetCleaningFlags() const { return m_CleaningFlags; }
|
||||
void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; }
|
||||
void ResetEventSeasonalQuests(uint16 event_id);
|
||||
uint32 GetCleaningFlags() const { return m_CleaningFlags; }
|
||||
void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; }
|
||||
void ResetEventSeasonalQuests(uint16 event_id);
|
||||
|
||||
time_t GetNextTimeWithDayAndHour(int8 dayOfWeek, int8 hour); // pussywizard
|
||||
time_t GetNextTimeWithMonthAndHour(int8 month, int8 hour); // pussywizard
|
||||
time_t GetNextTimeWithDayAndHour(int8 dayOfWeek, int8 hour); // pussywizard
|
||||
time_t GetNextTimeWithMonthAndHour(int8 month, int8 hour); // pussywizard
|
||||
|
||||
std::string const& GetRealmName() const { return _realmName; } // pussywizard
|
||||
void SetRealmName(std::string name) { _realmName = name; } // pussywizard
|
||||
std::string const& GetRealmName() const { return _realmName; } // pussywizard
|
||||
void SetRealmName(std::string name) { _realmName = name; } // pussywizard
|
||||
|
||||
protected:
|
||||
void _UpdateGameTime();
|
||||
// callback for UpdateRealmCharacters
|
||||
void _UpdateRealmCharCount(PreparedQueryResult resultCharCount);
|
||||
protected:
|
||||
void _UpdateGameTime();
|
||||
// callback for UpdateRealmCharacters
|
||||
void _UpdateRealmCharCount(PreparedQueryResult resultCharCount);
|
||||
|
||||
void InitDailyQuestResetTime();
|
||||
void InitWeeklyQuestResetTime();
|
||||
void InitMonthlyQuestResetTime();
|
||||
void InitRandomBGResetTime();
|
||||
void InitCalendarOldEventsDeletionTime();
|
||||
void InitGuildResetTime();
|
||||
void ResetDailyQuests();
|
||||
void ResetWeeklyQuests();
|
||||
void ResetMonthlyQuests();
|
||||
void ResetRandomBG();
|
||||
void CalendarDeleteOldEvents();
|
||||
void ResetGuildCap();
|
||||
private:
|
||||
static std::atomic_long m_stopEvent;
|
||||
static uint8 m_ExitCode;
|
||||
uint32 m_ShutdownTimer;
|
||||
uint32 m_ShutdownMask;
|
||||
void InitDailyQuestResetTime();
|
||||
void InitWeeklyQuestResetTime();
|
||||
void InitMonthlyQuestResetTime();
|
||||
void InitRandomBGResetTime();
|
||||
void InitCalendarOldEventsDeletionTime();
|
||||
void InitGuildResetTime();
|
||||
void ResetDailyQuests();
|
||||
void ResetWeeklyQuests();
|
||||
void ResetMonthlyQuests();
|
||||
void ResetRandomBG();
|
||||
void CalendarDeleteOldEvents();
|
||||
void ResetGuildCap();
|
||||
private:
|
||||
static std::atomic_long m_stopEvent;
|
||||
static uint8 m_ExitCode;
|
||||
uint32 m_ShutdownTimer;
|
||||
uint32 m_ShutdownMask;
|
||||
|
||||
uint32 m_CleaningFlags;
|
||||
uint32 m_CleaningFlags;
|
||||
|
||||
bool m_isClosed;
|
||||
bool m_isClosed;
|
||||
|
||||
time_t m_startTime;
|
||||
time_t m_gameTime;
|
||||
IntervalTimer m_timers[WUPDATE_COUNT];
|
||||
time_t mail_expire_check_timer;
|
||||
uint32 m_updateTime, m_updateTimeSum;
|
||||
static uint32 m_gameMSTime;
|
||||
time_t m_startTime;
|
||||
time_t m_gameTime;
|
||||
IntervalTimer m_timers[WUPDATE_COUNT];
|
||||
time_t mail_expire_check_timer;
|
||||
uint32 m_updateTime, m_updateTimeSum;
|
||||
static uint32 m_gameMSTime;
|
||||
|
||||
SessionMap m_sessions;
|
||||
SessionMap m_offlineSessions;
|
||||
typedef std::unordered_map<uint32, time_t> DisconnectMap;
|
||||
DisconnectMap m_disconnects;
|
||||
uint32 m_maxActiveSessionCount;
|
||||
uint32 m_maxQueuedSessionCount;
|
||||
uint32 m_PlayerCount;
|
||||
uint32 m_MaxPlayerCount;
|
||||
SessionMap m_sessions;
|
||||
SessionMap m_offlineSessions;
|
||||
typedef std::unordered_map<uint32, time_t> DisconnectMap;
|
||||
DisconnectMap m_disconnects;
|
||||
uint32 m_maxActiveSessionCount;
|
||||
uint32 m_maxQueuedSessionCount;
|
||||
uint32 m_PlayerCount;
|
||||
uint32 m_MaxPlayerCount;
|
||||
|
||||
std::string m_newCharString;
|
||||
std::string m_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];
|
||||
typedef std::map<uint32, uint64> 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
|
||||
void DetectDBCLang();
|
||||
bool m_allowMovement;
|
||||
std::string m_dataPath;
|
||||
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];
|
||||
typedef std::map<uint32, uint64> 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
|
||||
void DetectDBCLang();
|
||||
bool m_allowMovement;
|
||||
std::string m_dataPath;
|
||||
|
||||
// for max speed access
|
||||
static float m_MaxVisibleDistanceOnContinents;
|
||||
static float m_MaxVisibleDistanceInInstances;
|
||||
static float m_MaxVisibleDistanceInBGArenas;
|
||||
// for max speed access
|
||||
static float m_MaxVisibleDistanceOnContinents;
|
||||
static float m_MaxVisibleDistanceInInstances;
|
||||
static float m_MaxVisibleDistanceInBGArenas;
|
||||
|
||||
// our speed ups
|
||||
GlobalPlayerDataMap _globalPlayerDataStore; // xinef
|
||||
GlobalPlayerNameMap _globalPlayerNameStore; // xinef
|
||||
// our speed ups
|
||||
GlobalPlayerDataMap _globalPlayerDataStore; // xinef
|
||||
GlobalPlayerNameMap _globalPlayerNameStore; // xinef
|
||||
|
||||
std::string _realmName;
|
||||
std::string _realmName;
|
||||
|
||||
// CLI command holder to be thread safe
|
||||
ACE_Based::LockedQueue<CliCommandHolder*, ACE_Thread_Mutex> cliCmdQueue;
|
||||
// CLI command holder to be thread safe
|
||||
ACE_Based::LockedQueue<CliCommandHolder*, ACE_Thread_Mutex> cliCmdQueue;
|
||||
|
||||
// next daily quests and random bg reset time
|
||||
time_t m_NextDailyQuestReset;
|
||||
time_t m_NextWeeklyQuestReset;
|
||||
time_t m_NextMonthlyQuestReset;
|
||||
time_t m_NextRandomBGReset;
|
||||
time_t m_NextCalendarOldEventsDeletionTime;
|
||||
time_t m_NextGuildReset;
|
||||
// next daily quests and random bg reset time
|
||||
time_t m_NextDailyQuestReset;
|
||||
time_t m_NextWeeklyQuestReset;
|
||||
time_t m_NextMonthlyQuestReset;
|
||||
time_t m_NextRandomBGReset;
|
||||
time_t m_NextCalendarOldEventsDeletionTime;
|
||||
time_t m_NextGuildReset;
|
||||
|
||||
//Player Queue
|
||||
Queue m_QueuedPlayer;
|
||||
//Player Queue
|
||||
Queue m_QueuedPlayer;
|
||||
|
||||
// sessions that are added async
|
||||
void AddSession_(WorldSession* s);
|
||||
ACE_Based::LockedQueue<WorldSession*, ACE_Thread_Mutex> addSessQueue;
|
||||
// sessions that are added async
|
||||
void AddSession_(WorldSession* s);
|
||||
ACE_Based::LockedQueue<WorldSession*, ACE_Thread_Mutex> addSessQueue;
|
||||
|
||||
// used versions
|
||||
std::string m_DBVersion;
|
||||
// used versions
|
||||
std::string m_DBVersion;
|
||||
|
||||
typedef std::map<uint8, std::string> AutobroadcastsMap;
|
||||
AutobroadcastsMap m_Autobroadcasts;
|
||||
typedef std::map<uint8, std::string> AutobroadcastsMap;
|
||||
AutobroadcastsMap m_Autobroadcasts;
|
||||
|
||||
typedef std::map<uint8, uint8> AutobroadcastsWeightMap;
|
||||
AutobroadcastsWeightMap m_AutobroadcastsWeights;
|
||||
typedef std::map<uint8, uint8> AutobroadcastsWeightMap;
|
||||
AutobroadcastsWeightMap m_AutobroadcastsWeights;
|
||||
|
||||
void ProcessQueryCallbacks();
|
||||
ACE_Future_Set<PreparedQueryResult> m_realmCharCallbacks;
|
||||
void ProcessQueryCallbacks();
|
||||
ACE_Future_Set<PreparedQueryResult> m_realmCharCallbacks;
|
||||
};
|
||||
|
||||
#define sWorld World::instance()
|
||||
|
||||
Reference in New Issue
Block a user