aboutsummaryrefslogtreecommitdiff
path: root/src/game/World.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/World.cpp')
-rw-r--r--src/game/World.cpp612
1 files changed, 306 insertions, 306 deletions
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 6d264cb049c..f3288d8c076 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -69,7 +69,7 @@
#include "Transports.h"
#include "ProgressBar.h"
-INSTANTIATE_SINGLETON_1( World );
+INSTANTIATE_SINGLETON_1(World);
volatile bool World::m_stopEvent = false;
uint8 World::m_ExitCode = SHUTDOWN_EXIT_CODE;
@@ -133,7 +133,7 @@ World::~World()
VMAP::VMapFactory::clear();
- if(m_resultQueue) delete m_resultQueue;
+ if (m_resultQueue) delete m_resultQueue;
//TODO free addSessQueue
}
@@ -145,12 +145,12 @@ Player* World::FindPlayerInZone(uint32 zone)
SessionMap::const_iterator itr;
for (itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
- if(!itr->second)
+ if (!itr->second)
continue;
Player *player = itr->second->GetPlayer();
- if(!player)
+ if (!player)
continue;
- if( player->IsInWorld() && player->GetZoneId() == zone )
+ if (player->IsInWorld() && player->GetZoneId() == zone)
{
// Used by the weather system. We return the player to broadcast the change weather message to him and all players in the zone.
return player;
@@ -164,7 +164,7 @@ WorldSession* World::FindSession(uint32 id) const
{
SessionMap::const_iterator itr = m_sessions.find(id);
- if(itr != m_sessions.end())
+ if (itr != m_sessions.end())
return itr->second; // also can return NULL for kicked session
else
return NULL;
@@ -176,7 +176,7 @@ bool World::RemoveSession(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);
- if(itr != m_sessions.end() && itr->second)
+ if (itr != m_sessions.end() && itr->second)
{
if (itr->second->PlayerLoading())
return false;
@@ -215,10 +215,10 @@ World::AddSession_ (WorldSession* s)
{
SessionMap::const_iterator old = m_sessions.find(s->GetAccountId ());
- if(old != m_sessions.end())
+ if (old != m_sessions.end())
{
// prevent decrease sessions count if session queued
- if(RemoveQueuedPlayer(old->second))
+ if (RemoveQueuedPlayer(old->second))
decrease_session = false;
// not remove replaced session form queue if listed
delete old->second;
@@ -233,10 +233,10 @@ World::AddSession_ (WorldSession* s)
//so we don't count the user trying to
//login as a session and queue the socket that we are using
- if(decrease_session)
+ if (decrease_session)
--Sessions;
- if (pLimit > 0 && Sessions >= pLimit && s->GetSecurity () == SEC_PLAYER && !HasRecentlyDisconnected(s) )
+ if (pLimit > 0 && Sessions >= pLimit && s->GetSecurity () == SEC_PLAYER && !HasRecentlyDisconnected(s))
{
AddQueuedPlayer (s);
UpdateMaxSessionCounters ();
@@ -275,15 +275,15 @@ World::AddSession_ (WorldSession* s)
bool World::HasRecentlyDisconnected(WorldSession* session)
{
- if(!session) return false;
+ if (!session) return false;
- if(uint32 tolerance = getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
+ if (uint32 tolerance = getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
{
- for(DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end(); )
+ for (DisconnectMap::iterator i = m_disconnects.begin(); i != m_disconnects.end();)
{
- if(difftime(i->second, time(NULL)) < tolerance)
+ if (difftime(i->second, time(NULL)) < tolerance)
{
- if(i->first == session->GetAccountId())
+ if (i->first == session->GetAccountId())
return true;
++i;
}
@@ -298,8 +298,8 @@ int32 World::GetQueuePos(WorldSession* sess)
{
uint32 position = 1;
- for(Queue::const_iterator iter = m_QueuedPlayer.begin(); iter != m_QueuedPlayer.end(); ++iter, ++position)
- if((*iter) == sess)
+ for (Queue::const_iterator iter = m_QueuedPlayer.begin(); iter != m_QueuedPlayer.end(); ++iter, ++position)
+ if ((*iter) == sess)
return position;
return 0;
@@ -334,9 +334,9 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
// search to remove and count skipped positions
bool found = false;
- for(;iter != m_QueuedPlayer.end(); ++iter, ++position)
+ for (;iter != m_QueuedPlayer.end(); ++iter, ++position)
{
- if(*iter==sess)
+ if (*iter==sess)
{
sess->SetInQueue(false);
iter = m_QueuedPlayer.erase(iter);
@@ -349,11 +349,11 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
// position store position of removed socket and then new position next socket after removed
// if session not queued then we need decrease sessions count
- if(!found && sessions)
+ if (!found && sessions)
--sessions;
// accept first in queue
- if( (!m_playerLimit || sessions < m_playerLimit) && !m_QueuedPlayer.empty() )
+ if ((!m_playerLimit || sessions < m_playerLimit) && !m_QueuedPlayer.empty())
{
WorldSession* pop_sess = m_QueuedPlayer.front();
pop_sess->SetInQueue(false);
@@ -367,7 +367,7 @@ bool World::RemoveQueuedPlayer(WorldSession* sess)
// update position from iter to end()
// iter point to first not updated socket, position store new position
- for(; iter != m_QueuedPlayer.end(); ++iter, ++position)
+ for (; iter != m_QueuedPlayer.end(); ++iter, ++position)
(*iter)->SendAuthWaitQue(position);
return found;
@@ -378,7 +378,7 @@ Weather* World::FindWeather(uint32 id) const
{
WeatherMap::const_iterator itr = m_weathers.find(id);
- if(itr != m_weathers.end())
+ if (itr != m_weathers.end())
return itr->second;
else
return 0;
@@ -390,7 +390,7 @@ void World::RemoveWeather(uint32 id)
// not called at the moment. Kept for completeness
WeatherMap::iterator itr = m_weathers.find(id);
- if(itr != m_weathers.end())
+ if (itr != m_weathers.end())
{
delete itr->second;
m_weathers.erase(itr);
@@ -403,7 +403,7 @@ Weather* World::AddWeather(uint32 zone_id)
WeatherZoneChances const* weatherChances = objmgr.GetWeatherChances(zone_id);
// zone not have weather, ignore
- if(!weatherChances)
+ if (!weatherChances)
return NULL;
Weather* w = new Weather(zone_id,weatherChances);
@@ -416,9 +416,9 @@ Weather* World::AddWeather(uint32 zone_id)
/// Initialize config values
void World::LoadConfigSettings(bool reload)
{
- if(reload)
+ if (reload)
{
- if(!sConfig.Reload())
+ if (!sConfig.Reload())
{
sLog.outError("World settings reload fail: can't read settings from %s.",sConfig.GetFilename().c_str());
return;
@@ -427,8 +427,8 @@ void World::LoadConfigSettings(bool reload)
}
///- Read the player limit and the Message of the day from the config file
- SetPlayerLimit( sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT), true );
- SetMotd( sConfig.GetStringDefault("Motd", "Welcome to a Trinity Core Server." ) );
+ SetPlayerLimit(sConfig.GetIntDefault("PlayerLimit", DEFAULT_PLAYER_LIMIT), true);
+ SetMotd(sConfig.GetStringDefault("Motd", "Welcome to a Trinity Core Server."));
///- Get string for new logins (newly created characters)
SetNewCharString(sConfig.GetStringDefault("PlayerStart.String", ""));
@@ -438,27 +438,27 @@ void World::LoadConfigSettings(bool reload)
///- Read all rates from the config file
rate_values[RATE_HEALTH] = sConfig.GetFloatDefault("Rate.Health", 1);
- if(rate_values[RATE_HEALTH] < 0)
+ if (rate_values[RATE_HEALTH] < 0)
{
sLog.outError("Rate.Health (%f) must be > 0. Using 1 instead.",rate_values[RATE_HEALTH]);
rate_values[RATE_HEALTH] = 1;
}
rate_values[RATE_POWER_MANA] = sConfig.GetFloatDefault("Rate.Mana", 1);
- if(rate_values[RATE_POWER_MANA] < 0)
+ if (rate_values[RATE_POWER_MANA] < 0)
{
sLog.outError("Rate.Mana (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_MANA]);
rate_values[RATE_POWER_MANA] = 1;
}
rate_values[RATE_POWER_RAGE_INCOME] = sConfig.GetFloatDefault("Rate.Rage.Income", 1);
rate_values[RATE_POWER_RAGE_LOSS] = sConfig.GetFloatDefault("Rate.Rage.Loss", 1);
- if(rate_values[RATE_POWER_RAGE_LOSS] < 0)
+ if (rate_values[RATE_POWER_RAGE_LOSS] < 0)
{
sLog.outError("Rate.Rage.Loss (%f) 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] = sConfig.GetFloatDefault("Rate.RunicPower.Income", 1);
rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfig.GetFloatDefault("Rate.RunicPower.Loss", 1);
- if(rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0)
+ if (rate_values[RATE_POWER_RUNICPOWER_LOSS] < 0)
{
sLog.outError("Rate.RunicPower.Loss (%f) must be > 0. Using 1 instead.",rate_values[RATE_POWER_RUNICPOWER_LOSS]);
rate_values[RATE_POWER_RUNICPOWER_LOSS] = 1;
@@ -478,7 +478,7 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_XP_QUEST] = sConfig.GetFloatDefault("Rate.XP.Quest", 1.0f);
rate_values[RATE_XP_EXPLORE] = sConfig.GetFloatDefault("Rate.XP.Explore", 1.0f);
rate_values[RATE_REPAIRCOST] = sConfig.GetFloatDefault("Rate.RepairCost", 1.0f);
- if(rate_values[RATE_REPAIRCOST] < 0.0f)
+ if (rate_values[RATE_REPAIRCOST] < 0.0f)
{
sLog.outError("Rate.RepairCost (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_REPAIRCOST]);
rate_values[RATE_REPAIRCOST] = 0.0f;
@@ -514,27 +514,27 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_MINING_NEXT] = sConfig.GetFloatDefault("Rate.Mining.Next",1.0f);
rate_values[RATE_INSTANCE_RESET_TIME] = sConfig.GetFloatDefault("Rate.InstanceResetTime",1.0f);
rate_values[RATE_TALENT] = sConfig.GetFloatDefault("Rate.Talent",1.0f);
- if(rate_values[RATE_TALENT] < 0.0f)
+ if (rate_values[RATE_TALENT] < 0.0f)
{
sLog.outError("Rate.Talent (%f) must be > 0. Using 1 instead.",rate_values[RATE_TALENT]);
rate_values[RATE_TALENT] = 1.0f;
}
rate_values[RATE_MOVESPEED] = sConfig.GetFloatDefault("Rate.MoveSpeed",1.0f);
- if(rate_values[RATE_MOVESPEED] < 0)
+ if (rate_values[RATE_MOVESPEED] < 0)
{
sLog.outError("Rate.MoveSpeed (%f) 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];
+ for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i) playerBaseMoveSpeed[i] = baseMoveSpeed[i] * rate_values[RATE_MOVESPEED];
rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfig.GetFloatDefault("Rate.Corpse.Decay.Looted",0.5f);
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfig.GetFloatDefault("TargetPosRecalculateRange",1.5f);
- if(rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE)
+ if (rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] < CONTACT_DISTANCE)
{
sLog.outError("TargetPosRecalculateRange (%f) must be >= %f. Using %f 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)
{
sLog.outError("TargetPosRecalculateRange (%f) must be <= %f. Using %f instead.",
rate_values[RATE_TARGET_POS_RECALCULATION_RANGE],NOMINAL_MELEE_RANGE,NOMINAL_MELEE_RANGE);
@@ -542,12 +542,12 @@ void World::LoadConfigSettings(bool reload)
}
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfig.GetFloatDefault("DurabilityLoss.OnDeath", 10.0f);
- if(rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f)
+ if (rate_values[RATE_DURABILITY_LOSS_ON_DEATH] < 0.0f)
{
sLog.outError("DurabilityLoss.OnDeath (%f) 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)
{
sLog.outError("DurabilityLoss.OnDeath (%f) must be <=100. Using 100.0 instead.",rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = 0.0f;
@@ -555,25 +555,25 @@ void World::LoadConfigSettings(bool reload)
rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = rate_values[RATE_DURABILITY_LOSS_ON_DEATH] / 100.0f;
rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfig.GetFloatDefault("DurabilityLossChance.Damage",0.5f);
- if(rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f)
+ if (rate_values[RATE_DURABILITY_LOSS_DAMAGE] < 0.0f)
{
sLog.outError("DurabilityLossChance.Damage (%f) 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] = sConfig.GetFloatDefault("DurabilityLossChance.Absorb",0.5f);
- if(rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f)
+ if (rate_values[RATE_DURABILITY_LOSS_ABSORB] < 0.0f)
{
sLog.outError("DurabilityLossChance.Absorb (%f) 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] = sConfig.GetFloatDefault("DurabilityLossChance.Parry",0.05f);
- if(rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f)
+ if (rate_values[RATE_DURABILITY_LOSS_PARRY] < 0.0f)
{
sLog.outError("DurabilityLossChance.Parry (%f) 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] = sConfig.GetFloatDefault("DurabilityLossChance.Block",0.05f);
- if(rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f)
+ if (rate_values[RATE_DURABILITY_LOSS_BLOCK] < 0.0f)
{
sLog.outError("DurabilityLossChance.Block (%f) must be >=0. Using 0.0 instead.",rate_values[RATE_DURABILITY_LOSS_BLOCK]);
rate_values[RATE_DURABILITY_LOSS_BLOCK] = 0.0f;
@@ -584,7 +584,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfig.GetBoolDefault("DurabilityLoss.InPvP", false);
m_configs[CONFIG_COMPRESSION] = sConfig.GetIntDefault("Compression", 1);
- if(m_configs[CONFIG_COMPRESSION] < 1 || m_configs[CONFIG_COMPRESSION] > 9)
+ if (m_configs[CONFIG_COMPRESSION] < 1 || m_configs[CONFIG_COMPRESSION] > 9)
{
sLog.outError("Compression level (%i) must be in range 1..9. Using default compression level (1).",m_configs[CONFIG_COMPRESSION]);
m_configs[CONFIG_COMPRESSION] = 1;
@@ -595,38 +595,38 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfig.GetIntDefault("DisconnectToleranceInterval", 0);
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = sConfig.GetIntDefault("GridCleanUpDelay", 5 * MINUTE * IN_MILISECONDS);
- if(m_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY)
+ if (m_configs[CONFIG_INTERVAL_GRIDCLEAN] < MIN_GRID_DELAY)
{
sLog.outError("GridCleanUpDelay (%i) must be greater %u. Use this minimal value.",m_configs[CONFIG_INTERVAL_GRIDCLEAN],MIN_GRID_DELAY);
m_configs[CONFIG_INTERVAL_GRIDCLEAN] = MIN_GRID_DELAY;
}
- if(reload)
+ if (reload)
MapManager::Instance().SetGridCleanUpDelay(m_configs[CONFIG_INTERVAL_GRIDCLEAN]);
m_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfig.GetIntDefault("MapUpdateInterval", 100);
- if(m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY)
+ if (m_configs[CONFIG_INTERVAL_MAPUPDATE] < MIN_MAP_UPDATE_DELAY)
{
sLog.outError("MapUpdateInterval (%i) must be greater %u. Use this minimal value.",m_configs[CONFIG_INTERVAL_MAPUPDATE],MIN_MAP_UPDATE_DELAY);
m_configs[CONFIG_INTERVAL_MAPUPDATE] = MIN_MAP_UPDATE_DELAY;
}
- if(reload)
+ if (reload)
MapManager::Instance().SetMapUpdateInterval(m_configs[CONFIG_INTERVAL_MAPUPDATE]);
m_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfig.GetIntDefault("ChangeWeatherInterval", 10 * MINUTE * IN_MILISECONDS);
- if(reload)
+ if (reload)
{
uint32 val = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT);
- if(val!=m_configs[CONFIG_PORT_WORLD])
+ if (val!=m_configs[CONFIG_PORT_WORLD])
sLog.outError("WorldServerPort option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_PORT_WORLD]);
}
else
m_configs[CONFIG_PORT_WORLD] = sConfig.GetIntDefault("WorldServerPort", DEFAULT_WORLDSERVER_PORT);
- if(reload)
+ if (reload)
{
uint32 val = sConfig.GetIntDefault("SocketSelectTime", DEFAULT_SOCKET_SELECT_TIME);
- if(val!=m_configs[CONFIG_SOCKET_SELECTTIME])
+ if (val!=m_configs[CONFIG_SOCKET_SELECTTIME])
sLog.outError("SocketSelectTime option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_SOCKET_SELECTTIME]);
}
else
@@ -637,19 +637,19 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_SIGHT_MONSTER] = sConfig.GetIntDefault("MonsterSight", 50);
m_configs[CONFIG_SIGHT_GUARDER] = sConfig.GetIntDefault("GuarderSight", 50);
- if(reload)
+ if (reload)
{
uint32 val = sConfig.GetIntDefault("GameType", 0);
- if(val!=m_configs[CONFIG_GAME_TYPE])
+ if (val!=m_configs[CONFIG_GAME_TYPE])
sLog.outError("GameType option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_GAME_TYPE]);
}
else
m_configs[CONFIG_GAME_TYPE] = sConfig.GetIntDefault("GameType", 0);
- if(reload)
+ if (reload)
{
uint32 val = sConfig.GetIntDefault("RealmZone", REALM_ZONE_DEVELOPMENT);
- if(val!=m_configs[CONFIG_REALM_ZONE])
+ if (val!=m_configs[CONFIG_REALM_ZONE])
sLog.outError("RealmZone option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_REALM_ZONE]);
}
else
@@ -670,21 +670,21 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_STRICT_PET_NAMES] = sConfig.GetIntDefault ("StrictPetNames", 0);
m_configs[CONFIG_MIN_PLAYER_NAME] = sConfig.GetIntDefault ("MinPlayerName", 2);
- if(m_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
+ if (m_configs[CONFIG_MIN_PLAYER_NAME] < 1 || m_configs[CONFIG_MIN_PLAYER_NAME] > MAX_PLAYER_NAME)
{
sLog.outError("MinPlayerName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_PLAYER_NAME],MAX_PLAYER_NAME);
m_configs[CONFIG_MIN_PLAYER_NAME] = 2;
}
m_configs[CONFIG_MIN_CHARTER_NAME] = sConfig.GetIntDefault ("MinCharterName", 2);
- if(m_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME)
+ if (m_configs[CONFIG_MIN_CHARTER_NAME] < 1 || m_configs[CONFIG_MIN_CHARTER_NAME] > MAX_CHARTER_NAME)
{
sLog.outError("MinCharterName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_CHARTER_NAME],MAX_CHARTER_NAME);
m_configs[CONFIG_MIN_CHARTER_NAME] = 2;
}
m_configs[CONFIG_MIN_PET_NAME] = sConfig.GetIntDefault ("MinPetName", 2);
- if(m_configs[CONFIG_MIN_PET_NAME] < 1 || m_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME)
+ if (m_configs[CONFIG_MIN_PET_NAME] < 1 || m_configs[CONFIG_MIN_PET_NAME] > MAX_PET_NAME)
{
sLog.outError("MinPetName (%i) must be in range 1..%u. Set to 2.",m_configs[CONFIG_MIN_PET_NAME],MAX_PET_NAME);
m_configs[CONFIG_MIN_PET_NAME] = 2;
@@ -693,7 +693,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_CHARACTERS_CREATING_DISABLED] = sConfig.GetIntDefault ("CharactersCreatingDisabled", 0);
m_configs[CONFIG_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("CharactersPerRealm", 10);
- if(m_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_configs[CONFIG_CHARACTERS_PER_REALM] > 10)
+ if (m_configs[CONFIG_CHARACTERS_PER_REALM] < 1 || m_configs[CONFIG_CHARACTERS_PER_REALM] > 10)
{
sLog.outError("CharactersPerRealm (%i) must be in range 1..10. Set to 10.",m_configs[CONFIG_CHARACTERS_PER_REALM]);
m_configs[CONFIG_CHARACTERS_PER_REALM] = 10;
@@ -701,14 +701,14 @@ void World::LoadConfigSettings(bool reload)
// must be after CONFIG_CHARACTERS_PER_REALM
m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfig.GetIntDefault("CharactersPerAccount", 50);
- if(m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_configs[CONFIG_CHARACTERS_PER_REALM])
+ if (m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] < m_configs[CONFIG_CHARACTERS_PER_REALM])
{
sLog.outError("CharactersPerAccount (%i) can't be less than CharactersPerRealm (%i).",m_configs[CONFIG_CHARACTERS_PER_ACCOUNT],m_configs[CONFIG_CHARACTERS_PER_REALM]);
m_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = m_configs[CONFIG_CHARACTERS_PER_REALM];
}
m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfig.GetIntDefault("HeroicCharactersPerRealm", 1);
- if(int32(m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10)
+ if (int32(m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]) < 0 || m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] > 10)
{
sLog.outError("HeroicCharactersPerRealm (%i) must be in range 0..10. Set to 1.",m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
m_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = 1;
@@ -717,22 +717,22 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_MIN_LEVEL_FOR_HEROIC_CHARACTER_CREATING] = sConfig.GetIntDefault("MinLevelForHeroicCharacterCreating", 55);
m_configs[CONFIG_SKIP_CINEMATICS] = sConfig.GetIntDefault("SkipCinematics", 0);
- if(int32(m_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_configs[CONFIG_SKIP_CINEMATICS] > 2)
+ if (int32(m_configs[CONFIG_SKIP_CINEMATICS]) < 0 || m_configs[CONFIG_SKIP_CINEMATICS] > 2)
{
sLog.outError("SkipCinematics (%i) must be in range 0..2. Set to 0.",m_configs[CONFIG_SKIP_CINEMATICS]);
m_configs[CONFIG_SKIP_CINEMATICS] = 0;
}
- if(reload)
+ if (reload)
{
uint32 val = sConfig.GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
- if(val!=m_configs[CONFIG_MAX_PLAYER_LEVEL])
+ if (val!=m_configs[CONFIG_MAX_PLAYER_LEVEL])
sLog.outError("MaxPlayerLevel option can't be changed at config reload, using current value (%u).",m_configs[CONFIG_MAX_PLAYER_LEVEL]);
}
else
m_configs[CONFIG_MAX_PLAYER_LEVEL] = sConfig.GetIntDefault("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
- if(m_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL)
+ if (m_configs[CONFIG_MAX_PLAYER_LEVEL] > MAX_LEVEL)
{
sLog.outError("MaxPlayerLevel (%i) must be in range 1..%u. Set to %u.",m_configs[CONFIG_MAX_PLAYER_LEVEL],MAX_LEVEL,MAX_LEVEL);
m_configs[CONFIG_MAX_PLAYER_LEVEL] = MAX_LEVEL;
@@ -741,25 +741,25 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfig.GetIntDefault("MinDualSpecLevel", 40);
m_configs[CONFIG_START_PLAYER_LEVEL] = sConfig.GetIntDefault("StartPlayerLevel", 1);
- if(m_configs[CONFIG_START_PLAYER_LEVEL] < 1)
+ if (m_configs[CONFIG_START_PLAYER_LEVEL] < 1)
{
sLog.outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 1.",m_configs[CONFIG_START_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_configs[CONFIG_START_PLAYER_LEVEL] = 1;
}
- else if(m_configs[CONFIG_START_PLAYER_LEVEL] > m_configs[CONFIG_MAX_PLAYER_LEVEL])
+ else if (m_configs[CONFIG_START_PLAYER_LEVEL] > m_configs[CONFIG_MAX_PLAYER_LEVEL])
{
sLog.outError("StartPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",m_configs[CONFIG_START_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_configs[CONFIG_START_PLAYER_LEVEL] = m_configs[CONFIG_MAX_PLAYER_LEVEL];
}
m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfig.GetIntDefault("StartHeroicPlayerLevel", 55);
- if(m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1)
+ if (m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] < 1)
{
sLog.outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to 55.",
m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = 55;
}
- else if(m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_configs[CONFIG_MAX_PLAYER_LEVEL])
+ else if (m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] > m_configs[CONFIG_MAX_PLAYER_LEVEL])
{
sLog.outError("StartHeroicPlayerLevel (%i) must be in range 1..MaxPlayerLevel(%u). Set to %u.",
m_configs[CONFIG_START_HEROIC_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL],m_configs[CONFIG_MAX_PLAYER_LEVEL]);
@@ -767,12 +767,12 @@ void World::LoadConfigSettings(bool reload)
}
m_configs[CONFIG_START_PLAYER_MONEY] = sConfig.GetIntDefault("StartPlayerMoney", 0);
- if(int32(m_configs[CONFIG_START_PLAYER_MONEY]) < 0)
+ if (int32(m_configs[CONFIG_START_PLAYER_MONEY]) < 0)
{
sLog.outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",m_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,0);
m_configs[CONFIG_START_PLAYER_MONEY] = 0;
}
- else if(m_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT)
+ else if (m_configs[CONFIG_START_PLAYER_MONEY] > MAX_MONEY_AMOUNT)
{
sLog.outError("StartPlayerMoney (%i) must be in range 0..%u. Set to %u.",
m_configs[CONFIG_START_PLAYER_MONEY],MAX_MONEY_AMOUNT,MAX_MONEY_AMOUNT);
@@ -780,20 +780,20 @@ void World::LoadConfigSettings(bool reload)
}
m_configs[CONFIG_MAX_HONOR_POINTS] = sConfig.GetIntDefault("MaxHonorPoints", 75000);
- if(int32(m_configs[CONFIG_MAX_HONOR_POINTS]) < 0)
+ if (int32(m_configs[CONFIG_MAX_HONOR_POINTS]) < 0)
{
sLog.outError("MaxHonorPoints (%i) can't be negative. Set to 0.",m_configs[CONFIG_MAX_HONOR_POINTS]);
m_configs[CONFIG_MAX_HONOR_POINTS] = 0;
}
m_configs[CONFIG_START_HONOR_POINTS] = sConfig.GetIntDefault("StartHonorPoints", 0);
- if(int32(m_configs[CONFIG_START_HONOR_POINTS]) < 0)
+ if (int32(m_configs[CONFIG_START_HONOR_POINTS]) < 0)
{
sLog.outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_configs[CONFIG_START_HONOR_POINTS],m_configs[CONFIG_MAX_HONOR_POINTS],0);
m_configs[CONFIG_START_HONOR_POINTS] = 0;
}
- else if(m_configs[CONFIG_START_HONOR_POINTS] > m_configs[CONFIG_MAX_HONOR_POINTS])
+ else if (m_configs[CONFIG_START_HONOR_POINTS] > m_configs[CONFIG_MAX_HONOR_POINTS])
{
sLog.outError("StartHonorPoints (%i) must be in range 0..MaxHonorPoints(%u). Set to %u.",
m_configs[CONFIG_START_HONOR_POINTS],m_configs[CONFIG_MAX_HONOR_POINTS],m_configs[CONFIG_MAX_HONOR_POINTS]);
@@ -801,20 +801,20 @@ void World::LoadConfigSettings(bool reload)
}
m_configs[CONFIG_MAX_ARENA_POINTS] = sConfig.GetIntDefault("MaxArenaPoints", 5000);
- if(int32(m_configs[CONFIG_MAX_ARENA_POINTS]) < 0)
+ if (int32(m_configs[CONFIG_MAX_ARENA_POINTS]) < 0)
{
sLog.outError("MaxArenaPoints (%i) can't be negative. Set to 0.",m_configs[CONFIG_MAX_ARENA_POINTS]);
m_configs[CONFIG_MAX_ARENA_POINTS] = 0;
}
m_configs[CONFIG_START_ARENA_POINTS] = sConfig.GetIntDefault("StartArenaPoints", 0);
- if(int32(m_configs[CONFIG_START_ARENA_POINTS]) < 0)
+ if (int32(m_configs[CONFIG_START_ARENA_POINTS]) < 0)
{
sLog.outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_configs[CONFIG_START_ARENA_POINTS],m_configs[CONFIG_MAX_ARENA_POINTS],0);
m_configs[CONFIG_START_ARENA_POINTS] = 0;
}
- else if(m_configs[CONFIG_START_ARENA_POINTS] > m_configs[CONFIG_MAX_ARENA_POINTS])
+ else if (m_configs[CONFIG_START_ARENA_POINTS] > m_configs[CONFIG_MAX_ARENA_POINTS])
{
sLog.outError("StartArenaPoints (%i) must be in range 0..MaxArenaPoints(%u). Set to %u.",
m_configs[CONFIG_START_ARENA_POINTS],m_configs[CONFIG_MAX_ARENA_POINTS],m_configs[CONFIG_MAX_ARENA_POINTS]);
@@ -833,7 +833,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfig.GetIntDefault("MaxPrimaryTradeSkill", 2);
m_configs[CONFIG_MIN_PETITION_SIGNS] = sConfig.GetIntDefault("MinPetitionSigns", 9);
- if(m_configs[CONFIG_MIN_PETITION_SIGNS] > 9)
+ if (m_configs[CONFIG_MIN_PETITION_SIGNS] > 9)
{
sLog.outError("MinPetitionSigns (%i) must be in range 0..9. Set to 9.", m_configs[CONFIG_MIN_PETITION_SIGNS]);
m_configs[CONFIG_MIN_PETITION_SIGNS] = 9;
@@ -851,13 +851,13 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
m_configs[CONFIG_ALLOW_GM_GROUP] = sConfig.GetBoolDefault("GM.AllowInvite", false);
m_configs[CONFIG_ALLOW_GM_FRIEND] = sConfig.GetBoolDefault("GM.AllowFriend", false);
- if(m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
+ if (m_configs[CONFIG_START_GM_LEVEL] < m_configs[CONFIG_START_PLAYER_LEVEL])
{
sLog.outError("GM.StartLevel (%i) must be in range StartPlayerLevel(%u)..%u. Set to %u.",
m_configs[CONFIG_START_GM_LEVEL],m_configs[CONFIG_START_PLAYER_LEVEL], MAX_LEVEL, m_configs[CONFIG_START_PLAYER_LEVEL]);
m_configs[CONFIG_START_GM_LEVEL] = m_configs[CONFIG_START_PLAYER_LEVEL];
}
- else if(m_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL)
+ else if (m_configs[CONFIG_START_GM_LEVEL] > MAX_LEVEL)
{
sLog.outError("GM.StartLevel (%i) must be in range 1..%u. Set to %u.", m_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
m_configs[CONFIG_START_GM_LEVEL] = MAX_LEVEL;
@@ -870,12 +870,12 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfig.GetIntDefault("MailDeliveryDelay",HOUR);
m_configs[CONFIG_UPTIME_UPDATE] = sConfig.GetIntDefault("UpdateUptimeInterval", 10);
- if(int32(m_configs[CONFIG_UPTIME_UPDATE])<=0)
+ if (int32(m_configs[CONFIG_UPTIME_UPDATE])<=0)
{
sLog.outError("UpdateUptimeInterval (%i) must be > 0, set to default 10.",m_configs[CONFIG_UPTIME_UPDATE]);
m_configs[CONFIG_UPTIME_UPDATE] = 10;
}
- if(reload)
+ if (reload)
{
m_timers[WUPDATE_UPTIME].SetInterval(m_configs[CONFIG_UPTIME_UPDATE]*MINUTE*IN_MILISECONDS);
m_timers[WUPDATE_UPTIME].Reset();
@@ -883,12 +883,12 @@ void World::LoadConfigSettings(bool reload)
// log db cleanup interval
m_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfig.GetIntDefault("LogDB.Opt.ClearInterval", 10);
- if(int32(m_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0)
+ if (int32(m_configs[CONFIG_LOGDB_CLEARINTERVAL]) <= 0)
{
sLog.outError("LogDB.Opt.ClearInterval (%i) must be > 0, set to default 10.", m_configs[CONFIG_LOGDB_CLEARINTERVAL]);
m_configs[CONFIG_LOGDB_CLEARINTERVAL] = 10;
}
- if(reload)
+ if (reload)
{
m_timers[WUPDATE_CLEANDB].SetInterval(m_configs[CONFIG_LOGDB_CLEARINTERVAL] * MINUTE * IN_MILISECONDS);
m_timers[WUPDATE_CLEANDB].Reset();
@@ -909,35 +909,35 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_SKILL_MILLING] = sConfig.GetBoolDefault("SkillChance.Milling",false);
m_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfig.GetIntDefault("SkillGain.Crafting", 1);
- if(m_configs[CONFIG_SKILL_GAIN_CRAFTING] < 0)
+ if (m_configs[CONFIG_SKILL_GAIN_CRAFTING] < 0)
{
sLog.outError("SkillGain.Crafting (%i) can't be negative. Set to 1.",m_configs[CONFIG_SKILL_GAIN_CRAFTING]);
m_configs[CONFIG_SKILL_GAIN_CRAFTING] = 1;
}
m_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfig.GetIntDefault("SkillGain.Defense", 1);
- if(m_configs[CONFIG_SKILL_GAIN_DEFENSE] < 0)
+ if (m_configs[CONFIG_SKILL_GAIN_DEFENSE] < 0)
{
sLog.outError("SkillGain.Defense (%i) can't be negative. Set to 1.",m_configs[CONFIG_SKILL_GAIN_DEFENSE]);
m_configs[CONFIG_SKILL_GAIN_DEFENSE] = 1;
}
m_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfig.GetIntDefault("SkillGain.Gathering", 1);
- if(m_configs[CONFIG_SKILL_GAIN_GATHERING] < 0)
+ if (m_configs[CONFIG_SKILL_GAIN_GATHERING] < 0)
{
sLog.outError("SkillGain.Gathering (%i) can't be negative. Set to 1.",m_configs[CONFIG_SKILL_GAIN_GATHERING]);
m_configs[CONFIG_SKILL_GAIN_GATHERING] = 1;
}
m_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfig.GetIntDefault("SkillGain.Weapon", 1);
- if(m_configs[CONFIG_SKILL_GAIN_WEAPON] < 0)
+ if (m_configs[CONFIG_SKILL_GAIN_WEAPON] < 0)
{
sLog.outError("SkillGain.Weapon (%i) can't be negative. Set to 1.",m_configs[CONFIG_SKILL_GAIN_WEAPON]);
m_configs[CONFIG_SKILL_GAIN_WEAPON] = 1;
}
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfig.GetIntDefault("MaxOverspeedPings",2);
- if(m_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2)
+ if (m_configs[CONFIG_MAX_OVERSPEED_PINGS] != 0 && m_configs[CONFIG_MAX_OVERSPEED_PINGS] < 2)
{
sLog.outError("MaxOverspeedPings (%i) must be in range 2..infinity (or 0 to disable check). Set to 2.",m_configs[CONFIG_MAX_OVERSPEED_PINGS]);
m_configs[CONFIG_MAX_OVERSPEED_PINGS] = 2;
@@ -950,10 +950,10 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfig.GetBoolDefault("AlwaysMaxSkillForLevel", false);
- if(reload)
+ if (reload)
{
uint32 val = sConfig.GetIntDefault("Expansion",1);
- if(val!=m_configs[CONFIG_EXPANSION])
+ if (val!=m_configs[CONFIG_EXPANSION])
sLog.outError("Expansion option can't be changed at Trinityd.conf reload, using current value (%u).",m_configs[CONFIG_EXPANSION]);
}
else
@@ -974,10 +974,10 @@ void World::LoadConfigSettings(bool reload)
// note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100)
m_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfig.GetIntDefault("Quests.LowLevelHideDiff", 4);
- if(m_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL)
+ if (m_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] > MAX_LEVEL)
m_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = MAX_LEVEL;
m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfig.GetIntDefault("Quests.HighLevelHideDiff", 7);
- if(m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL)
+ if (m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] > MAX_LEVEL)
m_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = MAX_LEVEL;
m_configs[CONFIG_DETECT_POS_COLLISION] = sConfig.GetBoolDefault("DetectPosCollision", true);
@@ -1031,10 +1031,10 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfig.GetBoolDefault("OffhandCheckAtSpellUnlearn", false);
- if(int clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0))
+ if (int clientCacheId = sConfig.GetIntDefault("ClientCacheVersion", 0))
{
// overwrite DB/old value
- if(clientCacheId > 0)
+ if (clientCacheId > 0)
{
m_configs[CONFIG_CLIENTCACHE_VERSION] = clientCacheId;
sLog.outString("Client cache version set to: %u", clientCacheId);
@@ -1053,37 +1053,37 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = GUILD_BANK_MAX_LOGS;
m_VisibleUnitGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Unit", 1);
- if(m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
+ if (m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
{
sLog.outError("Visibility.Distance.Grey.Unit can't be greater %f",MAX_VISIBILITY_DISTANCE);
m_VisibleUnitGreyDistance = MAX_VISIBILITY_DISTANCE;
}
m_VisibleObjectGreyDistance = sConfig.GetFloatDefault("Visibility.Distance.Grey.Object", 10);
- if(m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE)
+ if (m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE)
{
sLog.outError("Visibility.Distance.Grey.Object can't be greater %f",MAX_VISIBILITY_DISTANCE);
m_VisibleObjectGreyDistance = MAX_VISIBILITY_DISTANCE;
}
m_MaxVisibleDistanceForCreature = sConfig.GetFloatDefault("Visibility.Distance.Creature", DEFAULT_VISIBILITY_DISTANCE);
- if(m_MaxVisibleDistanceForCreature < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
+ if (m_MaxVisibleDistanceForCreature < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
{
sLog.outError("Visibility.Distance.Creature can't be less max aggro radius %f",45*sWorld.getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceForCreature = 45*sWorld.getRate(RATE_CREATURE_AGGRO);
}
- else if(m_MaxVisibleDistanceForCreature + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
+ else if (m_MaxVisibleDistanceForCreature + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
{
sLog.outString("Visibility. Distance .Creature can't be greater %f",MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance);
m_MaxVisibleDistanceForCreature = MAX_VISIBILITY_DISTANCE-m_VisibleUnitGreyDistance;
}
m_MaxVisibleDistanceForPlayer = sConfig.GetFloatDefault("Visibility.Distance.Player", DEFAULT_VISIBILITY_DISTANCE);
- if(m_MaxVisibleDistanceForPlayer < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
+ if (m_MaxVisibleDistanceForPlayer < 45*sWorld.getRate(RATE_CREATURE_AGGRO))
{
sLog.outError("Visibility.Distance.Player can't be less max aggro radius %f",45*sWorld.getRate(RATE_CREATURE_AGGRO));
m_MaxVisibleDistanceForPlayer = 45*sWorld.getRate(RATE_CREATURE_AGGRO);
}
- else if(m_MaxVisibleDistanceForPlayer + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
+ else if (m_MaxVisibleDistanceForPlayer + m_VisibleUnitGreyDistance > MAX_VISIBILITY_DISTANCE)
{
sLog.outString("Visibility.Distance.Player can't be greater %f",MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance);
m_MaxVisibleDistanceForPlayer = MAX_VISIBILITY_DISTANCE - m_VisibleUnitGreyDistance;
@@ -1091,37 +1091,37 @@ void World::LoadConfigSettings(bool reload)
m_MaxVisibleDistance = std::max(m_MaxVisibleDistanceForPlayer, m_MaxVisibleDistanceForCreature);
m_MaxVisibleDistanceForObject = sConfig.GetFloatDefault("Visibility.Distance.Object", DEFAULT_VISIBILITY_DISTANCE);
- if(m_MaxVisibleDistanceForObject < INTERACTION_DISTANCE)
+ if (m_MaxVisibleDistanceForObject < INTERACTION_DISTANCE)
{
sLog.outError("Visibility.Distance.Object can't be less max aggro radius %f",float(INTERACTION_DISTANCE));
m_MaxVisibleDistanceForObject = INTERACTION_DISTANCE;
}
- else if(m_MaxVisibleDistanceForObject + m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE)
+ else if (m_MaxVisibleDistanceForObject + m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE)
{
sLog.outString("Visibility.Distance.Object can't be greater %f",MAX_VISIBILITY_DISTANCE-m_VisibleObjectGreyDistance);
m_MaxVisibleDistanceForObject = MAX_VISIBILITY_DISTANCE - m_VisibleObjectGreyDistance;
}
- if(m_MaxVisibleDistance < m_MaxVisibleDistanceForObject)
+ if (m_MaxVisibleDistance < m_MaxVisibleDistanceForObject)
m_MaxVisibleDistance = m_MaxVisibleDistanceForObject;
m_MaxVisibleDistanceInFlight = sConfig.GetFloatDefault("Visibility.Distance.InFlight", DEFAULT_VISIBILITY_DISTANCE);
- if(m_MaxVisibleDistanceInFlight + m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE)
+ if (m_MaxVisibleDistanceInFlight + m_VisibleObjectGreyDistance > MAX_VISIBILITY_DISTANCE)
{
sLog.outString("Visibility.Distance.InFlight can't be greater %f",MAX_VISIBILITY_DISTANCE-m_VisibleObjectGreyDistance);
m_MaxVisibleDistanceInFlight = MAX_VISIBILITY_DISTANCE - m_VisibleObjectGreyDistance;
}
- if(m_MaxVisibleDistance < m_MaxVisibleDistanceInFlight)
+ if (m_MaxVisibleDistance < m_MaxVisibleDistanceInFlight)
m_MaxVisibleDistance = m_MaxVisibleDistanceInFlight;
m_MaxVisibleDistance += 1.0f;
///- Read the "Data" directory from the config file
std::string dataPath = sConfig.GetStringDefault("DataDir","./");
- if( dataPath.at(dataPath.length()-1)!='/' && dataPath.at(dataPath.length()-1)!='\\' )
+ if (dataPath.at(dataPath.length()-1)!='/' && dataPath.at(dataPath.length()-1)!='\\')
dataPath.append("/");
- if(reload)
+ if (reload)
{
- if(dataPath!=m_dataPath)
+ if (dataPath!=m_dataPath)
sLog.outError("DataDir option can't be changed at Trinityd.conf reload, using current value (%s).",m_dataPath.c_str());
}
else
@@ -1138,9 +1138,9 @@ void World::LoadConfigSettings(bool reload)
VMAP::VMapFactory::createOrGetVMapManager()->setEnableHeightCalc(enableHeight);
VMAP::VMapFactory::createOrGetVMapManager()->preventMapsFromBeingUsed(ignoreMapIds.c_str());
VMAP::VMapFactory::preventSpellsFromBeingTestedForLoS(ignoreSpellIds.c_str());
- sLog.outString( "WORLD: VMap support included. LineOfSight:%i, getHeight:%i",enableLOS, enableHeight);
- sLog.outString( "WORLD: VMap data directory is: %svmaps",m_dataPath.c_str());
- sLog.outString( "WORLD: VMap config keys are: vmap.enableLOS, vmap.enableHeight, vmap.ignoreMapIds, vmap.ignoreSpellIds");
+ sLog.outString("WORLD: VMap support included. LineOfSight:%i, getHeight:%i",enableLOS, enableHeight);
+ sLog.outString("WORLD: VMap data directory is: %svmaps",m_dataPath.c_str());
+ sLog.outString("WORLD: VMap config keys are: vmap.enableLOS, vmap.enableHeight, vmap.ignoreMapIds, vmap.ignoreSpellIds");
m_configs[CONFIG_MAX_WHO] = sConfig.GetIntDefault("MaxWhoListReturns", 49);
@@ -1148,7 +1148,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_BG_START_MUSIC] = sConfig.GetBoolDefault("MusicInBattleground", false);
m_configs[CONFIG_START_ALL_SPELLS] = sConfig.GetBoolDefault("PlayerStart.AllSpells", false);
m_configs[CONFIG_HONOR_AFTER_DUEL] = sConfig.GetIntDefault("HonorPointsAfterDuel", 0);
- if(m_configs[CONFIG_HONOR_AFTER_DUEL] < 0)
+ if (m_configs[CONFIG_HONOR_AFTER_DUEL] < 0)
m_configs[CONFIG_HONOR_AFTER_DUEL]= 0;
m_configs[CONFIG_START_ALL_EXPLORED] = sConfig.GetBoolDefault("PlayerStart.MapsExplored", false);
m_configs[CONFIG_START_ALL_REP] = sConfig.GetBoolDefault("PlayerStart.AllReputation", false);
@@ -1157,7 +1157,7 @@ void World::LoadConfigSettings(bool reload)
m_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfig.GetIntDefault("PvPToken.MapAllowType", 4);
m_configs[CONFIG_PVP_TOKEN_ID] = sConfig.GetIntDefault("PvPToken.ItemID", 29434);
m_configs[CONFIG_PVP_TOKEN_COUNT] = sConfig.GetIntDefault("PvPToken.ItemCount", 1);
- if(m_configs[CONFIG_PVP_TOKEN_COUNT] < 1)
+ if (m_configs[CONFIG_PVP_TOKEN_COUNT] < 1)
m_configs[CONFIG_PVP_TOKEN_COUNT] = 1;
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_START_TIME] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.StartTime", 30);
m_configs[CONFIG_OUTDOORPVP_WINTERGRASP_BATTLE_TIME] = sConfig.GetIntDefault("OutdoorPvP.Wintergrasp.BattleTime", 30);
@@ -1216,7 +1216,7 @@ void World::SetInitialWorldSettings()
objmgr.SetHighestGuids();
///- Check the existence of the map files for all races' startup areas.
- if( !MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
+ if (!MapManager::ExistMapAndVMap(0,-6240.32f, 331.033f)
||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f)
||!MapManager::ExistMapAndVMap(0,-8949.95f,-132.493f)
||!MapManager::ExistMapAndVMap(1,-618.518f,-4251.67f)
@@ -1224,7 +1224,7 @@ void World::SetInitialWorldSettings()
||!MapManager::ExistMapAndVMap(1, 10311.3f, 832.463f)
||!MapManager::ExistMapAndVMap(1,-2917.58f,-257.98f)
||m_configs[CONFIG_EXPANSION] && (
- !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f) ) )
+ !MapManager::ExistMapAndVMap(530,10349.6f,-6357.29f) || !MapManager::ExistMapAndVMap(530,-3961.64f,-13931.2f)))
{
sLog.outError("Correct *.map files not found in path '%smaps' or *.vmap/*vmdir files in '%svmaps'. Please place *.map/*.vmap/*.vmdir files in appropriate directories or correct the DataDir value in the Trinityd.conf file.",m_dataPath.c_str(),m_dataPath.c_str());
exit(1);
@@ -1232,7 +1232,7 @@ void World::SetInitialWorldSettings()
///- Loading strings. Getting no records means core load has to be canceled because no error message can be output.
sLog.outString();
- sLog.outString( "Loading Trinity strings..." );
+ sLog.outString("Loading Trinity strings...");
if (!objmgr.LoadTrinityStrings())
exit(1); // Error message displayed in function already
@@ -1252,24 +1252,24 @@ void World::SetInitialWorldSettings()
LoadDBCStores(m_dataPath);
DetectDBCLang();
- sLog.outString( "Loading Script Names...");
+ sLog.outString("Loading Script Names...");
objmgr.LoadScriptNames();
- sLog.outString( "Loading InstanceTemplate..." );
+ sLog.outString("Loading InstanceTemplate...");
objmgr.LoadInstanceTemplate();
- sLog.outString( "Loading SkillLineAbilityMultiMap Data..." );
+ sLog.outString("Loading SkillLineAbilityMultiMap Data...");
spellmgr.LoadSkillLineAbilityMap();
///- Clean up and pack instances
- sLog.outString( "Cleaning up instances..." );
+ sLog.outString("Cleaning up instances...");
sInstanceSaveManager.CleanupInstances(); // must be called before `creature_respawn`/`gameobject_respawn` tables
- sLog.outString( "Packing instances..." );
+ sLog.outString("Packing instances...");
sInstanceSaveManager.PackInstances();
sLog.outString();
- sLog.outString( "Loading Localization strings..." );
+ sLog.outString("Loading Localization strings...");
objmgr.LoadCreatureLocales();
objmgr.LoadGameObjectLocales();
objmgr.LoadItemLocales();
@@ -1279,205 +1279,205 @@ void World::SetInitialWorldSettings()
objmgr.LoadNpcOptionLocales();
objmgr.LoadPointOfInterestLocales();
objmgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
- sLog.outString( ">>> Localization strings loaded" );
+ sLog.outString(">>> Localization strings loaded");
sLog.outString();
- sLog.outString( "Loading Page Texts..." );
+ sLog.outString("Loading Page Texts...");
objmgr.LoadPageTexts();
- sLog.outString( "Loading Player info in cache..." );
+ sLog.outString("Loading Player info in cache...");
objmgr.LoadPlayerInfoInCache();
- sLog.outString( "Loading Game Object Templates..." ); // must be after LoadPageTexts
+ sLog.outString("Loading Game Object Templates..."); // must be after LoadPageTexts
objmgr.LoadGameobjectInfo();
- sLog.outString( "Loading Spell Chain Data..." );
+ sLog.outString("Loading Spell Chain Data...");
spellmgr.LoadSpellChains();
- sLog.outString( "Loading Spell Required Data..." );
+ sLog.outString("Loading Spell Required Data...");
spellmgr.LoadSpellRequired();
- sLog.outString( "Loading Spell Elixir types..." );
+ sLog.outString("Loading Spell Elixir types...");
spellmgr.LoadSpellElixirs();
- sLog.outString( "Loading Spell Learn Skills..." );
+ sLog.outString("Loading Spell Learn Skills...");
spellmgr.LoadSpellLearnSkills(); // must be after LoadSpellChains
- sLog.outString( "Loading Spell Learn Spells..." );
+ sLog.outString("Loading Spell Learn Spells...");
spellmgr.LoadSpellLearnSpells();
- sLog.outString( "Loading Spell Proc Event conditions..." );
+ sLog.outString("Loading Spell Proc Event conditions...");
spellmgr.LoadSpellProcEvents();
- sLog.outString( "Loading Spell Bonus Data..." );
+ sLog.outString("Loading Spell Bonus Data...");
spellmgr.LoadSpellBonusess();
- sLog.outString( "Loading Aggro Spells Definitions...");
+ sLog.outString("Loading Aggro Spells Definitions...");
spellmgr.LoadSpellThreats();
- sLog.outString( "Loading NPC Texts..." );
+ sLog.outString("Loading NPC Texts...");
objmgr.LoadGossipText();
- sLog.outString( "Loading Enchant Spells Proc datas...");
+ sLog.outString("Loading Enchant Spells Proc datas...");
spellmgr.LoadSpellEnchantProcData();
- sLog.outString( "Loading Item Random Enchantments Table..." );
+ sLog.outString("Loading Item Random Enchantments Table...");
LoadRandomEnchantmentsTable();
- sLog.outString( "Loading Items..." ); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
+ sLog.outString("Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
objmgr.LoadItemPrototypes();
- sLog.outString( "Loading Item Texts..." );
+ sLog.outString("Loading Item Texts...");
objmgr.LoadItemTexts();
- sLog.outString( "Loading Creature Model Based Info Data..." );
+ sLog.outString("Loading Creature Model Based Info Data...");
objmgr.LoadCreatureModelInfo();
- sLog.outString( "Loading Equipment templates...");
+ sLog.outString("Loading Equipment templates...");
objmgr.LoadEquipmentTemplates();
- sLog.outString( "Loading Creature templates..." );
+ sLog.outString("Loading Creature templates...");
objmgr.LoadCreatureTemplates();
- sLog.outString( "Loading SpellsScriptTarget...");
+ sLog.outString("Loading SpellsScriptTarget...");
spellmgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo
- sLog.outString( "Loading ItemRequiredTarget...");
+ sLog.outString("Loading ItemRequiredTarget...");
objmgr.LoadItemRequiredTarget();
- sLog.outString( "Loading Creature Reputation OnKill Data..." );
+ sLog.outString("Loading Creature Reputation OnKill Data...");
objmgr.LoadReputationOnKill();
- sLog.outString( "Loading Points Of Interest Data..." );
+ sLog.outString("Loading Points Of Interest Data...");
objmgr.LoadPointsOfInterest();
- sLog.outString( "Loading Creature Data..." );
+ sLog.outString("Loading Creature Data...");
objmgr.LoadCreatures();
- sLog.outString( "Loading Creature Linked Respawn..." );
+ sLog.outString("Loading Creature Linked Respawn...");
objmgr.LoadCreatureLinkedRespawn(); // must be after LoadCreatures()
- sLog.outString( "Loading pet levelup spells..." );
+ sLog.outString("Loading pet levelup spells...");
spellmgr.LoadPetLevelupSpellMap();
- sLog.outString( "Loading pet default spell additional to levelup spells..." );
+ sLog.outString("Loading pet default spell additional to levelup spells...");
spellmgr.LoadPetDefaultSpells();
- sLog.outString( "Loading Creature Addon Data..." );
+ sLog.outString("Loading Creature Addon Data...");
sLog.outString();
objmgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
- sLog.outString( ">>> Creature Addon Data loaded" );
+ sLog.outString(">>> Creature Addon Data loaded");
sLog.outString();
- sLog.outString( "Loading Creature Respawn Data..." ); // must be after PackInstances()
+ sLog.outString("Loading Creature Respawn Data..."); // must be after PackInstances()
objmgr.LoadCreatureRespawnTimes();
- sLog.outString( "Loading Gameobject Data..." );
+ sLog.outString("Loading Gameobject Data...");
objmgr.LoadGameobjects();
- sLog.outString( "Loading Gameobject Respawn Data..." ); // must be after PackInstances()
+ sLog.outString("Loading Gameobject Respawn Data..."); // must be after PackInstances()
objmgr.LoadGameobjectRespawnTimes();
- sLog.outString( "Loading Objects Pooling Data...");
+ sLog.outString("Loading Objects Pooling Data...");
poolhandler.LoadFromDB();
- sLog.outString( "Loading Game Event Data...");
+ sLog.outString("Loading Game Event Data...");
sLog.outString();
gameeventmgr.LoadFromDB();
- sLog.outString( ">>> Game Event Data loaded" );
+ sLog.outString(">>> Game Event Data loaded");
sLog.outString();
- sLog.outString( "Loading Weather Data..." );
+ sLog.outString("Loading Weather Data...");
objmgr.LoadWeatherZoneChances();
- sLog.outString( "Loading Quests..." );
+ sLog.outString("Loading Quests...");
objmgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
- sLog.outString( "Loading Quests Relations..." );
+ sLog.outString("Loading Quests Relations...");
sLog.outString();
objmgr.LoadQuestRelations(); // must be after quest load
- sLog.outString( ">>> Quests Relations loaded" );
+ sLog.outString(">>> Quests Relations loaded");
sLog.outString();
- sLog.outString( "Loading UNIT_NPC_FLAG_SPELLCLICK Data..." );
+ sLog.outString("Loading UNIT_NPC_FLAG_SPELLCLICK Data...");
objmgr.LoadNPCSpellClickSpells();
- sLog.outString( "Loading SpellArea Data..." ); // must be after quest load
+ sLog.outString("Loading SpellArea Data..."); // must be after quest load
spellmgr.LoadSpellAreas();
- sLog.outString( "Loading AreaTrigger definitions..." );
+ sLog.outString("Loading AreaTrigger definitions...");
objmgr.LoadAreaTriggerTeleports();
- sLog.outString( "Loading Access Requirements..." );
+ sLog.outString("Loading Access Requirements...");
objmgr.LoadAccessRequirements(); // must be after item template load
- sLog.outString( "Loading Quest Area Triggers..." );
+ sLog.outString("Loading Quest Area Triggers...");
objmgr.LoadQuestAreaTriggers(); // must be after LoadQuests
- sLog.outString( "Loading Tavern Area Triggers..." );
+ sLog.outString("Loading Tavern Area Triggers...");
objmgr.LoadTavernAreaTriggers();
- sLog.outString( "Loading AreaTrigger script names..." );
+ sLog.outString("Loading AreaTrigger script names...");
objmgr.LoadAreaTriggerScripts();
- sLog.outString( "Loading Graveyard-zone links...");
+ sLog.outString("Loading Graveyard-zone links...");
objmgr.LoadGraveyardZones();
- sLog.outString( "Loading Spell target coordinates..." );
+ sLog.outString("Loading Spell target coordinates...");
spellmgr.LoadSpellTargetPositions();
- sLog.outString( "Loading spell pet auras..." );
+ sLog.outString("Loading spell pet auras...");
spellmgr.LoadSpellPetAuras();
- sLog.outString( "Loading spell extra attributes...(TODO)" );
+ sLog.outString("Loading spell extra attributes...(TODO)");
spellmgr.LoadSpellCustomAttr();
- sLog.outString( "Loading enchant custom attributes..." );
+ sLog.outString("Loading enchant custom attributes...");
spellmgr.LoadEnchantCustomAttr();
- sLog.outString( "Loading linked spells..." );
+ sLog.outString("Loading linked spells...");
spellmgr.LoadSpellLinked();
- sLog.outString( "Loading Player Create Info & Level Stats..." );
+ sLog.outString("Loading Player Create Info & Level Stats...");
sLog.outString();
objmgr.LoadPlayerInfo();
- sLog.outString( ">>> Player Create Info & Level Stats loaded" );
+ sLog.outString(">>> Player Create Info & Level Stats loaded");
sLog.outString();
- sLog.outString( "Loading Exploration BaseXP Data..." );
+ sLog.outString("Loading Exploration BaseXP Data...");
objmgr.LoadExplorationBaseXP();
- sLog.outString( "Loading Pet Name Parts..." );
+ sLog.outString("Loading Pet Name Parts...");
objmgr.LoadPetNames();
- sLog.outString( "Loading the max pet number..." );
+ sLog.outString("Loading the max pet number...");
objmgr.LoadPetNumber();
- sLog.outString( "Loading pet level stats..." );
+ sLog.outString("Loading pet level stats...");
objmgr.LoadPetLevelInfo();
- sLog.outString( "Loading Player Corpses..." );
+ sLog.outString("Loading Player Corpses...");
objmgr.LoadCorpses();
- sLog.outString( "Loading Disabled Spells..." );
+ sLog.outString("Loading Disabled Spells...");
objmgr.LoadSpellDisabledEntrys();
- sLog.outString( "Loading Loot Tables..." );
+ sLog.outString("Loading Loot Tables...");
sLog.outString();
LoadLootTables();
- sLog.outString( ">>> Loot Tables loaded" );
+ sLog.outString(">>> Loot Tables loaded");
sLog.outString();
- sLog.outString( "Loading Skill Discovery Table..." );
+ sLog.outString("Loading Skill Discovery Table...");
LoadSkillDiscoveryTable();
- sLog.outString( "Loading Skill Extra Item Table..." );
+ sLog.outString("Loading Skill Extra Item Table...");
LoadSkillExtraItemTable();
- sLog.outString( "Loading Skill Fishing base level requirements..." );
+ sLog.outString("Loading Skill Fishing base level requirements...");
objmgr.LoadFishingBaseSkillLevel();
- sLog.outString( "Loading Achievements..." );
+ sLog.outString("Loading Achievements...");
sLog.outString();
achievementmgr.LoadAchievementReferenceList();
achievementmgr.LoadAchievementCriteriaList();
@@ -1485,69 +1485,69 @@ void World::SetInitialWorldSettings()
achievementmgr.LoadRewards();
achievementmgr.LoadRewardLocales();
achievementmgr.LoadCompletedAchievements();
- sLog.outString( ">>> Achievements loaded" );
+ sLog.outString(">>> Achievements loaded");
sLog.outString();
///- Load dynamic data tables from the database
- sLog.outString( "Loading Auctions..." );
+ sLog.outString("Loading Auctions...");
sLog.outString();
auctionmgr.LoadAuctionItems();
auctionmgr.LoadAuctions();
- sLog.outString( ">>> Auctions loaded" );
+ sLog.outString(">>> Auctions loaded");
sLog.outString();
- sLog.outString( "Loading Guilds..." );
+ sLog.outString("Loading Guilds...");
objmgr.LoadGuilds();
- sLog.outString( "Loading ArenaTeams..." );
+ sLog.outString("Loading ArenaTeams...");
objmgr.LoadArenaTeams();
- sLog.outString( "Loading Groups..." );
+ sLog.outString("Loading Groups...");
objmgr.LoadGroups();
- sLog.outString( "Loading ReservedNames..." );
+ sLog.outString("Loading ReservedNames...");
objmgr.LoadReservedPlayersNames();
- sLog.outString( "Loading GameObjects for quests..." );
+ sLog.outString("Loading GameObjects for quests...");
objmgr.LoadGameObjectForQuests();
- sLog.outString( "Loading BattleMasters..." );
+ sLog.outString("Loading BattleMasters...");
sBattleGroundMgr.LoadBattleMastersEntry();
- sLog.outString( "Loading GameTeleports..." );
+ sLog.outString("Loading GameTeleports...");
objmgr.LoadGameTele();
- sLog.outString( "Loading Npc Text Id..." );
+ sLog.outString("Loading Npc Text Id...");
objmgr.LoadNpcTextId(); // must be after load Creature and NpcText
- sLog.outString( "Loading Npc Options..." );
+ sLog.outString("Loading Npc Options...");
objmgr.LoadNpcOptions();
- sLog.outString( "Loading Vendors..." );
+ sLog.outString("Loading Vendors...");
objmgr.LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
- sLog.outString( "Loading Trainers..." );
+ sLog.outString("Loading Trainers...");
objmgr.LoadTrainerSpell(); // must be after load CreatureTemplate
- sLog.outString( "Loading Waypoints..." );
+ sLog.outString("Loading Waypoints...");
sLog.outString();
WaypointMgr.Load();
- sLog.outString( "Loading Creature Formations..." );
+ sLog.outString("Loading Creature Formations...");
formation_mgr.LoadCreatureFormations();
- sLog.outString( "Loading GM tickets...");
+ sLog.outString("Loading GM tickets...");
objmgr.LoadGMTickets();
///- Handle outdated emails (delete/return)
- sLog.outString( "Returning old mails..." );
+ sLog.outString("Returning old mails...");
objmgr.ReturnOrDeleteOldMails(false);
sLog.outString("Loading Autobroadcasts...");
LoadAutobroadcasts();
///- Load and initialize scripts
- sLog.outString( "Loading Scripts..." );
+ sLog.outString("Loading Scripts...");
sLog.outString();
objmgr.LoadQuestStartScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
objmgr.LoadQuestEndScripts(); // must be after load Creature/Gameobject(Template/Data) and QuestTemplate
@@ -1555,30 +1555,30 @@ void World::SetInitialWorldSettings()
objmgr.LoadGameObjectScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
objmgr.LoadWaypointScripts();
- sLog.outString( ">>> Scripts loaded" );
+ sLog.outString(">>> Scripts loaded");
sLog.outString();
- sLog.outString( "Loading Scripts text locales..." ); // must be after Load*Scripts calls
+ sLog.outString("Loading Scripts text locales..."); // must be after Load*Scripts calls
objmgr.LoadDbScriptStrings();
- sLog.outString( "Loading CreatureEventAI Texts...");
+ sLog.outString("Loading CreatureEventAI Texts...");
CreatureEAI_Mgr.LoadCreatureEventAI_Texts();
- sLog.outString( "Loading CreatureEventAI Summons...");
+ sLog.outString("Loading CreatureEventAI Summons...");
CreatureEAI_Mgr.LoadCreatureEventAI_Summons();
- sLog.outString( "Loading CreatureEventAI Scripts...");
+ sLog.outString("Loading CreatureEventAI Scripts...");
CreatureEAI_Mgr.LoadCreatureEventAI_Scripts();
- sLog.outString( "Initializing Scripts..." );
- if(!LoadScriptingModule())
+ sLog.outString("Initializing Scripts...");
+ if (!LoadScriptingModule())
exit(1);
/// Check db
- if(m_configs[CONFIG_CHECK_DB])
+ if (m_configs[CONFIG_CHECK_DB])
{
- sLog.outString( "Checking DB..." );
- if(!objmgr.CheckDB() || !spellmgr.CheckDB())
+ sLog.outString("Checking DB...");
+ if (!objmgr.CheckDB() || !spellmgr.CheckDB())
{
sLog.outError("Your world DB is outdated. Please reapply sqls in sql\\FULL folder, or disable CheckDB option in config file (not recommended).");
exit(1);
@@ -1588,7 +1588,7 @@ void World::SetInitialWorldSettings()
sLog.outError("You have disabled DB check. We strongly recommend you to enable it to prevent unpredictable bugs and crashes.");
///- Initialize game time and timers
- sLog.outDebug( "DEBUG:: Initialize game time and timers" );
+ sLog.outDebug("DEBUG:: Initialize game time and timers");
m_gameTime = time(NULL);
m_startTime=m_gameTime;
@@ -1597,7 +1597,7 @@ void World::SetInitialWorldSettings()
time(&curr);
local=*(localtime(&curr)); // dereference and assign
char isoDate[128];
- sprintf( isoDate, "%04d-%02d-%02d %02d:%02d:%02d",
+ sprintf(isoDate, "%04d-%02d-%02d %02d:%02d:%02d",
local.tm_year+1900, local.tm_mon+1, local.tm_mday, local.tm_hour, local.tm_min, local.tm_sec);
loginDatabase.PExecute("INSERT INTO uptime (realmid, starttime, startstring, uptime, revision) VALUES('%u', " UI64FMTD ", '%s', 0, '%s')",
@@ -1620,9 +1620,9 @@ void World::SetInitialWorldSettings()
//to set mailtimer to return mails every day between 4 and 5 am
//mailtimer is increased when updating auctions
//one second is 1000 -(tested on win system)
- mail_timer = ((((localtime( &m_gameTime )->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval() );
+ mail_timer = ((((localtime(&m_gameTime)->tm_hour + 20) % 24)* HOUR * IN_MILISECONDS) / m_timers[WUPDATE_AUCTIONS].GetInterval());
//1440
- mail_timer_expires = ( (DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
+ mail_timer_expires = ((DAY * IN_MILISECONDS) / (m_timers[WUPDATE_AUCTIONS].GetInterval()));
sLog.outDebug("Mail timer set to: %u, mail return is called every %u minutes", mail_timer, mail_timer_expires);
///- Initilize static helper structures
@@ -1630,36 +1630,36 @@ void World::SetInitialWorldSettings()
Player::InitVisibleBits();
///- Initialize MapManager
- sLog.outString( "Starting Map System" );
+ sLog.outString("Starting Map System");
MapManager::Instance().Initialize();
- sLog.outString("Starting Game Event system..." );
+ sLog.outString("Starting Game Event system...");
uint32 nextGameEvent = gameeventmgr.Initialize();
m_timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
///- Initialize Battlegrounds
- sLog.outString( "Starting BattleGround System" );
+ sLog.outString("Starting BattleGround System");
sBattleGroundMgr.CreateInitialBattleGrounds();
sBattleGroundMgr.InitAutomaticArenaPointDistribution();
///- Initialize outdoor pvp
- sLog.outString( "Starting Outdoor PvP System" );
+ sLog.outString("Starting Outdoor PvP System");
sOutdoorPvPMgr.InitOutdoorPvP();
//Not sure if this can be moved up in the sequence (with static data loading) as it uses MapManager
- sLog.outString( "Loading Transports..." );
+ sLog.outString("Loading Transports...");
MapManager::Instance().LoadTransports();
- sLog.outString( "Loading Transports Events..." );
+ sLog.outString("Loading Transports Events...");
objmgr.LoadTransportEvents();
- sLog.outString("Deleting expired bans..." );
+ sLog.outString("Deleting expired bans...");
loginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate<=UNIX_TIMESTAMP() AND unbandate<>bandate");
- sLog.outString("Calculate next daily quest reset time..." );
+ sLog.outString("Calculate next daily quest reset time...");
InitDailyQuestResetTime();
- sLog.outString("Starting objects Pooling system..." );
+ sLog.outString("Starting objects Pooling system...");
poolhandler.Initialize();
sLog.outString("Initialize AuctionHouseBot...");
@@ -1678,14 +1678,14 @@ void World::SetInitialWorldSettings()
sLog.SetLogDBLater(false);
}
- sLog.outString( "WORLD: World initialized" );
+ sLog.outString("WORLD: World initialized");
}
void World::DetectDBCLang()
{
uint32 m_lang_confid = sConfig.GetIntDefault("DBC.Locale", 255);
- if(m_lang_confid != 255 && m_lang_confid >= MAX_LOCALE)
+ if (m_lang_confid != 255 && m_lang_confid >= MAX_LOCALE)
{
sLog.outError("Incorrect DBC.Locale! Must be >= 0 and < %d (set to 0)",MAX_LOCALE);
m_lang_confid = LOCALE_enUS;
@@ -1698,7 +1698,7 @@ void World::DetectDBCLang()
int default_locale = MAX_LOCALE;
for (int i = MAX_LOCALE-1; i >= 0; --i)
{
- if ( strlen(race->name[i]) > 0) // check by race names
+ if (strlen(race->name[i]) > 0) // check by race names
{
default_locale = i;
m_availableDbcLocaleMask |= (1 << i);
@@ -1707,13 +1707,13 @@ void World::DetectDBCLang()
}
}
- if( default_locale != m_lang_confid && m_lang_confid < MAX_LOCALE &&
- (m_availableDbcLocaleMask & (1 << m_lang_confid)) )
+ if (default_locale != m_lang_confid && m_lang_confid < MAX_LOCALE &&
+ (m_availableDbcLocaleMask & (1 << m_lang_confid)))
{
default_locale = m_lang_confid;
}
- if(default_locale >= MAX_LOCALE)
+ if (default_locale >= MAX_LOCALE)
{
sLog.outError("Unable to determine your DBC Locale! (corrupt DBC?)");
exit(1);
@@ -1727,9 +1727,9 @@ void World::DetectDBCLang()
void World::RecordTimeDiff(const char *text, ...)
{
- if(m_updateTimeCount != 1)
+ if (m_updateTimeCount != 1)
return;
- if(!text)
+ if (!text)
{
m_currentTime = getMSTime();
return;
@@ -1738,12 +1738,12 @@ void World::RecordTimeDiff(const char *text, ...)
uint32 thisTime = getMSTime();
uint32 diff = getMSTimeDiff(m_currentTime, thisTime);
- if(diff > m_configs[CONFIG_MIN_LOG_UPDATE])
+ if (diff > m_configs[CONFIG_MIN_LOG_UPDATE])
{
va_list ap;
char str [256];
va_start(ap, text);
- vsnprintf(str,256,text, ap );
+ vsnprintf(str,256,text, ap);
va_end(ap);
sLog.outDetail("Difftime %s: %u.", str, diff);
}
@@ -1757,13 +1757,13 @@ void World::LoadAutobroadcasts()
QueryResult *result = WorldDatabase.Query("SELECT text FROM autobroadcast");
- if(!result)
+ if (!result)
{
barGoLink bar(1);
bar.step();
sLog.outString();
- sLog.outString( ">> Loaded 0 autobroadcasts definitions");
+ sLog.outString(">> Loaded 0 autobroadcasts definitions");
return;
}
@@ -1787,16 +1787,16 @@ void World::LoadAutobroadcasts()
delete result;
sLog.outString();
- sLog.outString( ">> Loaded %u autobroadcasts definitions", count);
+ sLog.outString(">> Loaded %u autobroadcasts definitions", count);
}
/// Update the World !
void World::Update(uint32 diff)
{
m_updateTime = uint32(diff);
- if(m_configs[CONFIG_INTERVAL_LOG_UPDATE])
+ if (m_configs[CONFIG_INTERVAL_LOG_UPDATE])
{
- if(m_updateTimeSum > m_configs[CONFIG_INTERVAL_LOG_UPDATE])
+ if (m_updateTimeSum > m_configs[CONFIG_INTERVAL_LOG_UPDATE])
{
sLog.outBasic("Update time diff: %u. Players online: %u.", m_updateTimeSum / m_updateTimeCount, GetActiveSessionCount());
m_updateTimeSum = m_updateTime;
@@ -1810,8 +1810,8 @@ void World::Update(uint32 diff)
}
///- Update the different timers
- for(int i = 0; i < WUPDATE_COUNT; ++i)
- if(m_timers[i].GetCurrent()>=0)
+ for (int i = 0; i < WUPDATE_COUNT; ++i)
+ if (m_timers[i].GetCurrent()>=0)
m_timers[i].Update(diff);
else m_timers[i].SetCurrent(0);
@@ -1819,7 +1819,7 @@ void World::Update(uint32 diff)
_UpdateGameTime();
/// Handle daily quests reset time
- if(m_gameTime > m_NextDailyQuestReset)
+ if (m_gameTime > m_NextDailyQuestReset)
{
ResetDailyQuests();
m_NextDailyQuestReset += DAY;
@@ -1862,7 +1862,7 @@ void World::Update(uint32 diff)
///- and remove Weather objects for zones with no player
//As interval > WorldTick
- if(!itr->second->Update(m_timers[WUPDATE_WEATHERS].GetInterval()))
+ if (!itr->second->Update(m_timers[WUPDATE_WEATHERS].GetInterval()))
{
delete itr->second;
m_weathers.erase(itr);
@@ -1880,7 +1880,7 @@ void World::Update(uint32 diff)
}
/// <li> Clean logs table
- if(sWorld.getConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
+ if (sWorld.getConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
{
if (m_timers[WUPDATE_CLEANDB].Passed())
{
@@ -1897,7 +1897,7 @@ void World::Update(uint32 diff)
///- Update objects when the timer has passed (maps, transport, creatures,...)
MapManager::Instance().Update(diff); // As interval = 0
- /*if(m_timers[WUPDATE_OBJECTS].Passed())
+ /*if (m_timers[WUPDATE_OBJECTS].Passed())
{
m_timers[WUPDATE_OBJECTS].Reset();
MapManager::Instance().DoDelayedMovesAndRemoves();
@@ -1905,7 +1905,7 @@ void World::Update(uint32 diff)
static uint32 autobroadcaston = 0;
autobroadcaston = sConfig.GetIntDefault("AutoBroadcast.On", 0);
- if(autobroadcaston == 1)
+ if (autobroadcaston == 1)
{
if (m_timers[WUPDATE_AUTOBROADCAST].Passed())
{
@@ -1968,7 +1968,7 @@ void World::SendGlobalMessage(WorldPacket *packet, WorldSession *self, uint32 te
itr->second->GetPlayer() &&
itr->second->GetPlayer()->IsInWorld() &&
itr->second != self &&
- (team == 0 || itr->second->GetPlayer()->GetTeam() == team) )
+ (team == 0 || itr->second->GetPlayer()->GetTeam() == team))
{
itr->second->SendPacket(packet);
}
@@ -1986,7 +1986,7 @@ void World::SendGlobalGMMessage(WorldPacket *packet, WorldSession *self, uint32
itr->second->GetPlayer()->IsInWorld() &&
itr->second != self &&
itr->second->GetSecurity() > SEC_PLAYER &&
- (team == 0 || itr->second->GetPlayer()->GetTeam() == team) )
+ (team == 0 || itr->second->GetPlayer()->GetTeam() == team))
{
itr->second->SendPacket(packet);
}
@@ -2004,14 +2004,14 @@ namespace MaNGOS
{
char const* text = objmgr.GetMangosString(i_textId,loc_idx);
- if(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 );
+ vsnprintf(str,2048,text, ap);
va_end(ap);
do_helper(data_list,&str[0]);
@@ -2058,9 +2058,9 @@ void World::SendWorldText(int32 string_id, ...)
MaNGOS::WorldWorldTextBuilder wt_builder(string_id, &ap);
MaNGOS::LocalizedPacketListDo<MaNGOS::WorldWorldTextBuilder> wt_do(wt_builder);
- for(SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
+ for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
- if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() )
+ if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
continue;
wt_do(itr->second->GetPlayer());
@@ -2077,12 +2077,12 @@ void World::SendGMText(int32 string_id, ...)
MaNGOS::WorldWorldTextBuilder wt_builder(string_id, &ap);
MaNGOS::LocalizedPacketListDo<MaNGOS::WorldWorldTextBuilder> wt_do(wt_builder);
- for(SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
+ for (SessionMap::iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
{
- if(!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld() )
+ if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
continue;
- if(itr->second->GetSecurity() < SEC_MODERATOR )
+ if (itr->second->GetSecurity() < SEC_MODERATOR)
continue;
wt_do(itr->second->GetPlayer());
@@ -2120,7 +2120,7 @@ void World::SendZoneMessage(uint32 zone, WorldPacket *packet, WorldSession *self
itr->second->GetPlayer()->IsInWorld() &&
itr->second->GetPlayer()->GetZoneId() == zone &&
itr->second != self &&
- (team == 0 || itr->second->GetPlayer()->GetTeam() == team) )
+ (team == 0 || itr->second->GetPlayer()->GetTeam() == team))
{
itr->second->SendPacket(packet);
}
@@ -2150,7 +2150,7 @@ 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)
- if(itr->second->GetSecurity() < sec)
+ if (itr->second->GetSecurity() < sec)
itr->second->KickPlayer();
}
@@ -2185,9 +2185,9 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
return BAN_SYNTAX_ERROR;
}
- if(!resultAccounts)
+ if (!resultAccounts)
{
- if(mode==BAN_IP)
+ if (mode==BAN_IP)
return BAN_SUCCESS; // ip correctly banned but nobody affected (yet)
else
return BAN_NOTFOUND; // Nobody to ban
@@ -2199,7 +2199,7 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
Field* fieldsAccount = resultAccounts->Fetch();
uint32 account = fieldsAccount->GetUInt32();
- if(mode!=BAN_IP)
+ if (mode!=BAN_IP)
{
//No SQL injection as strings are escaped
loginDatabase.PExecute("INSERT INTO account_banned VALUES ('%u', UNIX_TIMESTAMP(), UNIX_TIMESTAMP()+%u, '%s', '%s', '1')",
@@ -2207,10 +2207,10 @@ BanReturn World::BanAccount(BanMode mode, std::string nameOrIP, std::string dura
}
if (WorldSession* sess = FindSession(account))
- if(std::string(sess->GetPlayerName()) != author)
+ if (std::string(sess->GetPlayerName()) != author)
sess->KickPlayer();
}
- while( resultAccounts->NextRow() );
+ while(resultAccounts->NextRow());
delete resultAccounts;
return BAN_SUCCESS;
@@ -2250,12 +2250,12 @@ void World::_UpdateGameTime()
m_gameTime = thisTime;
///- if there is a shutdown timer
- if(!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0)
+ if (!m_stopEvent && m_ShutdownTimer > 0 && elapsed > 0)
{
///- ... and it is overdue, stop the world (set m_stopEvent)
- if( m_ShutdownTimer <= elapsed )
+ if (m_ShutdownTimer <= elapsed)
{
- if(!(m_ShutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount()==0)
+ if (!(m_ShutdownMask & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount()==0)
m_stopEvent = true; // exist code already set
else
m_ShutdownTimer = 1; // minimum timer value to wait idle state
@@ -2274,16 +2274,16 @@ void World::_UpdateGameTime()
void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode)
{
// ignore if server shutdown at next tick
- if(m_stopEvent)
+ if (m_stopEvent)
return;
m_ShutdownMask = options;
m_ExitCode = exitcode;
///- If the shutdown time is 0, set m_stopEvent (except if shutdown is 'idle' with remaining sessions)
- if(time==0)
+ if (time==0)
{
- if(!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount()==0)
+ if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount()==0)
m_stopEvent = true; // exist code already set
else
m_ShutdownTimer = 1; //So that the session count is re-evaluated at next world tick
@@ -2300,22 +2300,22 @@ void World::ShutdownServ(uint32 time, uint32 options, uint8 exitcode)
void World::ShutdownMsg(bool show, Player* player)
{
// not show messages for idle shutdown mode
- if(m_ShutdownMask & SHUTDOWN_MASK_IDLE)
+ if (m_ShutdownMask & SHUTDOWN_MASK_IDLE)
return;
///- Display a message every 12 hours, hours, 5 minutes, minute, 5 seconds and finally seconds
- if ( show ||
+ if (show ||
(m_ShutdownTimer < 10) ||
// < 30 sec; every 5 sec
- (m_ShutdownTimer<30 && (m_ShutdownTimer % 5 )==0) ||
+ (m_ShutdownTimer<30 && (m_ShutdownTimer % 5)==0) ||
// < 5 min ; every 1 min
- (m_ShutdownTimer<5*MINUTE && (m_ShutdownTimer % MINUTE )==0) ||
+ (m_ShutdownTimer<5*MINUTE && (m_ShutdownTimer % MINUTE)==0) ||
// < 30 min ; every 5 min
(m_ShutdownTimer<30*MINUTE && (m_ShutdownTimer % (5*MINUTE))==0) ||
// < 12 h ; every 1 h
- (m_ShutdownTimer<12*HOUR && (m_ShutdownTimer % HOUR )==0) ||
+ (m_ShutdownTimer<12*HOUR && (m_ShutdownTimer % HOUR)==0) ||
// > 12 h ; every 12 h
- (m_ShutdownTimer>12*HOUR && (m_ShutdownTimer % (12*HOUR) )==0))
+ (m_ShutdownTimer>12*HOUR && (m_ShutdownTimer % (12*HOUR))==0))
{
std::string str = secsToTimeString(m_ShutdownTimer);
@@ -2330,7 +2330,7 @@ void World::ShutdownMsg(bool show, Player* player)
void World::ShutdownCancel()
{
// nothing cancel or too later
- if(!m_ShutdownTimer || m_stopEvent)
+ if (!m_ShutdownTimer || m_stopEvent)
return;
ServerMessageType msgid = (m_ShutdownMask & SHUTDOWN_MASK_RESTART) ? SERVER_MSG_RESTART_CANCELLED : SERVER_MSG_SHUTDOWN_CANCELLED;
@@ -2348,16 +2348,16 @@ void World::SendServerMessage(ServerMessageType type, const char *text, Player*
{
WorldPacket data(SMSG_SERVER_MESSAGE, 50); // guess size
data << uint32(type);
- if(type <= SERVER_MSG_STRING)
+ if (type <= SERVER_MSG_STRING)
data << text;
- if(player)
+ if (player)
player->GetSession()->SendPacket(&data);
else
- SendGlobalMessage( &data );
+ SendGlobalMessage(&data);
}
-void World::UpdateSessions( uint32 diff )
+void World::UpdateSessions(uint32 diff)
{
///- Add new sessions
WorldSession* sess;
@@ -2370,13 +2370,13 @@ void World::UpdateSessions( uint32 diff )
next = itr;
++next;
- if(!itr->second)
+ if (!itr->second)
continue;
///- and remove not active sessions from the list
- if(!itr->second->Update(diff)) // As interval = 0
+ if (!itr->second->Update(diff)) // As interval = 0
{
- if(!RemoveQueuedPlayer(itr->second) && itr->second && getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
+ if (!RemoveQueuedPlayer(itr->second) && itr->second && getConfig(CONFIG_INTERVAL_DISCONNECT_TOLERANCE))
m_disconnects[itr->second->GetAccountId()] = time(NULL);
delete itr->second;
m_sessions.erase(itr);
@@ -2405,7 +2405,7 @@ void World::ProcessCliCommands()
void World::SendRNDBroadcast()
{
- if(m_Autobroadcasts.empty())
+ if (m_Autobroadcasts.empty())
return;
std::string msg;
@@ -2416,13 +2416,13 @@ void World::SendRNDBroadcast()
static uint32 abcenter = 0;
abcenter = sConfig.GetIntDefault("AutoBroadcast.Center", 0);
- if(abcenter == 0)
+ if (abcenter == 0)
{
sWorld.SendWorldText(LANG_AUTO_BROADCAST, msg.c_str());
sLog.outString("AutoBroadcast: '%s'",msg.c_str());
}
- if(abcenter == 1)
+ if (abcenter == 1)
{
WorldPacket data(SMSG_NOTIFICATION, (msg.size()+1));
data << msg;
@@ -2430,7 +2430,7 @@ void World::SendRNDBroadcast()
sLog.outString("AutoBroadcast: '%s'",msg.c_str());
}
- if(abcenter == 2)
+ if (abcenter == 2)
{
sWorld.SendWorldText(LANG_AUTO_BROADCAST, msg.c_str());
@@ -2476,7 +2476,7 @@ void World::InitDailyQuestResetTime()
time_t mostRecentQuestTime;
QueryResult* result = CharacterDatabase.Query("SELECT MAX(time) FROM character_queststatus_daily");
- if(result)
+ if (result)
{
Field *fields = result->Fetch();
@@ -2501,7 +2501,7 @@ void World::InitDailyQuestResetTime()
time_t resetTime = (curTime < curDayResetTime) ? curDayResetTime - DAY : curDayResetTime;
// need reset (if we have quest time before last reset time (not processed by some reason)
- if(mostRecentQuestTime && mostRecentQuestTime <= resetTime)
+ if (mostRecentQuestTime && mostRecentQuestTime <= resetTime)
m_NextDailyQuestReset = mostRecentQuestTime;
else
{
@@ -2514,8 +2514,8 @@ void World::ResetDailyQuests()
{
sLog.outDetail("Daily quests reset for all characters.");
CharacterDatabase.Execute("DELETE FROM character_queststatus_daily");
- for(SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
- if(itr->second->GetPlayer())
+ for (SessionMap::const_iterator itr = m_sessions.begin(); itr != m_sessions.end(); ++itr)
+ if (itr->second->GetPlayer())
itr->second->GetPlayer()->ResetDailyQuestStatus();
}
@@ -2530,7 +2530,7 @@ void World::UpdateAllowedSecurity()
}
}
-void World::SetPlayerLimit( int32 limit, bool needUpdate )
+void World::SetPlayerLimit(int32 limit, bool needUpdate)
{
m_playerLimit = limit;
}
@@ -2545,7 +2545,7 @@ void World::LoadDBVersion()
{
QueryResult* result = WorldDatabase.Query("SELECT db_version, script_version, cache_id FROM version LIMIT 1");
//QueryResult* result = WorldDatabase.Query("SELECT version, creature_ai_version, cache_id FROM db_version LIMIT 1");
- if(result)
+ if (result)
{
Field* fields = result->Fetch();
@@ -2557,9 +2557,9 @@ void World::LoadDBVersion()
delete result;
}
- if(m_DBVersion.empty())
+ if (m_DBVersion.empty())
m_DBVersion = "Unknown world database.";
- if(m_CreatureEventAIVersion.empty())
+ if (m_CreatureEventAIVersion.empty())
m_CreatureEventAIVersion = "Unknown creature EventAI.";
}