AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
World Class Reference

The World. More...

#include "World.h"

Inheritance diagram for World:
IWorld

Public Types

typedef std::list< WorldSession * > Queue
 

Public Member Functions

 World ()
 World constructor.
 
 ~World () override
 World destructor.
 
WorldSessionFindSession (uint32 id) const override
 Find a session by its id.
 
WorldSessionFindOfflineSession (uint32 id) const override
 
WorldSessionFindOfflineSessionForCharacterGUID (ObjectGuid::LowType guidLow) const override
 
void AddSession (WorldSession *s) override
 
bool KickSession (uint32 id) override
 Remove a given session.
 
void UpdateMaxSessionCounters () override
 Get the number of current active sessions.
 
const SessionMapGetAllSessions () const override
 
uint32 GetActiveAndQueuedSessionCount () const override
 
uint32 GetActiveSessionCount () const override
 
uint32 GetQueuedSessionCount () const override
 
uint32 GetMaxQueuedSessionCount () const override
 Get the maximum number of parallel sessions on the server since last reboot.
 
uint32 GetMaxActiveSessionCount () const override
 
uint32 GetPlayerCount () const override
 Get number of players.
 
uint32 GetMaxPlayerCount () const override
 
void IncreasePlayerCount () override
 Increase/Decrease number of players.
 
void DecreasePlayerCount () override
 
PlayerFindPlayerInZone (uint32 zone) override
 Find a player in a specified zone.
 
bool IsClosed () const override
 Deny clients?
 
void SetClosed (bool val) override
 Close world.
 
AccountTypes GetPlayerSecurityLimit () const override
 Security level limitations.
 
void SetPlayerSecurityLimit (AccountTypes sec) override
 
void LoadDBAllowedSecurityLevel () override
 
void SetPlayerAmountLimit (uint32 limit) override
 Active session server limit.
 
uint32 GetPlayerAmountLimit () const override
 
void AddQueuedPlayer (WorldSession *) override
 
bool RemoveQueuedPlayer (WorldSession *session) override
 
int32 GetQueuePos (WorldSession *) override
 
bool HasRecentlyDisconnected (WorldSession *) override
 
bool getAllowMovement () const override
 
void SetAllowMovement (bool allow) override
 Allow/Disallow object movements.
 
void SetNewCharString (std::string const &str) override
 Set the string for new characters (first login)
 
std::string const & GetNewCharString () const override
 Get the string for new characters (first login)
 
LocaleConstant GetDefaultDbcLocale () const override
 
std::string const & GetDataPath () const override
 Get the path where data (dbc, maps) are stored on disk.
 
Seconds GetNextDailyQuestsResetTime () const override
 Next daily quests and random bg reset time.
 
Seconds GetNextWeeklyQuestsResetTime () const override
 
Seconds GetNextRandomBGResetTime () const override
 
uint16 GetConfigMaxSkillValue () const override
 Get the maximum skill level a player can reach.
 
void SetInitialWorldSettings () override
 Initialize the World.
 
void LoadConfigSettings (bool reload=false) override
 Initialize config values.
 
void SendWorldText (uint32 string_id,...) override
 Send a System Message to all players (except self if mentioned)
 
void SendGlobalText (const char *text, WorldSession *self) override
 
void SendGMText (uint32 string_id,...) override
 Send a System Message to all GMs (except self if mentioned)
 
void SendGlobalMessage (WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL) override
 Send a packet to all players (except self if mentioned)
 
void SendGlobalGMMessage (WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL) override
 Send a packet to all GMs (except self if mentioned)
 
bool SendZoneMessage (uint32 zone, WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL) override
 Send a packet to all players (or players selected team) in the zone (except self if mentioned)
 
void SendZoneText (uint32 zone, const char *text, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL) override
 Send a System Message to all players in the zone (except self if mentioned)
 
void SendServerMessage (ServerMessageType messageID, std::string stringParam="", Player *player=nullptr) override
 Send a server message to the user(s)
 
void SendWorldTextOptional (uint32 string_id, uint32 flag,...) override
 
bool IsShuttingDown () const override
 Are we in the middle of a shutdown?
 
uint32 GetShutDownTimeLeft () const override
 
void ShutdownServ (uint32 time, uint32 options, uint8 exitcode, const std::string &reason=std::string()) override
 Shutdown the server.
 
void ShutdownCancel () override
 Cancel a planned server shutdown.
 
void ShutdownMsg (bool show=false, Player *player=nullptr, const std::string &reason=std::string()) override
 Display a shutdown message to the user(s)
 
void Update (uint32 diff) override
 Update the World !
 
void UpdateSessions (uint32 diff) override
 
void setRate (Rates rate, float value) override
 Set a server rate (see Rates)
 
float getRate (Rates rate) const override
 Get a server rate (see Rates)
 
void setBoolConfig (WorldBoolConfigs index, bool value) override
 Set a server configuration element (see #WorldConfigs)
 
bool getBoolConfig (WorldBoolConfigs index) const override
 Get a server configuration element (see #WorldConfigs)
 
void setFloatConfig (WorldFloatConfigs index, float value) override
 Set a server configuration element (see #WorldConfigs)
 
float getFloatConfig (WorldFloatConfigs index) const override
 Get a server configuration element (see #WorldConfigs)
 
void setIntConfig (WorldIntConfigs index, uint32 value) override
 Set a server configuration element (see #WorldConfigs)
 
uint32 getIntConfig (WorldIntConfigs index) const override
 Get a server configuration element (see #WorldConfigs)
 
void setWorldState (uint32 index, uint64 value) override
 
uint64 getWorldState (uint32 index) const override
 
void LoadWorldStates () override
 
bool IsPvPRealm () const override
 Are we on a "Player versus Player" server?
 
bool IsFFAPvPRealm () const override
 
void KickAll () override
 Kick (and save) all players.
 
void KickAllLess (AccountTypes sec) override
 Kick (and save) all players with security level less sec
 
uint32 GetNextWhoListUpdateDelaySecs () override
 
void ProcessCliCommands () override
 
void QueueCliCommand (CliCommandHolder *commandHolder) override
 
void ForceGameEventUpdate () override
 
void UpdateRealmCharCount (uint32 accid) override
 
LocaleConstant GetAvailableDbcLocale (LocaleConstant locale) const override
 
void LoadDBVersion () override
 
char const * GetDBVersion () const override
 
void LoadMotd () override
 
void UpdateAreaDependentAuras () override
 
uint32 GetCleaningFlags () const override
 
void SetCleaningFlags (uint32 flags) override
 
void ResetEventSeasonalQuests (uint16 event_id) override
 
std::string const & GetRealmName () const override
 
void SetRealmName (std::string name) override
 
void RemoveOldCorpses () override
 
- Public Member Functions inherited from IWorld
virtual ~IWorld ()=default
 
virtual WorldSessionFindSession (uint32 id) const =0
 
virtual WorldSessionFindOfflineSession (uint32 id) const =0
 
virtual WorldSessionFindOfflineSessionForCharacterGUID (ObjectGuid::LowType guidLow) const =0
 
virtual void AddSession (WorldSession *s)=0
 
virtual bool KickSession (uint32 id)=0
 
virtual void UpdateMaxSessionCounters ()=0
 
virtual const SessionMapGetAllSessions () const =0
 
virtual uint32 GetActiveAndQueuedSessionCount () const =0
 
virtual uint32 GetActiveSessionCount () const =0
 
virtual uint32 GetQueuedSessionCount () const =0
 
virtual uint32 GetMaxQueuedSessionCount () const =0
 
virtual uint32 GetMaxActiveSessionCount () const =0
 
virtual uint32 GetPlayerCount () const =0
 
virtual uint32 GetMaxPlayerCount () const =0
 
virtual void IncreasePlayerCount ()=0
 
virtual void DecreasePlayerCount ()=0
 
virtual PlayerFindPlayerInZone (uint32 zone)=0
 
virtual bool IsClosed () const =0
 
virtual void SetClosed (bool val)=0
 
virtual AccountTypes GetPlayerSecurityLimit () const =0
 
virtual void SetPlayerSecurityLimit (AccountTypes sec)=0
 
virtual void LoadDBAllowedSecurityLevel ()=0
 
virtual void SetPlayerAmountLimit (uint32 limit)=0
 
virtual uint32 GetPlayerAmountLimit () const =0
 
virtual void AddQueuedPlayer (WorldSession *)=0
 
virtual bool RemoveQueuedPlayer (WorldSession *session)=0
 
virtual int32 GetQueuePos (WorldSession *)=0
 
virtual bool HasRecentlyDisconnected (WorldSession *)=0
 
virtual bool getAllowMovement () const =0
 
virtual void SetAllowMovement (bool allow)=0
 
virtual void SetNewCharString (std::string const &str)=0
 
virtual std::string const & GetNewCharString () const =0
 
virtual LocaleConstant GetDefaultDbcLocale () const =0
 
virtual std::string const & GetDataPath () const =0
 
virtual Seconds GetNextDailyQuestsResetTime () const =0
 
virtual Seconds GetNextWeeklyQuestsResetTime () const =0
 
virtual Seconds GetNextRandomBGResetTime () const =0
 
virtual uint16 GetConfigMaxSkillValue () const =0
 
virtual void SetInitialWorldSettings ()=0
 
virtual void LoadConfigSettings (bool reload=false)=0
 
virtual void SendWorldText (uint32 string_id,...)=0
 
virtual void SendWorldTextOptional (uint32 string_id, uint32 flag,...)=0
 
virtual void SendGlobalText (const char *text, WorldSession *self)=0
 
virtual void SendGMText (uint32 string_id,...)=0
 
virtual void SendGlobalMessage (WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL)=0
 
virtual void SendGlobalGMMessage (WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL)=0
 
virtual bool SendZoneMessage (uint32 zone, WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL)=0
 
virtual void SendZoneText (uint32 zone, const char *text, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL)=0
 
virtual void SendServerMessage (ServerMessageType messageID, std::string stringParam="", Player *player=nullptr)=0
 
virtual bool IsShuttingDown () const =0
 
virtual uint32 GetShutDownTimeLeft () const =0
 
virtual void ShutdownServ (uint32 time, uint32 options, uint8 exitcode, const std::string &reason=std::string())=0
 
virtual void ShutdownCancel ()=0
 
virtual void ShutdownMsg (bool show=false, Player *player=nullptr, const std::string &reason=std::string())=0
 
virtual void Update (uint32 diff)=0
 
virtual void UpdateSessions (uint32 diff)=0
 
virtual void setRate (Rates rate, float value)=0
 
virtual float getRate (Rates rate) const =0
 
virtual void setBoolConfig (WorldBoolConfigs index, bool value)=0
 
virtual bool getBoolConfig (WorldBoolConfigs index) const =0
 
virtual void setFloatConfig (WorldFloatConfigs index, float value)=0
 
virtual float getFloatConfig (WorldFloatConfigs index) const =0
 
virtual void setIntConfig (WorldIntConfigs index, uint32 value)=0
 
virtual uint32 getIntConfig (WorldIntConfigs index) const =0
 
virtual void setWorldState (uint32 index, uint64 value)=0
 
virtual uint64 getWorldState (uint32 index) const =0
 
virtual void LoadWorldStates ()=0
 
virtual bool IsPvPRealm () const =0
 
virtual bool IsFFAPvPRealm () const =0
 
virtual void KickAll ()=0
 
virtual void KickAllLess (AccountTypes sec)=0
 
virtual uint32 GetNextWhoListUpdateDelaySecs ()=0
 
virtual void ProcessCliCommands ()=0
 
virtual void QueueCliCommand (CliCommandHolder *commandHolder)=0
 
virtual void ForceGameEventUpdate ()=0
 
virtual void UpdateRealmCharCount (uint32 accid)=0
 
virtual LocaleConstant GetAvailableDbcLocale (LocaleConstant locale) const =0
 
virtual void LoadDBVersion ()=0
 
virtual char const * GetDBVersion () const =0
 
virtual void LoadMotd ()=0
 
virtual void UpdateAreaDependentAuras ()=0
 
virtual uint32 GetCleaningFlags () const =0
 
virtual void SetCleaningFlags (uint32 flags)=0
 
virtual void ResetEventSeasonalQuests (uint16 event_id)=0
 
virtual std::string const & GetRealmName () const =0
 
virtual void SetRealmName (std::string name)=0
 
virtual void RemoveOldCorpses ()=0
 

Static Public Member Functions

static Worldinstance ()
 
static uint8 GetExitCode ()
 
static void StopNow (uint8 exitcode)
 
static bool IsStopped ()
 
static float GetMaxVisibleDistanceOnContinents ()
 
static float GetMaxVisibleDistanceInInstances ()
 
static float GetMaxVisibleDistanceInBGArenas ()
 

Static Public Attributes

static uint32 m_worldLoopCounter = 0
 

Protected Member Functions

void _UpdateGameTime ()
 Update the game time.
 
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 Types

typedef std::unordered_map< uint32, time_t > DisconnectMap
 
typedef std::map< uint32, uint64WorldStatesMap
 

Private Member Functions

void DetectDBCLang ()
 
void AddSession_ (WorldSession *s)
 
void ProcessQueryCallbacks ()
 
void FinalizePlayerWorldSession (WorldSession *session)
 Executed when a World Session is being finalized. Be it from a normal login or via queue popping.
 

Private Attributes

uint32 _shutdownTimer
 
uint32 _shutdownMask
 
uint32 _cleaningFlags
 
bool _isClosed
 
IntervalTimer _timers [WUPDATE_COUNT]
 
Seconds _mail_expire_check_timer
 
SessionMap _sessions
 
SessionMap _offlineSessions
 
DisconnectMap _disconnects
 
uint32 _maxActiveSessionCount
 
uint32 _maxQueuedSessionCount
 
uint32 _playerCount
 
uint32 _maxPlayerCount
 
std::string _newCharString
 
float _rate_values [MAX_RATES]
 
uint32 _int_configs [INT_CONFIG_VALUE_COUNT]
 
bool _bool_configs [BOOL_CONFIG_VALUE_COUNT]
 
float _float_configs [FLOAT_CONFIG_VALUE_COUNT]
 
WorldStatesMap _worldstates
 
uint32 _playerLimit
 
AccountTypes _allowedSecurityLevel
 
LocaleConstant _defaultDbcLocale
 
uint32 _availableDbcLocaleMask
 
bool _allowMovement
 
std::string _dataPath
 
std::string _realmName
 
LockedQueue< CliCommandHolder * > _cliCmdQueue
 
Seconds _nextDailyQuestReset
 
Seconds _nextWeeklyQuestReset
 
Seconds _nextMonthlyQuestReset
 
Seconds _nextRandomBGReset
 
Seconds _nextCalendarOldEventsDeletionTime
 
Seconds _nextGuildReset
 
Queue _queuedPlayer
 
LockedQueue< WorldSession * > _addSessQueue
 
std::string _dbVersion
 
QueryCallbackProcessor _queryProcessor
 

Static Private Attributes

static std::atomic_long _stopEvent = false
 
static uint8 _exitCode = SHUTDOWN_EXIT_CODE
 
static float _maxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE
 
static float _maxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE
 
static float _maxVisibleDistanceInBGArenas = DEFAULT_VISIBILITY_BGARENAS
 

Detailed Description

The World.

Member Typedef Documentation

◆ DisconnectMap

typedef std::unordered_map<uint32, time_t> World::DisconnectMap
private

◆ Queue

typedef std::list<WorldSession*> World::Queue

◆ WorldStatesMap

typedef std::map<uint32, uint64> World::WorldStatesMap
private

Constructor & Destructor Documentation

◆ World()

World::World ( )

World constructor.

117{
118 _playerLimit = 0;
120 _allowMovement = true;
121 _shutdownMask = 0;
122 _shutdownTimer = 0;
125 _playerCount = 0;
126 _maxPlayerCount = 0;
132 _nextGuildReset = 0s;
135 _isClosed = false;
136 _cleaningFlags = 0;
137
138 memset(_rate_values, 0, sizeof(_rate_values));
139 memset(_int_configs, 0, sizeof(_int_configs));
140 memset(_bool_configs, 0, sizeof(_bool_configs));
141 memset(_float_configs, 0, sizeof(_float_configs));
142}
@ LOCALE_enUS
Definition: Common.h:75
@ SEC_PLAYER
Definition: Common.h:66
Seconds _nextGuildReset
Definition: World.h:427
uint32 _shutdownMask
Definition: World.h:377
bool _bool_configs[BOOL_CONFIG_VALUE_COUNT]
Definition: World.h:399
uint32 _cleaningFlags
Definition: World.h:379
float _float_configs[FLOAT_CONFIG_VALUE_COUNT]
Definition: World.h:400
LocaleConstant _defaultDbcLocale
Definition: World.h:405
float _rate_values[MAX_RATES]
Definition: World.h:397
Seconds _nextDailyQuestReset
Definition: World.h:422
bool _isClosed
Definition: World.h:381
uint32 _maxPlayerCount
Definition: World.h:393
uint32 _maxQueuedSessionCount
Definition: World.h:391
Seconds _nextMonthlyQuestReset
Definition: World.h:424
uint32 _int_configs[INT_CONFIG_VALUE_COUNT]
Definition: World.h:398
Seconds _nextCalendarOldEventsDeletionTime
Definition: World.h:426
Seconds _nextWeeklyQuestReset
Definition: World.h:423
uint32 _shutdownTimer
Definition: World.h:376
uint32 _maxActiveSessionCount
Definition: World.h:390
Seconds _nextRandomBGReset
Definition: World.h:425
bool _allowMovement
Definition: World.h:408
uint32 _playerCount
Definition: World.h:392
uint32 _playerLimit
Definition: World.h:403
AccountTypes _allowedSecurityLevel
Definition: World.h:404
Seconds _mail_expire_check_timer
Definition: World.h:384

References _allowedSecurityLevel, _allowMovement, _bool_configs, _cleaningFlags, _defaultDbcLocale, _float_configs, _int_configs, _isClosed, _mail_expire_check_timer, _maxActiveSessionCount, _maxPlayerCount, _maxQueuedSessionCount, _nextCalendarOldEventsDeletionTime, _nextDailyQuestReset, _nextGuildReset, _nextMonthlyQuestReset, _nextRandomBGReset, _nextWeeklyQuestReset, _playerCount, _playerLimit, _rate_values, _shutdownMask, _shutdownTimer, LOCALE_enUS, and SEC_PLAYER.

◆ ~World()

World::~World ( )
override

World destructor.

  • Empty the kicked session set
146{
148 while (!_sessions.empty())
149 {
150 // not remove from queue, prevent loading new sessions
151 delete _sessions.begin()->second;
152 _sessions.erase(_sessions.begin());
153 }
154
155 while (!_offlineSessions.empty())
156 {
157 delete _offlineSessions.begin()->second;
158 _offlineSessions.erase(_offlineSessions.begin());
159 }
160
161 CliCommandHolder* command = nullptr;
162 while (_cliCmdQueue.next(command))
163 delete command;
164
167
168 //TODO free addSessQueue
169}
static void clear()
Definition: MMapFactory.cpp:50
static void clear()
Definition: VMapFactory.cpp:39
bool next(T &result)
Gets the next result in the queue, if any.
Definition: LockedQueue.h:63
Storage class for commands issued for delayed execution.
Definition: IWorld.h:39
SessionMap _offlineSessions
Definition: World.h:387
SessionMap _sessions
Definition: World.h:386
LockedQueue< CliCommandHolder * > _cliCmdQueue
Definition: World.h:419

References _cliCmdQueue, _offlineSessions, _sessions, MMAP::MMapFactory::clear(), VMAP::VMapFactory::clear(), and LockedQueue< T, StorageType >::next().

Member Function Documentation

◆ _UpdateGameTime()

void World::_UpdateGameTime ( )
protected

Update the game time.

  • update the time
  • if there is a shutdown timer
  • ... and it is overdue, stop the world (set m_stopEvent)
  • ... else decrease it and if necessary display a shutdown countdown to the users
2765{
2767 Seconds lastGameTime = GameTime::GetGameTime();
2769
2770 Seconds elapsed = GameTime::GetGameTime() - lastGameTime;
2771
2773 if (!IsStopped() && _shutdownTimer > 0 && elapsed > 0s)
2774 {
2776 if (_shutdownTimer <= elapsed.count())
2777 {
2779 _stopEvent = true; // exist code already set
2780 else
2781 _shutdownTimer = 1; // minimum timer value to wait idle state
2782 }
2784 else
2785 {
2786 _shutdownTimer -= elapsed.count();
2787
2788 ShutdownMsg();
2789 }
2790 }
2791}
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition: Duration.h:30
@ SHUTDOWN_MASK_IDLE
Definition: World.h:49
void UpdateGameTimers()
Update all timers.
Definition: GameTime.cpp:63
Seconds GetGameTime()
Definition: GameTime.cpp:38
uint32 GetActiveAndQueuedSessionCount() const override
Definition: World.h:170
void ShutdownMsg(bool show=false, Player *player=nullptr, const std::string &reason=std::string()) override
Display a shutdown message to the user(s)
Definition: World.cpp:2849
static std::atomic_long _stopEvent
Definition: World.h:374
static bool IsStopped()
Definition: World.h:262

References _shutdownMask, _shutdownTimer, _stopEvent, GetActiveAndQueuedSessionCount(), GameTime::GetGameTime(), IsStopped(), SHUTDOWN_MASK_IDLE, ShutdownMsg(), and GameTime::UpdateGameTimers().

Referenced by Update().

◆ _UpdateRealmCharCount()

void World::_UpdateRealmCharCount ( PreparedQueryResult  resultCharCount)
protected
3010{
3011 if (resultCharCount)
3012 {
3013 Field* fields = resultCharCount->Fetch();
3014 uint32 accountId = fields[0].Get<uint32>();
3015 uint8 charCount = uint8(fields[1].Get<uint64>());
3016
3017 LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
3018
3020 stmt->SetData(0, charCount);
3021 stmt->SetData(1, accountId);
3022 stmt->SetData(2, realm.Id.Realm);
3023 trans->Append(stmt);
3024
3025 LoginDatabase.CommitTransaction(trans);
3026 }
3027}
std::uint8_t uint8
Definition: Define.h:110
std::uint32_t uint32
Definition: Define.h:108
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition: DatabaseEnv.cpp:22
SQLTransaction< LoginDatabaseConnection > LoginDatabaseTransaction
Definition: DatabaseEnvFwd.h:71
@ LOGIN_REP_REALM_CHARACTERS
Definition: LoginDatabase.h:63
AC_GAME_API Realm realm
Definition: World.cpp:113
Definition: PreparedStatement.h:158
Class used to access individual fields of database query result.
Definition: Field.h:99
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition: Field.h:113
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition: PreparedStatement.h:78
uint32 Realm
Definition: Realm.h:42
RealmHandle Id
Definition: Realm.h:68

References Field::Get(), Realm::Id, LOGIN_REP_REALM_CHARACTERS, LoginDatabase, realm, RealmHandle::Realm, and PreparedStatementBase::SetData().

Referenced by UpdateRealmCharCount().

◆ AddQueuedPlayer()

void World::AddQueuedPlayer ( WorldSession sess)
overridevirtual

Implements IWorld.

359{
360 sess->SetInQueue(true);
361 _queuedPlayer.push_back(sess);
362
363 // The 1st SMSG_AUTH_RESPONSE needs to contain other info too.
364 sess->SendAuthResponse(AUTH_WAIT_QUEUE, false, GetQueuePos(sess));
365}
@ AUTH_WAIT_QUEUE
Definition: SharedDefines.h:3322
void SetInQueue(bool state)
Session in auth.queue currently.
Definition: WorldSession.h:381
void SendAuthResponse(uint8 code, bool shortForm, uint32 queuePos=0)
Definition: AuthHandler.cpp:22
int32 GetQueuePos(WorldSession *) override
Definition: World.cpp:347
Queue _queuedPlayer
Definition: World.h:430

References _queuedPlayer, AUTH_WAIT_QUEUE, GetQueuePos(), WorldSession::SendAuthResponse(), and WorldSession::SetInQueue().

Referenced by AddSession_().

◆ AddSession()

void World::AddSession ( WorldSession s)
overridevirtual

Implements IWorld.

260{
262}
void add(const T &item)
Adds an item to the queue.
Definition: LockedQueue.h:45
LockedQueue< WorldSession * > _addSessQueue
Definition: World.h:434

References _addSessQueue, and LockedQueue< T, StorageType >::add().

◆ AddSession_()

void World::AddSession_ ( WorldSession s)
private
265{
266 ASSERT (s);
267
268 // kick existing session with same account (if any)
269 // if character on old session is being loaded, then return
270 if (!KickSession(s->GetAccountId()))
271 {
272 s->KickPlayer("kick existing session with same account");
273 delete s; // session not added yet in session list, so not listed in queue
274 return;
275 }
276
277 SessionMap::const_iterator old = _sessions.find(s->GetAccountId());
278 if (old != _sessions.end())
279 {
280 WorldSession* oldSession = old->second;
281
284
285 // pussywizard:
286 if (oldSession->HandleSocketClosed())
287 {
288 // there should be no offline session if current one is logged onto a character
289 SessionMap::iterator iter;
290 if ((iter = _offlineSessions.find(oldSession->GetAccountId())) != _offlineSessions.end())
291 {
292 WorldSession* tmp = iter->second;
293 _offlineSessions.erase(iter);
294 delete tmp;
295 }
296 oldSession->SetOfflineTime(GameTime::GetGameTime().count());
297 _offlineSessions[oldSession->GetAccountId()] = oldSession;
298 }
299 else
300 {
301 delete oldSession;
302 }
303 }
304
305 _sessions[s->GetAccountId()] = s;
306
308 uint32 pLimit = GetPlayerAmountLimit();
309
310 // don't count this session when checking player limit
311 --Sessions;
312
313 if (pLimit > 0 && Sessions >= pLimit && AccountMgr::IsPlayerAccount(s->GetSecurity()) && !s->CanSkipQueue() && !HasRecentlyDisconnected(s))
314 {
317 return;
318 }
319
321
323}
#define ASSERT
Definition: Errors.h:68
@ CONFIG_INTERVAL_DISCONNECT_TOLERANCE
Definition: IWorld.h:211
bool IsPlayerAccount(uint32 gmlevel)
Definition: AccountMgr.cpp:276
Player session in the World.
Definition: WorldSession.h:330
void SetOfflineTime(uint32 time)
Definition: WorldSession.h:1065
AccountTypes GetSecurity() const
Definition: WorldSession.h:358
bool HandleSocketClosed()
Definition: WorldSession.cpp:525
uint32 GetAccountId() const
Definition: WorldSession.h:360
void KickPlayer(bool setKicked=true)
Definition: WorldSession.h:399
void InitializeSession()
Definition: WorldSession.cpp:1690
bool CanSkipQueue() const
Definition: WorldSession.h:359
uint32 GetPlayerAmountLimit() const override
Definition: World.h:203
uint32 getIntConfig(WorldIntConfigs index) const override
Get a server configuration element (see #WorldConfigs)
Definition: World.h:306
void AddQueuedPlayer(WorldSession *) override
Definition: World.cpp:358
void UpdateMaxSessionCounters() override
Get the number of current active sessions.
Definition: World.cpp:3206
DisconnectMap _disconnects
Definition: World.h:389
bool RemoveQueuedPlayer(WorldSession *session) override
Definition: World.cpp:367
bool KickSession(uint32 id) override
Remove a given session.
Definition: World.cpp:243
bool HasRecentlyDisconnected(WorldSession *) override
Definition: World.cpp:325

References _disconnects, _offlineSessions, _sessions, AddQueuedPlayer(), ASSERT, WorldSession::CanSkipQueue(), CONFIG_INTERVAL_DISCONNECT_TOLERANCE, WorldSession::GetAccountId(), GetActiveAndQueuedSessionCount(), GameTime::GetGameTime(), getIntConfig(), GetPlayerAmountLimit(), WorldSession::GetSecurity(), WorldSession::HandleSocketClosed(), HasRecentlyDisconnected(), WorldSession::InitializeSession(), AccountMgr::IsPlayerAccount(), WorldSession::KickPlayer(), KickSession(), RemoveQueuedPlayer(), WorldSession::SetOfflineTime(), and UpdateMaxSessionCounters().

Referenced by UpdateSessions().

◆ CalendarDeleteOldEvents()

void World::CalendarDeleteOldEvents ( )
protected
3188{
3189 LOG_INFO("server.worldserver", "Calendar deletion of old events.");
3190
3193 sCalendarMgr->DeleteOldEvents();
3194}
#define LOG_INFO(filterType__,...)
Definition: Log.h:167
#define sCalendarMgr
Definition: CalendarMgr.h:344
@ CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR
Definition: IWorld.h:346
#define sWorld
Definition: World.h:451
@ WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME
Definition: World.h:141
AC_COMMON_API time_t GetNextTimeWithDayAndHour(int8 dayOfWeek, int8 hour)
Definition: Timer.cpp:302

References _nextCalendarOldEventsDeletionTime, CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR, getIntConfig(), Acore::Time::GetNextTimeWithDayAndHour(), LOG_INFO, sCalendarMgr, sWorld, and WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME.

Referenced by Update().

◆ DecreasePlayerCount()

void World::DecreasePlayerCount ( )
inlineoverridevirtual

Implements IWorld.

186{ _playerCount--; }

References _playerCount.

◆ DetectDBCLang()

void World::DetectDBCLang ( )
private
2189{
2190 uint8 m_lang_confid = sConfigMgr->GetOption<int32>("DBC.Locale", 255);
2191
2192 if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES)
2193 {
2194 LOG_ERROR("server.loading", "Incorrect DBC.Locale! Must be >= 0 and < {} (set to 0)", TOTAL_LOCALES);
2195 m_lang_confid = LOCALE_enUS;
2196 }
2197
2198 ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1);
2199 std::string availableLocalsStr;
2200
2201 uint8 default_locale = TOTAL_LOCALES;
2202 for (uint8 i = default_locale - 1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
2203 {
2204 if (race->name[i][0] != '\0') // check by race names
2205 {
2206 default_locale = i;
2207 _availableDbcLocaleMask |= (1 << i);
2208 availableLocalsStr += localeNames[i];
2209 availableLocalsStr += " ";
2210 }
2211 }
2212
2213 if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES &&
2214 (_availableDbcLocaleMask & (1 << m_lang_confid)))
2215 {
2216 default_locale = m_lang_confid;
2217 }
2218
2219 if (default_locale >= TOTAL_LOCALES)
2220 {
2221 LOG_ERROR("server.loading", "Unable to determine your DBC Locale! (corrupt DBC?)");
2222 exit(1);
2223 }
2224
2225 _defaultDbcLocale = LocaleConstant(default_locale);
2226
2227 LOG_INFO("server.loading", "Using {} DBC Locale As Default. All Available DBC locales: {}", localeNames[GetDefaultDbcLocale()], availableLocalsStr.empty() ? "<none>" : availableLocalsStr);
2228 LOG_INFO("server.loading", " ");
2229}
char const * localeNames[TOTAL_LOCALES]
Definition: Common.cpp:20
LocaleConstant
Definition: Common.h:74
@ TOTAL_LOCALES
Definition: Common.h:85
#define sConfigMgr
Definition: Config.h:92
std::int32_t int32
Definition: Define.h:104
#define LOG_ERROR(filterType__,...)
Definition: Log.h:159
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
uint32 _availableDbcLocaleMask
Definition: World.h:406
LocaleConstant GetDefaultDbcLocale() const override
Definition: World.h:223
Definition: DBCStructure.h:679
char const * name[16]
Definition: DBCStructure.h:691

References _availableDbcLocaleMask, _defaultDbcLocale, GetDefaultDbcLocale(), LOCALE_enUS, localeNames, LOG_ERROR, LOG_INFO, ChrRacesEntry::name, sChrRacesStore, sConfigMgr, and TOTAL_LOCALES.

Referenced by SetInitialWorldSettings().

◆ FinalizePlayerWorldSession()

void World::FinalizePlayerWorldSession ( WorldSession session)
inlineprivate

Executed when a World Session is being finalized. Be it from a normal login or via queue popping.

Parameters
sessionThe World Session that we are finalizing.

◆ FindOfflineSession()

WorldSession * World::FindOfflineSession ( uint32  id) const
overridevirtual

Implements IWorld.

222{
223 SessionMap::const_iterator itr = _offlineSessions.find(id);
224 if (itr != _offlineSessions.end())
225 return itr->second;
226 else
227 return nullptr;
228}

References _offlineSessions.

◆ FindOfflineSessionForCharacterGUID()

WorldSession * World::FindOfflineSessionForCharacterGUID ( ObjectGuid::LowType  guidLow) const
overridevirtual

Implements IWorld.

231{
232 if (_offlineSessions.empty())
233 return nullptr;
234
235 for (SessionMap::const_iterator itr = _offlineSessions.begin(); itr != _offlineSessions.end(); ++itr)
236 if (itr->second->GetGuidLow() == guidLow)
237 return itr->second;
238
239 return nullptr;
240}

References _offlineSessions.

◆ FindPlayerInZone()

Player * World::FindPlayerInZone ( uint32  zone)
overridevirtual

Find a player in a specified zone.

  • circle through active sessions and return the first player found in the zone

Implements IWorld.

179{
181 SessionMap::const_iterator itr;
182 for (itr = _sessions.begin(); itr != _sessions.end(); ++itr)
183 {
184 if (!itr->second)
185 continue;
186
187 Player* player = itr->second->GetPlayer();
188 if (!player)
189 continue;
190
191 if (player->IsInWorld() && player->GetZoneId() == zone)
192 return player;
193 }
194 return nullptr;
195}
bool IsInWorld() const
Definition: Object.h:101
uint32 GetZoneId() const
Definition: Object.cpp:3075
Definition: Player.h:1046

References _sessions, WorldObject::GetZoneId(), and Object::IsInWorld().

◆ FindSession()

WorldSession * World::FindSession ( uint32  id) const
overridevirtual

Find a session by its id.

Implements IWorld.

212{
213 SessionMap::const_iterator itr = _sessions.find(id);
214
215 if (itr != _sessions.end())
216 return itr->second; // also can return nullptr for kicked session
217 else
218 return nullptr;
219}

References _sessions.

◆ ForceGameEventUpdate()

void World::ForceGameEventUpdate ( )
overridevirtual

Implements IWorld.

2532{
2533 _timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
2534 uint32 nextGameEvent = sGameEventMgr->Update();
2535 _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
2537}
#define sGameEventMgr
Definition: GameEventMgr.h:186
@ WUPDATE_EVENTS
Definition: World.h:66
void SetInterval(time_t interval)
Definition: Timer.h:179
void Reset()
Definition: Timer.h:166
IntervalTimer _timers[WUPDATE_COUNT]
Definition: World.h:383

References _timers, IntervalTimer::Reset(), IntervalTimer::SetInterval(), sGameEventMgr, and WUPDATE_EVENTS.

◆ GetActiveAndQueuedSessionCount()

uint32 World::GetActiveAndQueuedSessionCount ( ) const
inlineoverridevirtual

Implements IWorld.

170{ return _sessions.size(); }

References _sessions.

Referenced by _UpdateGameTime(), AddSession_(), and ShutdownServ().

◆ GetActiveSessionCount()

uint32 World::GetActiveSessionCount ( ) const
inlineoverridevirtual

Implements IWorld.

171{ return _sessions.size() - _queuedPlayer.size(); }

References _queuedPlayer, and _sessions.

Referenced by RemoveQueuedPlayer(), ShutdownServ(), and Update().

◆ getAllowMovement()

bool World::getAllowMovement ( ) const
inlineoverridevirtual
Todo:
Actions on m_allowMovement still to be implemented Is movement allowed?

Implements IWorld.

214{ return _allowMovement; }

References _allowMovement.

◆ GetAllSessions()

const SessionMap & World::GetAllSessions ( ) const
inlineoverridevirtual

Implements IWorld.

169{ return _sessions; }

References _sessions.

◆ GetAvailableDbcLocale()

LocaleConstant World::GetAvailableDbcLocale ( LocaleConstant  locale) const
inlineoverridevirtual

Implements IWorld.

337{ if (_availableDbcLocaleMask & (1 << locale)) return locale; else return _defaultDbcLocale; }

References _availableDbcLocaleMask, and _defaultDbcLocale.

◆ getBoolConfig()

bool World::getBoolConfig ( WorldBoolConfigs  index) const
inlineoverridevirtual

Get a server configuration element (see #WorldConfigs)

Implements IWorld.

281 {
282 return index < BOOL_CONFIG_VALUE_COUNT ? _bool_configs[index] : false;
283 }
@ BOOL_CONFIG_VALUE_COUNT
Definition: IWorld.h:185

References _bool_configs, and BOOL_CONFIG_VALUE_COUNT.

◆ GetCleaningFlags()

uint32 World::GetCleaningFlags ( ) const
inlineoverridevirtual

Implements IWorld.

347{ return _cleaningFlags; }

References _cleaningFlags.

◆ GetConfigMaxSkillValue()

uint16 World::GetConfigMaxSkillValue ( ) const
inlineoverridevirtual

Get the maximum skill level a player can reach.

Implements IWorld.

235 {
237 return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
238 }
std::uint16_t uint16
Definition: Define.h:109
@ CONFIG_MAX_PLAYER_LEVEL
Definition: IWorld.h:234

References CONFIG_MAX_PLAYER_LEVEL, and getIntConfig().

◆ GetDataPath()

std::string const & World::GetDataPath ( ) const
inlineoverridevirtual

Get the path where data (dbc, maps) are stored on disk.

Implements IWorld.

226{ return _dataPath; }
std::string _dataPath
Definition: World.h:409

References _dataPath.

◆ GetDBVersion()

char const * World::GetDBVersion ( ) const
inlineoverridevirtual

Implements IWorld.

341{ return _dbVersion.c_str(); }
std::string _dbVersion
Definition: World.h:437

References _dbVersion.

◆ GetDefaultDbcLocale()

LocaleConstant World::GetDefaultDbcLocale ( ) const
inlineoverridevirtual

Implements IWorld.

223{ return _defaultDbcLocale; }

References _defaultDbcLocale.

Referenced by DetectDBCLang(), and SetInitialWorldSettings().

◆ GetExitCode()

static uint8 World::GetExitCode ( )
inlinestatic
260{ return _exitCode; }
static uint8 _exitCode
Definition: World.h:375

References _exitCode.

Referenced by main().

◆ getFloatConfig()

float World::getFloatConfig ( WorldFloatConfigs  index) const
inlineoverridevirtual

Get a server configuration element (see #WorldConfigs)

Implements IWorld.

294 {
295 return index < FLOAT_CONFIG_VALUE_COUNT ? _float_configs[index] : 0;
296 }
@ FLOAT_CONFIG_VALUE_COUNT
Definition: IWorld.h:203

References _float_configs, and FLOAT_CONFIG_VALUE_COUNT.

◆ getIntConfig()

uint32 World::getIntConfig ( WorldIntConfigs  index) const
inlineoverridevirtual

Get a server configuration element (see #WorldConfigs)

Implements IWorld.

307 {
308 return index < INT_CONFIG_VALUE_COUNT ? _int_configs[index] : 0;
309 }
@ INT_CONFIG_VALUE_COUNT
Definition: IWorld.h:415

References _int_configs, and INT_CONFIG_VALUE_COUNT.

Referenced by AddSession_(), CalendarDeleteOldEvents(), GetConfigMaxSkillValue(), HasRecentlyDisconnected(), InitCalendarOldEventsDeletionTime(), IsFFAPvPRealm(), IsPvPRealm(), SetInitialWorldSettings(), and UpdateSessions().

◆ GetMaxActiveSessionCount()

uint32 World::GetMaxActiveSessionCount ( ) const
inlineoverridevirtual

Implements IWorld.

175{ return _maxActiveSessionCount; }

References _maxActiveSessionCount.

◆ GetMaxPlayerCount()

uint32 World::GetMaxPlayerCount ( ) const
inlineoverridevirtual

Implements IWorld.

178{ return _maxPlayerCount; }

References _maxPlayerCount.

Referenced by Update().

◆ GetMaxQueuedSessionCount()

uint32 World::GetMaxQueuedSessionCount ( ) const
inlineoverridevirtual

Get the maximum number of parallel sessions on the server since last reboot.

Implements IWorld.

174{ return _maxQueuedSessionCount; }

References _maxQueuedSessionCount.

◆ GetMaxVisibleDistanceInBGArenas()

static float World::GetMaxVisibleDistanceInBGArenas ( )
inlinestatic
static float _maxVisibleDistanceInBGArenas
Definition: World.h:414

References _maxVisibleDistanceInBGArenas.

Referenced by Battleground::_ProcessJoin(), and BattlegroundMap::InitVisibilityDistance().

◆ GetMaxVisibleDistanceInInstances()

static float World::GetMaxVisibleDistanceInInstances ( )
inlinestatic
static float _maxVisibleDistanceInInstances
Definition: World.h:413

References _maxVisibleDistanceInInstances.

Referenced by InstanceMap::InitVisibilityDistance().

◆ GetMaxVisibleDistanceOnContinents()

static float World::GetMaxVisibleDistanceOnContinents ( )
inlinestatic
static float _maxVisibleDistanceOnContinents
Definition: World.h:412

References _maxVisibleDistanceOnContinents.

Referenced by Map::InitVisibilityDistance().

◆ GetNewCharString()

std::string const & World::GetNewCharString ( ) const
inlineoverridevirtual

Get the string for new characters (first login)

Implements IWorld.

221{ return _newCharString; }
std::string _newCharString
Definition: World.h:395

References _newCharString.

◆ GetNextDailyQuestsResetTime()

Seconds World::GetNextDailyQuestsResetTime ( ) const
inlineoverridevirtual

Next daily quests and random bg reset time.

Implements IWorld.

229{ return _nextDailyQuestReset; }

References _nextDailyQuestReset.

◆ GetNextRandomBGResetTime()

Seconds World::GetNextRandomBGResetTime ( ) const
inlineoverridevirtual

Implements IWorld.

231{ return _nextRandomBGReset; }

References _nextRandomBGReset.

◆ GetNextWeeklyQuestsResetTime()

Seconds World::GetNextWeeklyQuestsResetTime ( ) const
inlineoverridevirtual

Implements IWorld.

230{ return _nextWeeklyQuestReset; }

References _nextWeeklyQuestReset.

◆ GetNextWhoListUpdateDelaySecs()

uint32 World::GetNextWhoListUpdateDelaySecs ( )
overridevirtual

Implements IWorld.

3312{
3313 if (_timers[WUPDATE_5_SECS].Passed())
3314 return 1;
3315
3317 t = std::min(t, (uint32)_timers[WUPDATE_5_SECS].GetInterval());
3318
3319 return uint32(std::ceil(t / 1000.0f));
3320}
@ WUPDATE_5_SECS
Definition: World.h:71
time_t GetCurrent() const
Definition: Timer.h:189
time_t GetInterval() const
Definition: Timer.h:184

References _timers, IntervalTimer::GetCurrent(), IntervalTimer::GetInterval(), and WUPDATE_5_SECS.

◆ GetPlayerAmountLimit()

uint32 World::GetPlayerAmountLimit ( ) const
inlineoverridevirtual

Implements IWorld.

203{ return _playerLimit; }

References _playerLimit.

Referenced by AddSession_(), and RemoveQueuedPlayer().

◆ GetPlayerCount()

uint32 World::GetPlayerCount ( ) const
inlineoverridevirtual

Get number of players.

Implements IWorld.

177{ return _playerCount; }

References _playerCount.

◆ GetPlayerSecurityLimit()

AccountTypes World::GetPlayerSecurityLimit ( ) const
inlineoverridevirtual

Security level limitations.

Implements IWorld.

197{ return _allowedSecurityLevel; }

References _allowedSecurityLevel.

◆ GetQueuedSessionCount()

uint32 World::GetQueuedSessionCount ( ) const
inlineoverridevirtual

Implements IWorld.

172{ return _queuedPlayer.size(); }

References _queuedPlayer.

◆ GetQueuePos()

int32 World::GetQueuePos ( WorldSession sess)
overridevirtual

Implements IWorld.

348{
349 uint32 position = 1;
350
351 for (Queue::const_iterator iter = _queuedPlayer.begin(); iter != _queuedPlayer.end(); ++iter, ++position)
352 if ((*iter) == sess)
353 return position;
354
355 return 0;
356}

References _queuedPlayer.

Referenced by AddQueuedPlayer().

◆ getRate()

float World::getRate ( Rates  rate) const
inlineoverridevirtual

Get a server rate (see Rates)

Implements IWorld.

270{ return _rate_values[rate]; }

References _rate_values.

Referenced by LoadConfigSettings().

◆ GetRealmName()

std::string const & World::GetRealmName ( ) const
inlineoverridevirtual

Implements IWorld.

351{ return _realmName; } // pussywizard
std::string _realmName
Definition: World.h:416

References _realmName.

◆ GetShutDownTimeLeft()

uint32 World::GetShutDownTimeLeft ( ) const
inlineoverridevirtual

Implements IWorld.

256{ return _shutdownTimer; }

References _shutdownTimer.

◆ getWorldState()

uint64 World::getWorldState ( uint32  index) const
overridevirtual

Implements IWorld.

3286{
3287 auto const& itr = _worldstates.find(index);
3288 return itr != _worldstates.end() ? itr->second : 0;
3289}
WorldStatesMap _worldstates
Definition: World.h:402

References _worldstates.

Referenced by InitCalendarOldEventsDeletionTime(), and InitGuildResetTime().

◆ HasRecentlyDisconnected()

bool World::HasRecentlyDisconnected ( WorldSession session)
overridevirtual

Implements IWorld.

326{
327 if (!session)
328 return false;
329
331 {
332 for (DisconnectMap::iterator i = _disconnects.begin(); i != _disconnects.end();)
333 {
334 if ((GameTime::GetGameTime().count() - i->second) < tolerance)
335 {
336 if (i->first == session->GetAccountId())
337 return true;
338 ++i;
339 }
340 else
341 _disconnects.erase(i++);
342 }
343 }
344 return false;
345}

References _disconnects, CONFIG_INTERVAL_DISCONNECT_TOLERANCE, WorldSession::GetAccountId(), GameTime::GetGameTime(), and getIntConfig().

Referenced by AddSession_().

◆ IncreasePlayerCount()

void World::IncreasePlayerCount ( )
inlineoverridevirtual

Increase/Decrease number of players.

Implements IWorld.

182 {
183 _playerCount++;
185 }

References _maxPlayerCount, and _playerCount.

◆ InitCalendarOldEventsDeletionTime()

void World::InitCalendarOldEventsDeletionTime ( )
protected
3074{
3076 Seconds nextDeletionTime = currentDeletionTime > 0s ? currentDeletionTime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, getIntConfig(CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR)));
3077
3078 if (currentDeletionTime == 0s)
3079 {
3080 sWorld->setWorldState(WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, nextDeletionTime.count());
3081 }
3082}
uint64 getWorldState(uint32 index) const override
Definition: World.cpp:3285

References CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR, getIntConfig(), Acore::Time::GetNextTimeWithDayAndHour(), getWorldState(), sWorld, and WS_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME.

Referenced by SetInitialWorldSettings().

◆ InitDailyQuestResetTime()

void World::InitDailyQuestResetTime ( )
protected
3041{
3042 Seconds wstime = Seconds(sWorld->getWorldState(WS_DAILY_QUEST_RESET_TIME));
3044
3045 if (wstime == 0s)
3046 {
3047 sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count());
3048 }
3049}
@ WS_DAILY_QUEST_RESET_TIME
Definition: World.h:138

References _nextDailyQuestReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorld, and WS_DAILY_QUEST_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitGuildResetTime()

void World::InitGuildResetTime ( )
protected
3085{
3087 _nextGuildReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
3088
3089 if (wstime == 0s)
3090 {
3091 sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count());
3092 }
3093}
@ WS_GUILD_DAILY_RESET_TIME
Definition: World.h:139

References _nextGuildReset, Acore::Time::GetNextTimeWithDayAndHour(), getWorldState(), sWorld, and WS_GUILD_DAILY_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitMonthlyQuestResetTime()

void World::InitMonthlyQuestResetTime ( )
protected
3052{
3053 Seconds wstime = Seconds(sWorld->getWorldState(WS_MONTHLY_QUEST_RESET_TIME));
3055
3056 if (wstime == 0s)
3057 {
3059 }
3060}
@ WS_MONTHLY_QUEST_RESET_TIME
Definition: World.h:140

References _nextMonthlyQuestReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorld, and WS_MONTHLY_QUEST_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitRandomBGResetTime()

void World::InitRandomBGResetTime ( )
protected
3063{
3064 Seconds wstime = Seconds(sWorld->getWorldState(WS_BG_DAILY_RESET_TIME));
3065 _nextRandomBGReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
3066
3067 if (wstime == 0s)
3068 {
3069 sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count());
3070 }
3071}
@ WS_BG_DAILY_RESET_TIME
Definition: World.h:136

References _nextRandomBGReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorld, and WS_BG_DAILY_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitWeeklyQuestResetTime()

void World::InitWeeklyQuestResetTime ( )
protected
3030{
3031 Seconds wstime = Seconds(sWorld->getWorldState(WS_WEEKLY_QUEST_RESET_TIME));
3033
3034 if (wstime == 0s)
3035 {
3037 }
3038}
@ WS_WEEKLY_QUEST_RESET_TIME
Definition: World.h:135

References _nextWeeklyQuestReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorld, and WS_WEEKLY_QUEST_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ instance()

static World * World::instance ( )
static

◆ IsClosed()

bool World::IsClosed ( ) const
overridevirtual

Deny clients?

Implements IWorld.

198{
199 return _isClosed;
200}

References _isClosed.

◆ IsFFAPvPRealm()

bool World::IsFFAPvPRealm ( ) const
overridevirtual

Implements IWorld.

3307{
3309}
@ CONFIG_GAME_TYPE
Definition: IWorld.h:216
@ REALM_TYPE_FFA_PVP
Definition: Realm.h:61

References CONFIG_GAME_TYPE, getIntConfig(), and REALM_TYPE_FFA_PVP.

Referenced by SetInitialWorldSettings().

◆ IsPvPRealm()

bool World::IsPvPRealm ( ) const
overridevirtual

Are we on a "Player versus Player" server?

Implements IWorld.

3302{
3304}
@ REALM_TYPE_RPPVP
Definition: Realm.h:57
@ REALM_TYPE_PVP
Definition: Realm.h:54

References CONFIG_GAME_TYPE, getIntConfig(), REALM_TYPE_FFA_PVP, REALM_TYPE_PVP, and REALM_TYPE_RPPVP.

◆ IsShuttingDown()

bool World::IsShuttingDown ( ) const
inlineoverridevirtual

Are we in the middle of a shutdown?

Implements IWorld.

255{ return _shutdownTimer > 0; }

References _shutdownTimer.

◆ IsStopped()

static bool World::IsStopped ( )
inlinestatic

◆ KickAll()

void World::KickAll ( )
overridevirtual

Kick (and save) all players.

Implements IWorld.

2742{
2743 _queuedPlayer.clear(); // prevent send queue update packet and login queued sessions
2744
2745 // session not removed at kick and will removed in next update tick
2746 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2747 itr->second->KickPlayer("KickAll sessions");
2748
2749 // pussywizard: kick offline sessions
2750 for (SessionMap::const_iterator itr = _offlineSessions.begin(); itr != _offlineSessions.end(); ++itr)
2751 itr->second->KickPlayer("KickAll offline sessions");
2752}

References _offlineSessions, _queuedPlayer, and _sessions.

◆ KickAllLess()

void World::KickAllLess ( AccountTypes  sec)
overridevirtual

Kick (and save) all players with security level less sec

Implements IWorld.

2756{
2757 // session not removed at kick and will removed in next update tick
2758 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2759 if (itr->second->GetSecurity() < sec)
2760 itr->second->KickPlayer("KickAllLess");
2761}

References _sessions.

Referenced by SetPlayerSecurityLimit().

◆ KickSession()

bool World::KickSession ( uint32  id)
overridevirtual

Remove a given session.

  • Find the session, kick the user, but we can't delete session at this moment to prevent iterator invalidation

Implements IWorld.

244{
246 SessionMap::const_iterator itr = _sessions.find(id);
247
248 if (itr != _sessions.end() && itr->second)
249 {
250 if (itr->second->PlayerLoading())
251 return false;
252
253 itr->second->KickPlayer("KickSession", false);
254 }
255
256 return true;
257}

References _sessions.

Referenced by AddSession_().

◆ LoadConfigSettings()

void World::LoadConfigSettings ( bool  reload = false)
overridevirtual

Initialize config values.

  • Read the player limit and the Message of the day from the config file
  • Read ticket system setting from the config file
  • Get string for new logins (newly created characters)
  • Send server info on login?
  • Read all rates from the config file
  • Read other configuration items from the config file

    Todo:
    Add MonsterSight in worldserver.conf or put it as define
  • Load the CharDelete related config options
  • Load the ItemDelete related config options
  • Read the "Data" directory from the config file

Implements IWorld.

417{
418 if (reload)
419 {
420 if (!sConfigMgr->Reload())
421 {
422 LOG_ERROR("server.loading", "World settings reload fail: can't read settings.");
423 return;
424 }
425
426 sLog->LoadFromConfig();
427 sMetric->LoadFromConfigs();
428 }
429
430 // Set realm id and enable db logging
431 sLog->SetRealmId(realm.Id.Realm);
432
433 sScriptMgr->OnBeforeConfigLoad(reload);
434
435 // load update time related configs
437
439 if (!reload)
440 {
441 SetPlayerAmountLimit(sConfigMgr->GetOption<int32>("PlayerLimit", 1000));
442 }
443
445 _bool_configs[CONFIG_ALLOW_TICKETS] = sConfigMgr->GetOption<bool>("AllowTickets", true);
446 _bool_configs[CONFIG_DELETE_CHARACTER_TICKET_TRACE] = sConfigMgr->GetOption<bool>("DeletedCharacterTicketTrace", false);
447
449 SetNewCharString(sConfigMgr->GetOption<std::string>("PlayerStart.String", ""));
450
452 _int_configs[CONFIG_ENABLE_SINFO_LOGIN] = sConfigMgr->GetOption<int32>("Server.LoginInfo", 0);
453
455 _rate_values[RATE_HEALTH] = sConfigMgr->GetOption<float>("Rate.Health", 1);
456 if (_rate_values[RATE_HEALTH] < 0)
457 {
458 LOG_ERROR("server.loading", "Rate.Health ({}) must be > 0. Using 1 instead.", _rate_values[RATE_HEALTH]);
460 }
461 _rate_values[RATE_POWER_MANA] = sConfigMgr->GetOption<float>("Rate.Mana", 1);
463 {
464 LOG_ERROR("server.loading", "Rate.Mana ({}) must be > 0. Using 1 instead.", _rate_values[RATE_POWER_MANA]);
466 }
467 _rate_values[RATE_POWER_RAGE_INCOME] = sConfigMgr->GetOption<float>("Rate.Rage.Income", 1);
468 _rate_values[RATE_POWER_RAGE_LOSS] = sConfigMgr->GetOption<float>("Rate.Rage.Loss", 1);
470 {
471 LOG_ERROR("server.loading", "Rate.Rage.Loss ({}) must be > 0. Using 1 instead.", _rate_values[RATE_POWER_RAGE_LOSS]);
473 }
474 _rate_values[RATE_POWER_RUNICPOWER_INCOME] = sConfigMgr->GetOption<float>("Rate.RunicPower.Income", 1);
475 _rate_values[RATE_POWER_RUNICPOWER_LOSS] = sConfigMgr->GetOption<float>("Rate.RunicPower.Loss", 1);
477 {
478 LOG_ERROR("server.loading", "Rate.RunicPower.Loss ({}) must be > 0. Using 1 instead.", _rate_values[RATE_POWER_RUNICPOWER_LOSS]);
480 }
481 _rate_values[RATE_POWER_FOCUS] = sConfigMgr->GetOption<float>("Rate.Focus", 1.0f);
482 _rate_values[RATE_POWER_ENERGY] = sConfigMgr->GetOption<float>("Rate.Energy", 1.0f);
483
484 _rate_values[RATE_SKILL_DISCOVERY] = sConfigMgr->GetOption<float>("Rate.Skill.Discovery", 1.0f);
485
486 _rate_values[RATE_DROP_ITEM_POOR] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Poor", 1.0f);
487 _rate_values[RATE_DROP_ITEM_NORMAL] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Normal", 1.0f);
488 _rate_values[RATE_DROP_ITEM_UNCOMMON] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Uncommon", 1.0f);
489 _rate_values[RATE_DROP_ITEM_RARE] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Rare", 1.0f);
490 _rate_values[RATE_DROP_ITEM_EPIC] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Epic", 1.0f);
491 _rate_values[RATE_DROP_ITEM_LEGENDARY] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Legendary", 1.0f);
492 _rate_values[RATE_DROP_ITEM_ARTIFACT] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Artifact", 1.0f);
493 _rate_values[RATE_DROP_ITEM_REFERENCED] = sConfigMgr->GetOption<float>("Rate.Drop.Item.Referenced", 1.0f);
494 _rate_values[RATE_DROP_ITEM_REFERENCED_AMOUNT] = sConfigMgr->GetOption<float>("Rate.Drop.Item.ReferencedAmount", 1.0f);
495 _rate_values[RATE_DROP_MONEY] = sConfigMgr->GetOption<float>("Rate.Drop.Money", 1.0f);
496 _rate_values[RATE_REWARD_BONUS_MONEY] = sConfigMgr->GetOption<float>("Rate.RewardBonusMoney", 1.0f);
497 _rate_values[RATE_XP_KILL] = sConfigMgr->GetOption<float>("Rate.XP.Kill", 1.0f);
498 _rate_values[RATE_XP_BG_KILL_AV] = sConfigMgr->GetOption<float>("Rate.XP.BattlegroundKillAV", 1.0f);
499 _rate_values[RATE_XP_BG_KILL_WSG] = sConfigMgr->GetOption<float>("Rate.XP.BattlegroundKillWSG", 1.0f);
500 _rate_values[RATE_XP_BG_KILL_AB] = sConfigMgr->GetOption<float>("Rate.XP.BattlegroundKillAB", 1.0f);
501 _rate_values[RATE_XP_BG_KILL_EOTS] = sConfigMgr->GetOption<float>("Rate.XP.BattlegroundKillEOTS", 1.0f);
502 _rate_values[RATE_XP_BG_KILL_SOTA] = sConfigMgr->GetOption<float>("Rate.XP.BattlegroundKillSOTA", 1.0f);
503 _rate_values[RATE_XP_BG_KILL_IC] = sConfigMgr->GetOption<float>("Rate.XP.BattlegroundKillIC", 1.0f);
504 _rate_values[RATE_XP_QUEST] = sConfigMgr->GetOption<float>("Rate.XP.Quest", 1.0f);
505 _rate_values[RATE_XP_QUEST_DF] = sConfigMgr->GetOption<float>("Rate.XP.Quest.DF", 1.0f);
506 _rate_values[RATE_XP_EXPLORE] = sConfigMgr->GetOption<float>("Rate.XP.Explore", 1.0f);
507 _rate_values[RATE_XP_PET] = sConfigMgr->GetOption<float>("Rate.XP.Pet", 1.0f);
508 _rate_values[RATE_XP_PET_NEXT_LEVEL] = sConfigMgr->GetOption<float>("Rate.Pet.LevelXP", 0.05f);
509 _rate_values[RATE_REPAIRCOST] = sConfigMgr->GetOption<float>("Rate.RepairCost", 1.0f);
510
511 _rate_values[RATE_SELLVALUE_ITEM_POOR] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Poor", 1.0f);
512 _rate_values[RATE_SELLVALUE_ITEM_NORMAL] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Normal", 1.0f);
513 _rate_values[RATE_SELLVALUE_ITEM_UNCOMMON] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Uncommon", 1.0f);
514 _rate_values[RATE_SELLVALUE_ITEM_RARE] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Rare", 1.0f);
515 _rate_values[RATE_SELLVALUE_ITEM_EPIC] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Epic", 1.0f);
516 _rate_values[RATE_SELLVALUE_ITEM_LEGENDARY] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Legendary", 1.0f);
517 _rate_values[RATE_SELLVALUE_ITEM_ARTIFACT] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Artifact", 1.0f);
518 _rate_values[RATE_SELLVALUE_ITEM_HEIRLOOM] = sConfigMgr->GetOption<float>("Rate.SellValue.Item.Heirloom", 1.0f);
519
520 _rate_values[ RATE_BUYVALUE_ITEM_POOR] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Poor", 1.0f);
521 _rate_values[ RATE_BUYVALUE_ITEM_NORMAL] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Normal", 1.0f);
522 _rate_values[ RATE_BUYVALUE_ITEM_UNCOMMON] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Uncommon", 1.0f);
523 _rate_values[ RATE_BUYVALUE_ITEM_RARE] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Rare", 1.0f);
524 _rate_values[ RATE_BUYVALUE_ITEM_EPIC] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Epic", 1.0f);
525 _rate_values[ RATE_BUYVALUE_ITEM_LEGENDARY] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Legendary", 1.0f);
526 _rate_values[RATE_BUYVALUE_ITEM_ARTIFACT] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Artifact", 1.0f);
527 _rate_values[RATE_BUYVALUE_ITEM_HEIRLOOM] = sConfigMgr->GetOption<float>("Rate.BuyValue.Item.Heirloom", 1.0f);
528
529 if (_rate_values[RATE_REPAIRCOST] < 0.0f)
530 {
531 LOG_ERROR("server.loading", "Rate.RepairCost ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_REPAIRCOST]);
533 }
534 _rate_values[RATE_REPUTATION_GAIN] = sConfigMgr->GetOption<float>("Rate.Reputation.Gain", 1.0f);
535 _rate_values[RATE_REPUTATION_LOWLEVEL_KILL] = sConfigMgr->GetOption<float>("Rate.Reputation.LowLevel.Kill", 1.0f);
536 _rate_values[RATE_REPUTATION_LOWLEVEL_QUEST] = sConfigMgr->GetOption<float>("Rate.Reputation.LowLevel.Quest", 1.0f);
537 _rate_values[RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS] = sConfigMgr->GetOption<float>("Rate.Reputation.RecruitAFriendBonus", 0.1f);
538 _rate_values[RATE_CREATURE_NORMAL_DAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Normal.Damage", 1.0f);
539 _rate_values[RATE_CREATURE_ELITE_ELITE_DAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.Elite.Damage", 1.0f);
540 _rate_values[RATE_CREATURE_ELITE_RAREELITE_DAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.RAREELITE.Damage", 1.0f);
541 _rate_values[RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.WORLDBOSS.Damage", 1.0f);
542 _rate_values[RATE_CREATURE_ELITE_RARE_DAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.RARE.Damage", 1.0f);
543 _rate_values[RATE_CREATURE_NORMAL_HP] = sConfigMgr->GetOption<float>("Rate.Creature.Normal.HP", 1.0f);
544 _rate_values[RATE_CREATURE_ELITE_ELITE_HP] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.Elite.HP", 1.0f);
545 _rate_values[RATE_CREATURE_ELITE_RAREELITE_HP] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.RAREELITE.HP", 1.0f);
546 _rate_values[RATE_CREATURE_ELITE_WORLDBOSS_HP] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.WORLDBOSS.HP", 1.0f);
547 _rate_values[RATE_CREATURE_ELITE_RARE_HP] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.RARE.HP", 1.0f);
548 _rate_values[RATE_CREATURE_NORMAL_SPELLDAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Normal.SpellDamage", 1.0f);
549 _rate_values[RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.Elite.SpellDamage", 1.0f);
550 _rate_values[RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.RAREELITE.SpellDamage", 1.0f);
551 _rate_values[RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.WORLDBOSS.SpellDamage", 1.0f);
552 _rate_values[RATE_CREATURE_ELITE_RARE_SPELLDAMAGE] = sConfigMgr->GetOption<float>("Rate.Creature.Elite.RARE.SpellDamage", 1.0f);
553 _rate_values[RATE_CREATURE_AGGRO] = sConfigMgr->GetOption<float>("Rate.Creature.Aggro", 1.0f);
554 _rate_values[RATE_REST_INGAME] = sConfigMgr->GetOption<float>("Rate.Rest.InGame", 1.0f);
555 _rate_values[RATE_REST_OFFLINE_IN_TAVERN_OR_CITY] = sConfigMgr->GetOption<float>("Rate.Rest.Offline.InTavernOrCity", 1.0f);
556 _rate_values[RATE_REST_OFFLINE_IN_WILDERNESS] = sConfigMgr->GetOption<float>("Rate.Rest.Offline.InWilderness", 1.0f);
557 _rate_values[RATE_DAMAGE_FALL] = sConfigMgr->GetOption<float>("Rate.Damage.Fall", 1.0f);
558 _rate_values[RATE_AUCTION_TIME] = sConfigMgr->GetOption<float>("Rate.Auction.Time", 1.0f);
559 _rate_values[RATE_AUCTION_DEPOSIT] = sConfigMgr->GetOption<float>("Rate.Auction.Deposit", 1.0f);
560 _rate_values[RATE_AUCTION_CUT] = sConfigMgr->GetOption<float>("Rate.Auction.Cut", 1.0f);
561 _rate_values[RATE_HONOR] = sConfigMgr->GetOption<float>("Rate.Honor", 1.0f);
562 _rate_values[RATE_ARENA_POINTS] = sConfigMgr->GetOption<float>("Rate.ArenaPoints", 1.0f);
563 _rate_values[RATE_INSTANCE_RESET_TIME] = sConfigMgr->GetOption<float>("Rate.InstanceResetTime", 1.0f);
564
565 _rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetCreature", 11.0f);
566 _rate_values[RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER] = sConfigMgr->GetOption<float>("Rate.MissChanceMultiplier.TargetPlayer", 7.0f);
567 _bool_configs[CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS] = sConfigMgr->GetOption<bool>("Rate.MissChanceMultiplier.OnlyAffectsPlayer", false);
568
569 _rate_values[RATE_TALENT] = sConfigMgr->GetOption<float>("Rate.Talent", 1.0f);
570 if (_rate_values[RATE_TALENT] < 0.0f)
571 {
572 LOG_ERROR("server.loading", "Rate.Talent ({}) must be > 0. Using 1 instead.", _rate_values[RATE_TALENT]);
574 }
575 _rate_values[RATE_MOVESPEED] = sConfigMgr->GetOption<float>("Rate.MoveSpeed", 1.0f);
577 {
578 LOG_ERROR("server.loading", "Rate.MoveSpeed ({}) must be > 0. Using 1 instead.", _rate_values[RATE_MOVESPEED]);
580 }
582 _rate_values[RATE_CORPSE_DECAY_LOOTED] = sConfigMgr->GetOption<float>("Rate.Corpse.Decay.Looted", 0.5f);
583
584 _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE] = sConfigMgr->GetOption<float>("TargetPosRecalculateRange", 1.5f);
586 {
587 LOG_ERROR("server.loading", "TargetPosRecalculateRange ({}) must be >= {}. Using {} instead.", _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], CONTACT_DISTANCE, CONTACT_DISTANCE);
589 }
591 {
592 LOG_ERROR("server.loading", "TargetPosRecalculateRange ({}) must be <= {}. Using {} instead.", _rate_values[RATE_TARGET_POS_RECALCULATION_RANGE], NOMINAL_MELEE_RANGE, NOMINAL_MELEE_RANGE);
594 }
595
596 _rate_values[RATE_DURABILITY_LOSS_ON_DEATH] = sConfigMgr->GetOption<float>("DurabilityLoss.OnDeath", 10.0f);
598 {
599 LOG_ERROR("server.loading", "DurabilityLoss.OnDeath ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
601 }
603 {
604 LOG_ERROR("server.loading", "DurabilityLoss.OnDeath ({}) must be <= 100. Using 100.0 instead.", _rate_values[RATE_DURABILITY_LOSS_ON_DEATH]);
606 }
608
609 _rate_values[RATE_DURABILITY_LOSS_DAMAGE] = sConfigMgr->GetOption<float>("DurabilityLossChance.Damage", 0.5f);
611 {
612 LOG_ERROR("server.loading", "DurabilityLossChance.Damage ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_DAMAGE]);
614 }
615 _rate_values[RATE_DURABILITY_LOSS_ABSORB] = sConfigMgr->GetOption<float>("DurabilityLossChance.Absorb", 0.5f);
617 {
618 LOG_ERROR("server.loading", "DurabilityLossChance.Absorb ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_ABSORB]);
620 }
621 _rate_values[RATE_DURABILITY_LOSS_PARRY] = sConfigMgr->GetOption<float>("DurabilityLossChance.Parry", 0.05f);
623 {
624 LOG_ERROR("server.loading", "DurabilityLossChance.Parry ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_PARRY]);
626 }
627 _rate_values[RATE_DURABILITY_LOSS_BLOCK] = sConfigMgr->GetOption<float>("DurabilityLossChance.Block", 0.05f);
629 {
630 LOG_ERROR("server.loading", "DurabilityLossChance.Block ({}) must be >=0. Using 0.0 instead.", _rate_values[RATE_DURABILITY_LOSS_BLOCK]);
632 }
633
635
636 _bool_configs[CONFIG_DURABILITY_LOSS_IN_PVP] = sConfigMgr->GetOption<bool>("DurabilityLoss.InPvP", false);
637
638 _int_configs[CONFIG_COMPRESSION] = sConfigMgr->GetOption<int32>("Compression", 1);
640 {
641 LOG_ERROR("server.loading", "Compression level ({}) must be in range 1..9. Using default compression level (1).", _int_configs[CONFIG_COMPRESSION]);
643 }
644 _bool_configs[CONFIG_ADDON_CHANNEL] = sConfigMgr->GetOption<bool>("AddonChannel", true);
645 _bool_configs[CONFIG_CLEAN_CHARACTER_DB] = sConfigMgr->GetOption<bool>("CleanCharacterDB", false);
646 _int_configs[CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS] = sConfigMgr->GetOption<int32>("PersistentCharacterCleanFlags", 0);
647 _int_configs[CONFIG_CHAT_CHANNEL_LEVEL_REQ] = sConfigMgr->GetOption<int32>("ChatLevelReq.Channel", 1);
648 _int_configs[CONFIG_CHAT_WHISPER_LEVEL_REQ] = sConfigMgr->GetOption<int32>("ChatLevelReq.Whisper", 1);
649 _int_configs[CONFIG_CHAT_SAY_LEVEL_REQ] = sConfigMgr->GetOption<int32>("ChatLevelReq.Say", 1);
650 _int_configs[CONFIG_PARTY_LEVEL_REQ] = sConfigMgr->GetOption<int32>("PartyLevelReq", 1);
651 _int_configs[CONFIG_TRADE_LEVEL_REQ] = sConfigMgr->GetOption<int32>("LevelReq.Trade", 1);
652 _int_configs[CONFIG_TICKET_LEVEL_REQ] = sConfigMgr->GetOption<int32>("LevelReq.Ticket", 1);
653 _int_configs[CONFIG_AUCTION_LEVEL_REQ] = sConfigMgr->GetOption<int32>("LevelReq.Auction", 1);
654 _int_configs[CONFIG_MAIL_LEVEL_REQ] = sConfigMgr->GetOption<int32>("LevelReq.Mail", 1);
655 _bool_configs[CONFIG_ALLOW_PLAYER_COMMANDS] = sConfigMgr->GetOption<bool>("AllowPlayerCommands", 1);
656 _bool_configs[CONFIG_PRESERVE_CUSTOM_CHANNELS] = sConfigMgr->GetOption<bool>("PreserveCustomChannels", false);
657 _int_configs[CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION] = sConfigMgr->GetOption<int32>("PreserveCustomChannelDuration", 14);
658 _int_configs[CONFIG_INTERVAL_SAVE] = sConfigMgr->GetOption<int32>("PlayerSaveInterval", 15 * MINUTE * IN_MILLISECONDS);
659 _int_configs[CONFIG_INTERVAL_DISCONNECT_TOLERANCE] = sConfigMgr->GetOption<int32>("DisconnectToleranceInterval", 0);
660 _bool_configs[CONFIG_STATS_SAVE_ONLY_ON_LOGOUT] = sConfigMgr->GetOption<bool>("PlayerSave.Stats.SaveOnlyOnLogout", true);
661
662 _int_configs[CONFIG_MIN_LEVEL_STAT_SAVE] = sConfigMgr->GetOption<int32>("PlayerSave.Stats.MinLevel", 0);
664 {
665 LOG_ERROR("server.loading", "PlayerSave.Stats.MinLevel ({}) must be in range 0..80. Using default, do not save character stats (0).", _int_configs[CONFIG_MIN_LEVEL_STAT_SAVE]);
667 }
668
669 _int_configs[CONFIG_INTERVAL_MAPUPDATE] = sConfigMgr->GetOption<int32>("MapUpdateInterval", 100);
671 {
672 LOG_ERROR("server.loading", "MapUpdateInterval ({}) must be greater {}. Use this minimal value.", _int_configs[CONFIG_INTERVAL_MAPUPDATE], MIN_MAP_UPDATE_DELAY);
674 }
675 if (reload)
676 sMapMgr->SetMapUpdateInterval(_int_configs[CONFIG_INTERVAL_MAPUPDATE]);
677
678 _int_configs[CONFIG_INTERVAL_CHANGEWEATHER] = sConfigMgr->GetOption<int32>("ChangeWeatherInterval", 10 * MINUTE * IN_MILLISECONDS);
679
680 if (reload)
681 {
682 uint32 val = sConfigMgr->GetOption<int32>("WorldServerPort", 8085);
684 LOG_ERROR("server.loading", "WorldServerPort option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_PORT_WORLD]);
685 }
686 else
687 _int_configs[CONFIG_PORT_WORLD] = sConfigMgr->GetOption<int32>("WorldServerPort", 8085);
688
689 _bool_configs[CONFIG_CLOSE_IDLE_CONNECTIONS] = sConfigMgr->GetOption<bool>("CloseIdleConnections", true);
690 _int_configs[CONFIG_SOCKET_TIMEOUTTIME] = sConfigMgr->GetOption<int32>("SocketTimeOutTime", 900000);
691 _int_configs[CONFIG_SOCKET_TIMEOUTTIME_ACTIVE] = sConfigMgr->GetOption<int32>("SocketTimeOutTimeActive", 60000);
692 _int_configs[CONFIG_SESSION_ADD_DELAY] = sConfigMgr->GetOption<int32>("SessionAddDelay", 10000);
693
694 _float_configs[CONFIG_GROUP_XP_DISTANCE] = sConfigMgr->GetOption<float>("MaxGroupXPDistance", 74.0f);
695 _float_configs[CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE] = sConfigMgr->GetOption<float>("MaxRecruitAFriendBonusDistance", 100.0f);
696
698 _float_configs[CONFIG_SIGHT_MONSTER] = sConfigMgr->GetOption<float>("MonsterSight", 50);
699
700 if (reload)
701 {
702 uint32 val = sConfigMgr->GetOption<int32>("GameType", 0);
703 if (val != _int_configs[CONFIG_GAME_TYPE])
704 LOG_ERROR("server.loading", "GameType option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_GAME_TYPE]);
705 }
706 else
707 _int_configs[CONFIG_GAME_TYPE] = sConfigMgr->GetOption<int32>("GameType", 0);
708
709 if (reload)
710 {
711 uint32 val = sConfigMgr->GetOption<int32>("RealmZone", REALM_ZONE_DEVELOPMENT);
713 LOG_ERROR("server.loading", "RealmZone option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_REALM_ZONE]);
714 }
715 else
717
718 _bool_configs[CONFIG_STRICT_NAMES_RESERVED] = sConfigMgr->GetOption<bool> ("StrictNames.Reserved", true);
719 _bool_configs[CONFIG_STRICT_NAMES_PROFANITY] = sConfigMgr->GetOption<bool> ("StrictNames.Profanity", true);
720 _int_configs[CONFIG_STRICT_PLAYER_NAMES] = sConfigMgr->GetOption<int32> ("StrictPlayerNames", 0);
721 _int_configs[CONFIG_STRICT_CHARTER_NAMES] = sConfigMgr->GetOption<int32> ("StrictCharterNames", 0);
722 _int_configs[CONFIG_STRICT_CHANNEL_NAMES] = sConfigMgr->GetOption<int32> ("StrictChannelNames", 0);
723 _int_configs[CONFIG_STRICT_PET_NAMES] = sConfigMgr->GetOption<int32> ("StrictPetNames", 0);
724
725 _bool_configs[CONFIG_ALLOW_TWO_SIDE_ACCOUNTS] = sConfigMgr->GetOption<bool>("AllowTwoSide.Accounts", true);
726 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Calendar", false);
727 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Chat", false);
728 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Channel", false);
729 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Group", false);
730 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Guild", false);
731 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Auction", false);
732 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Mail", false);
733 _bool_configs[CONFIG_ALLOW_TWO_SIDE_WHO_LIST] = sConfigMgr->GetOption<bool>("AllowTwoSide.WhoList", false);
734 _bool_configs[CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND] = sConfigMgr->GetOption<bool>("AllowTwoSide.AddFriend", false);
735 _bool_configs[CONFIG_ALLOW_TWO_SIDE_TRADE] = sConfigMgr->GetOption<bool>("AllowTwoSide.Trade", false);
736 _bool_configs[CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE] = sConfigMgr->GetOption<bool>("AllowTwoSide.Interaction.Emote", false);
737
738 _int_configs[CONFIG_MIN_PLAYER_NAME] = sConfigMgr->GetOption<int32> ("MinPlayerName", 2);
740 {
741 LOG_ERROR("server.loading", "MinPlayerName ({}) must be in range 1..{}. Set to 2.", _int_configs[CONFIG_MIN_PLAYER_NAME], MAX_PLAYER_NAME);
743 }
744
745 _int_configs[CONFIG_MIN_CHARTER_NAME] = sConfigMgr->GetOption<int32> ("MinCharterName", 2);
747 {
748 LOG_ERROR("server.loading", "MinCharterName ({}) must be in range 1..{}. Set to 2.", _int_configs[CONFIG_MIN_CHARTER_NAME], MAX_CHARTER_NAME);
750 }
751
752 _int_configs[CONFIG_MIN_PET_NAME] = sConfigMgr->GetOption<int32> ("MinPetName", 2);
754 {
755 LOG_ERROR("server.loading", "MinPetName ({}) must be in range 1..{}. Set to 2.", _int_configs[CONFIG_MIN_PET_NAME], MAX_PET_NAME);
757 }
758
759 _int_configs[CONFIG_CHARTER_COST_GUILD] = sConfigMgr->GetOption<int32>("Guild.CharterCost", 1000);
760 _int_configs[CONFIG_CHARTER_COST_ARENA_2v2] = sConfigMgr->GetOption<int32>("ArenaTeam.CharterCost.2v2", 800000);
761 _int_configs[CONFIG_CHARTER_COST_ARENA_3v3] = sConfigMgr->GetOption<int32>("ArenaTeam.CharterCost.3v3", 1200000);
762 _int_configs[CONFIG_CHARTER_COST_ARENA_5v5] = sConfigMgr->GetOption<int32>("ArenaTeam.CharterCost.5v5", 2000000);
763
764 _int_configs[CONFIG_MAX_WHO_LIST_RETURN] = sConfigMgr->GetOption<int32>("MaxWhoListReturns", 49);
765
766 _int_configs[CONFIG_CHARACTER_CREATING_DISABLED] = sConfigMgr->GetOption<int32>("CharacterCreating.Disabled", 0);
767 _int_configs[CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK] = sConfigMgr->GetOption<int32>("CharacterCreating.Disabled.RaceMask", 0);
768
769 _int_configs[CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK] = sConfigMgr->GetOption<int32>("CharacterCreating.Disabled.ClassMask", 0);
770
771 _int_configs[CONFIG_CHARACTERS_PER_REALM] = sConfigMgr->GetOption<int32>("CharactersPerRealm", 10);
773 {
774 LOG_ERROR("server.loading", "CharactersPerRealm ({}) must be in range 1..10. Set to 10.", _int_configs[CONFIG_CHARACTERS_PER_REALM]);
776 }
777
778 // must be after CONFIG_CHARACTERS_PER_REALM
779 _int_configs[CONFIG_CHARACTERS_PER_ACCOUNT] = sConfigMgr->GetOption<int32>("CharactersPerAccount", 50);
781 {
782 LOG_ERROR("server.loading", "CharactersPerAccount ({}) can't be less than CharactersPerRealm ({}).", _int_configs[CONFIG_CHARACTERS_PER_ACCOUNT], _int_configs[CONFIG_CHARACTERS_PER_REALM]);
784 }
785
786 _int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM] = sConfigMgr->GetOption<int32>("HeroicCharactersPerRealm", 1);
788 {
789 LOG_ERROR("server.loading", "HeroicCharactersPerRealm ({}) must be in range 0..10. Set to 1.", _int_configs[CONFIG_HEROIC_CHARACTERS_PER_REALM]);
791 }
792
793 _int_configs[CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER] = sConfigMgr->GetOption<int32>("CharacterCreating.MinLevelForHeroicCharacter", 55);
794
795 _int_configs[CONFIG_SKIP_CINEMATICS] = sConfigMgr->GetOption<int32>("SkipCinematics", 0);
797 {
798 LOG_ERROR("server.loading", "SkipCinematics ({}) must be in range 0..2. Set to 0.", _int_configs[CONFIG_SKIP_CINEMATICS]);
800 }
801
802 if (reload)
803 {
804 uint32 val = sConfigMgr->GetOption<int32>("MaxPlayerLevel", DEFAULT_MAX_LEVEL);
806 LOG_ERROR("server.loading", "MaxPlayerLevel option can't be changed at config reload, using current value ({}).", _int_configs[CONFIG_MAX_PLAYER_LEVEL]);
807 }
808 else
810
812 {
813 LOG_ERROR("server.loading", "MaxPlayerLevel ({}) must be in range 1..{}. Set to {}.", _int_configs[CONFIG_MAX_PLAYER_LEVEL], MAX_LEVEL, MAX_LEVEL);
815 }
816
817 _int_configs[CONFIG_MIN_DUALSPEC_LEVEL] = sConfigMgr->GetOption<int32>("MinDualSpecLevel", 40);
818
819 _int_configs[CONFIG_START_PLAYER_LEVEL] = sConfigMgr->GetOption<int32>("StartPlayerLevel", 1);
821 {
822 LOG_ERROR("server.loading", "StartPlayerLevel ({}) must be in range 1..MaxPlayerLevel({}). Set to 1.", _int_configs[CONFIG_START_PLAYER_LEVEL], _int_configs[CONFIG_MAX_PLAYER_LEVEL]);
824 }
825
826 _int_configs[CONFIG_START_HEROIC_PLAYER_LEVEL] = sConfigMgr->GetOption<int32>("StartHeroicPlayerLevel", 55);
828 {
829 LOG_ERROR("server.loading", "StartHeroicPlayerLevel ({}) must be in range 1..MaxPlayerLevel({}). Set to 55.",
832 }
833
834 _int_configs[CONFIG_START_PLAYER_MONEY] = sConfigMgr->GetOption<int32>("StartPlayerMoney", 0);
836 {
837 LOG_ERROR("server.loading", "StartPlayerMoney ({}) must be in range 0..{}. Set to {}.", _int_configs[CONFIG_START_PLAYER_MONEY], MAX_MONEY_AMOUNT, 0);
839 }
840
841 _int_configs[CONFIG_START_HEROIC_PLAYER_MONEY] = sConfigMgr->GetOption<int32>("StartHeroicPlayerMoney", 2000);
843 {
844 LOG_ERROR("server.loading", "StartHeroicPlayerMoney ({}) must be in range 0..{}. Set to {}.", _int_configs[CONFIG_START_HEROIC_PLAYER_MONEY], MAX_MONEY_AMOUNT, 2000);
846 }
847
848 _int_configs[CONFIG_MAX_HONOR_POINTS] = sConfigMgr->GetOption<int32>("MaxHonorPoints", 75000);
850 {
851 LOG_ERROR("server.loading", "MaxHonorPoints ({}) can't be negative. Set to 0.", _int_configs[CONFIG_MAX_HONOR_POINTS]);
853 }
854
855 _int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT] = sConfigMgr->GetOption<int32>("MaxHonorPointsMoneyPerPoint", 0);
857 {
858 LOG_ERROR("server.loading", "MaxHonorPointsMoneyPerPoint ({}) can't be negative. Set to 0.", _int_configs[CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT]);
860 }
861
862 _int_configs[CONFIG_START_HONOR_POINTS] = sConfigMgr->GetOption<int32>("StartHonorPoints", 0);
864 {
865 LOG_ERROR("server.loading", "StartHonorPoints ({}) must be in range 0..MaxHonorPoints({}). Set to {}.",
868 }
869
870 _int_configs[CONFIG_MAX_ARENA_POINTS] = sConfigMgr->GetOption<int32>("MaxArenaPoints", 10000);
872 {
873 LOG_ERROR("server.loading", "MaxArenaPoints ({}) can't be negative. Set to 0.", _int_configs[CONFIG_MAX_ARENA_POINTS]);
875 }
876
877 _int_configs[CONFIG_START_ARENA_POINTS] = sConfigMgr->GetOption<int32>("StartArenaPoints", 0);
879 {
880 LOG_ERROR("server.loading", "StartArenaPoints ({}) must be in range 0..MaxArenaPoints({}). Set to {}.",
883 }
884
885 _int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL] = sConfigMgr->GetOption<int32>("RecruitAFriend.MaxLevel", 60);
888 {
889 LOG_ERROR("server.loading", "RecruitAFriend.MaxLevel ({}) must be in the range 0..MaxLevel({}). Set to {}.",
892 }
893
894 _int_configs[CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE] = sConfigMgr->GetOption<int32>("RecruitAFriend.MaxDifference", 4);
895 _bool_configs[CONFIG_ALL_TAXI_PATHS] = sConfigMgr->GetOption<bool>("AllFlightPaths", false);
896 _int_configs[CONFIG_INSTANT_TAXI] = sConfigMgr->GetOption<int32>("InstantFlightPaths", 0);
897
898 _bool_configs[CONFIG_INSTANCE_IGNORE_LEVEL] = sConfigMgr->GetOption<bool>("Instance.IgnoreLevel", false);
899 _bool_configs[CONFIG_INSTANCE_IGNORE_RAID] = sConfigMgr->GetOption<bool>("Instance.IgnoreRaid", false);
900 _bool_configs[CONFIG_INSTANCE_GMSUMMON_PLAYER] = sConfigMgr->GetOption<bool>("Instance.GMSummonPlayer", false);
901 _bool_configs[CONFIG_INSTANCE_SHARED_ID] = sConfigMgr->GetOption<bool>("Instance.SharedNormalHeroicId", false);
902
903 _int_configs[CONFIG_INSTANCE_RESET_TIME_HOUR] = sConfigMgr->GetOption<int32>("Instance.ResetTimeHour", 4);
904 _int_configs[CONFIG_INSTANCE_RESET_TIME_RELATIVE_TIMESTAMP] = sConfigMgr->GetOption<int32>("Instance.ResetTimeRelativeTimestamp", 1135814400);
905 _int_configs[CONFIG_INSTANCE_UNLOAD_DELAY] = sConfigMgr->GetOption<int32>("Instance.UnloadDelay", 30 * MINUTE * IN_MILLISECONDS);
906
907 _int_configs[CONFIG_MAX_PRIMARY_TRADE_SKILL] = sConfigMgr->GetOption<int32>("MaxPrimaryTradeSkill", 2);
908 _int_configs[CONFIG_MIN_PETITION_SIGNS] = sConfigMgr->GetOption<int32>("MinPetitionSigns", 9);
910 {
911 LOG_ERROR("server.loading", "MinPetitionSigns ({}) must be in range 0..9. Set to 9.", _int_configs[CONFIG_MIN_PETITION_SIGNS]);
913 }
914
915 _int_configs[CONFIG_GM_LOGIN_STATE] = sConfigMgr->GetOption<int32>("GM.LoginState", 2);
916 _int_configs[CONFIG_GM_VISIBLE_STATE] = sConfigMgr->GetOption<int32>("GM.Visible", 2);
917 _int_configs[CONFIG_GM_CHAT] = sConfigMgr->GetOption<int32>("GM.Chat", 2);
918 _int_configs[CONFIG_GM_WHISPERING_TO] = sConfigMgr->GetOption<int32>("GM.WhisperingTo", 2);
919
920 _int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfigMgr->GetOption<int32>("GM.InGMList.Level", SEC_ADMINISTRATOR);
921 _int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfigMgr->GetOption<int32>("GM.InWhoList.Level", SEC_ADMINISTRATOR);
922 _int_configs[CONFIG_START_GM_LEVEL] = sConfigMgr->GetOption<int32>("GM.StartLevel", 1);
924 {
925 LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range StartPlayerLevel({})..{}. Set to {}.",
928 }
930 {
931 LOG_ERROR("server.loading", "GM.StartLevel ({}) must be in range 1..{}. Set to {}.", _int_configs[CONFIG_START_GM_LEVEL], MAX_LEVEL, MAX_LEVEL);
933 }
934 _bool_configs[CONFIG_ALLOW_GM_GROUP] = sConfigMgr->GetOption<bool>("GM.AllowInvite", false);
935 _bool_configs[CONFIG_ALLOW_GM_FRIEND] = sConfigMgr->GetOption<bool>("GM.AllowFriend", false);
936 _bool_configs[CONFIG_GM_LOWER_SECURITY] = sConfigMgr->GetOption<bool>("GM.LowerSecurity", false);
937 _float_configs[CONFIG_CHANCE_OF_GM_SURVEY] = sConfigMgr->GetOption<float>("GM.TicketSystem.ChanceOfGMSurvey", 50.0f);
938
939 _int_configs[CONFIG_GROUP_VISIBILITY] = sConfigMgr->GetOption<int32>("Visibility.GroupMode", 1);
940
941 _bool_configs[CONFIG_OBJECT_SPARKLES] = sConfigMgr->GetOption<bool>("Visibility.ObjectSparkles", true);
942
943 _bool_configs[CONFIG_LOW_LEVEL_REGEN_BOOST] = sConfigMgr->GetOption<bool>("EnableLowLevelRegenBoost", true);
944
945 _bool_configs[CONFIG_OBJECT_QUEST_MARKERS] = sConfigMgr->GetOption<bool>("Visibility.ObjectQuestMarkers", true);
946
947 _int_configs[CONFIG_MAIL_DELIVERY_DELAY] = sConfigMgr->GetOption<int32>("MailDeliveryDelay", HOUR);
948
949 _int_configs[CONFIG_UPTIME_UPDATE] = sConfigMgr->GetOption<int32>("UpdateUptimeInterval", 10);
951 {
952 LOG_ERROR("server.loading", "UpdateUptimeInterval ({}) must be > 0, set to default 10.", _int_configs[CONFIG_UPTIME_UPDATE]);
954 }
955
956 if (reload)
957 {
960 }
961
962 // log db cleanup interval
963 _int_configs[CONFIG_LOGDB_CLEARINTERVAL] = sConfigMgr->GetOption<int32>("LogDB.Opt.ClearInterval", 10);
965 {
966 LOG_ERROR("server.loading", "LogDB.Opt.ClearInterval ({}) must be > 0, set to default 10.", _int_configs[CONFIG_LOGDB_CLEARINTERVAL]);
968 }
969 if (reload)
970 {
973 }
974 _int_configs[CONFIG_LOGDB_CLEARTIME] = sConfigMgr->GetOption<int32>("LogDB.Opt.ClearTime", 1209600); // 14 days default
975 LOG_INFO("server.loading", "Will clear `logs` table of entries older than {} seconds every {} minutes.",
977
978 _int_configs[CONFIG_TELEPORT_TIMEOUT_NEAR] = sConfigMgr->GetOption<int32>("TeleportTimeoutNear", 25); // pussywizard
979 _int_configs[CONFIG_TELEPORT_TIMEOUT_FAR] = sConfigMgr->GetOption<int32>("TeleportTimeoutFar", 45); // pussywizard
980 _int_configs[CONFIG_MAX_ALLOWED_MMR_DROP] = sConfigMgr->GetOption<int32>("MaxAllowedMMRDrop", 500); // pussywizard
981 _bool_configs[CONFIG_ENABLE_LOGIN_AFTER_DC] = sConfigMgr->GetOption<bool>("EnableLoginAfterDC", true); // pussywizard
982 _bool_configs[CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS] = sConfigMgr->GetOption<bool>("DontCacheRandomMovementPaths", true); // pussywizard
983
984 _int_configs[CONFIG_SKILL_CHANCE_ORANGE] = sConfigMgr->GetOption<int32>("SkillChance.Orange", 100);
985 _int_configs[CONFIG_SKILL_CHANCE_YELLOW] = sConfigMgr->GetOption<int32>("SkillChance.Yellow", 75);
986 _int_configs[CONFIG_SKILL_CHANCE_GREEN] = sConfigMgr->GetOption<int32>("SkillChance.Green", 25);
987 _int_configs[CONFIG_SKILL_CHANCE_GREY] = sConfigMgr->GetOption<int32>("SkillChance.Grey", 0);
988
989 _int_configs[CONFIG_SKILL_CHANCE_MINING_STEPS] = sConfigMgr->GetOption<int32>("SkillChance.MiningSteps", 75);
990 _int_configs[CONFIG_SKILL_CHANCE_SKINNING_STEPS] = sConfigMgr->GetOption<int32>("SkillChance.SkinningSteps", 75);
991
992 _bool_configs[CONFIG_SKILL_PROSPECTING] = sConfigMgr->GetOption<bool>("SkillChance.Prospecting", false);
993 _bool_configs[CONFIG_SKILL_MILLING] = sConfigMgr->GetOption<bool>("SkillChance.Milling", false);
994
995 _int_configs[CONFIG_SKILL_GAIN_CRAFTING] = sConfigMgr->GetOption<int32>("SkillGain.Crafting", 1);
996
997 _int_configs[CONFIG_SKILL_GAIN_DEFENSE] = sConfigMgr->GetOption<int32>("SkillGain.Defense", 1);
998
999 _int_configs[CONFIG_SKILL_GAIN_GATHERING] = sConfigMgr->GetOption<int32>("SkillGain.Gathering", 1);
1000
1001 _int_configs[CONFIG_SKILL_GAIN_WEAPON] = sConfigMgr->GetOption<int32>("SkillGain.Weapon", 1);
1002
1003 _int_configs[CONFIG_MAX_OVERSPEED_PINGS] = sConfigMgr->GetOption<int32>("MaxOverspeedPings", 2);
1005 {
1006 LOG_ERROR("server.loading", "MaxOverspeedPings ({}) must be in range 2..infinity (or 0 to disable check). Set to 2.", _int_configs[CONFIG_MAX_OVERSPEED_PINGS]);
1008 }
1009
1010 _bool_configs[CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY] = sConfigMgr->GetOption<bool>("SaveRespawnTimeImmediately", true);
1011 _bool_configs[CONFIG_WEATHER] = sConfigMgr->GetOption<bool>("ActivateWeather", true);
1012
1013 _int_configs[CONFIG_DISABLE_BREATHING] = sConfigMgr->GetOption<int32>("DisableWaterBreath", SEC_CONSOLE);
1014
1015 _bool_configs[CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL] = sConfigMgr->GetOption<bool>("AlwaysMaxSkillForLevel", false);
1016
1017 if (reload)
1018 {
1019 uint32 val = sConfigMgr->GetOption<int32>("Expansion", 2);
1020 if (val != _int_configs[CONFIG_EXPANSION])
1021 LOG_ERROR("server.loading", "Expansion option can't be changed at worldserver.conf reload, using current value ({}).", _int_configs[CONFIG_EXPANSION]);
1022 }
1023 else
1024 _int_configs[CONFIG_EXPANSION] = sConfigMgr->GetOption<int32>("Expansion", 2);
1025
1026 _int_configs[CONFIG_CHATFLOOD_MESSAGE_COUNT] = sConfigMgr->GetOption<int32>("ChatFlood.MessageCount", 10);
1027 _int_configs[CONFIG_CHATFLOOD_MESSAGE_DELAY] = sConfigMgr->GetOption<int32>("ChatFlood.MessageDelay", 1);
1028 _int_configs[CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT] = sConfigMgr->GetOption<int32>("ChatFlood.AddonMessageCount", 100);
1029 _int_configs[CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY] = sConfigMgr->GetOption<int32>("ChatFlood.AddonMessageDelay", 1);
1030 _int_configs[CONFIG_CHATFLOOD_MUTE_TIME] = sConfigMgr->GetOption<int32>("ChatFlood.MuteTime", 10);
1031 _bool_configs[CONFIG_CHAT_MUTE_FIRST_LOGIN] = sConfigMgr->GetOption<bool>("Chat.MuteFirstLogin", false);
1032 _int_configs[CONFIG_CHAT_TIME_MUTE_FIRST_LOGIN] = sConfigMgr->GetOption<int32>("Chat.MuteTimeFirstLogin", 120);
1033
1034 _int_configs[CONFIG_EVENT_ANNOUNCE] = sConfigMgr->GetOption<int32>("Event.Announce", 0);
1035
1036 _float_configs[CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS] = sConfigMgr->GetOption<float>("CreatureFamilyFleeAssistanceRadius", 30.0f);
1037 _float_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS] = sConfigMgr->GetOption<float>("CreatureFamilyAssistanceRadius", 10.0f);
1038 _int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY] = sConfigMgr->GetOption<int32>("CreatureFamilyAssistanceDelay", 2000);
1039 _int_configs[CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD] = sConfigMgr->GetOption<int32>("CreatureFamilyAssistancePeriod", 3000);
1040 _int_configs[CONFIG_CREATURE_FAMILY_FLEE_DELAY] = sConfigMgr->GetOption<int32>("CreatureFamilyFleeDelay", 7000);
1041
1042 _int_configs[CONFIG_WORLD_BOSS_LEVEL_DIFF] = sConfigMgr->GetOption<int32>("WorldBossLevelDiff", 3);
1043
1044 _bool_configs[CONFIG_QUEST_ENABLE_QUEST_TRACKER] = sConfigMgr->GetOption<bool>("Quests.EnableQuestTracker", false);
1045
1046 // note: disable value (-1) will assigned as 0xFFFFFFF, to prevent overflow at calculations limit it to max possible player level MAX_LEVEL(100)
1047 _int_configs[CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF] = sConfigMgr->GetOption<int32>("Quests.LowLevelHideDiff", 4);
1050 _int_configs[CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF] = sConfigMgr->GetOption<int32>("Quests.HighLevelHideDiff", 7);
1053 _bool_configs[CONFIG_QUEST_IGNORE_RAID] = sConfigMgr->GetOption<bool>("Quests.IgnoreRaid", false);
1054 _bool_configs[CONFIG_QUEST_IGNORE_AUTO_ACCEPT] = sConfigMgr->GetOption<bool>("Quests.IgnoreAutoAccept", false);
1055 _bool_configs[CONFIG_QUEST_IGNORE_AUTO_COMPLETE] = sConfigMgr->GetOption<bool>("Quests.IgnoreAutoComplete", false);
1056
1057 _int_configs[CONFIG_RANDOM_BG_RESET_HOUR] = sConfigMgr->GetOption<int32>("Battleground.Random.ResetHour", 6);
1059 {
1060 LOG_ERROR("server.loading", "Battleground.Random.ResetHour ({}) can't be load. Set to 6.", _int_configs[CONFIG_RANDOM_BG_RESET_HOUR]);
1062 }
1063
1064 _int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR] = sConfigMgr->GetOption<int32>("Calendar.DeleteOldEventsHour", 6);
1066 {
1067 LOG_ERROR("server.loading", "Calendar.DeleteOldEventsHour ({}) can't be load. Set to 6.", _int_configs[CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR]);
1069 }
1070
1071 _int_configs[CONFIG_GUILD_RESET_HOUR] = sConfigMgr->GetOption<int32>("Guild.ResetHour", 6);
1073 {
1074 LOG_ERROR("server.loading", "Guild.ResetHour ({}) can't be load. Set to 6.", _int_configs[CONFIG_GUILD_RESET_HOUR]);
1076 }
1077
1078 _int_configs[CONFIG_GUILD_BANK_INITIAL_TABS] = sConfigMgr->GetOption<int32>("Guild.BankInitialTabs", 0);
1079 _int_configs[CONFIG_GUILD_BANK_TAB_COST_0] = sConfigMgr->GetOption<int32>("Guild.BankTabCost0", 1000000);
1080 _int_configs[CONFIG_GUILD_BANK_TAB_COST_1] = sConfigMgr->GetOption<int32>("Guild.BankTabCost1", 2500000);
1081 _int_configs[CONFIG_GUILD_BANK_TAB_COST_2] = sConfigMgr->GetOption<int32>("Guild.BankTabCost2", 5000000);
1082 _int_configs[CONFIG_GUILD_BANK_TAB_COST_3] = sConfigMgr->GetOption<int32>("Guild.BankTabCost3", 10000000);
1083 _int_configs[CONFIG_GUILD_BANK_TAB_COST_4] = sConfigMgr->GetOption<int32>("Guild.BankTabCost4", 25000000);
1084 _int_configs[CONFIG_GUILD_BANK_TAB_COST_5] = sConfigMgr->GetOption<int32>("Guild.BankTabCost5", 50000000);
1085
1086 _bool_configs[CONFIG_DETECT_POS_COLLISION] = sConfigMgr->GetOption<bool>("DetectPosCollision", true);
1087
1088 _bool_configs[CONFIG_RESTRICTED_LFG_CHANNEL] = sConfigMgr->GetOption<bool>("Channel.RestrictedLfg", true);
1089 _bool_configs[CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL] = sConfigMgr->GetOption<bool>("Channel.SilentlyGMJoin", false);
1090
1091 _bool_configs[CONFIG_TALENTS_INSPECTING] = sConfigMgr->GetOption<bool>("TalentsInspecting", true);
1092 _bool_configs[CONFIG_CHAT_FAKE_MESSAGE_PREVENTING] = sConfigMgr->GetOption<bool>("ChatFakeMessagePreventing", false);
1093 _int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY] = sConfigMgr->GetOption<int32>("ChatStrictLinkChecking.Severity", 0);
1094 _int_configs[CONFIG_CHAT_STRICT_LINK_CHECKING_KICK] = sConfigMgr->GetOption<int32>("ChatStrictLinkChecking.Kick", 0);
1095
1096 _int_configs[CONFIG_CORPSE_DECAY_NORMAL] = sConfigMgr->GetOption<int32>("Corpse.Decay.NORMAL", 60);
1097 _int_configs[CONFIG_CORPSE_DECAY_RARE] = sConfigMgr->GetOption<int32>("Corpse.Decay.RARE", 300);
1098 _int_configs[CONFIG_CORPSE_DECAY_ELITE] = sConfigMgr->GetOption<int32>("Corpse.Decay.ELITE", 300);
1099 _int_configs[CONFIG_CORPSE_DECAY_RAREELITE] = sConfigMgr->GetOption<int32>("Corpse.Decay.RAREELITE", 300);
1100 _int_configs[CONFIG_CORPSE_DECAY_WORLDBOSS] = sConfigMgr->GetOption<int32>("Corpse.Decay.WORLDBOSS", 3600);
1101
1102 _int_configs[CONFIG_DEATH_SICKNESS_LEVEL] = sConfigMgr->GetOption<int32> ("Death.SicknessLevel", 11);
1103 _bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP] = sConfigMgr->GetOption<bool>("Death.CorpseReclaimDelay.PvP", true);
1104 _bool_configs[CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE] = sConfigMgr->GetOption<bool>("Death.CorpseReclaimDelay.PvE", true);
1105 _bool_configs[CONFIG_DEATH_BONES_WORLD] = sConfigMgr->GetOption<bool>("Death.Bones.World", true);
1106 _bool_configs[CONFIG_DEATH_BONES_BG_OR_ARENA] = sConfigMgr->GetOption<bool>("Death.Bones.BattlegroundOrArena", true);
1107
1108 _bool_configs[CONFIG_DIE_COMMAND_MODE] = sConfigMgr->GetOption<bool>("Die.Command.Mode", true);
1109
1110 // always use declined names in the russian client
1112 (_int_configs[CONFIG_REALM_ZONE] == REALM_ZONE_RUSSIAN) ? true : sConfigMgr->GetOption<bool>("DeclinedNames", false);
1113
1114 _float_configs[CONFIG_LISTEN_RANGE_SAY] = sConfigMgr->GetOption<float>("ListenRange.Say", 25.0f);
1115 _float_configs[CONFIG_LISTEN_RANGE_TEXTEMOTE] = sConfigMgr->GetOption<float>("ListenRange.TextEmote", 25.0f);
1116 _float_configs[CONFIG_LISTEN_RANGE_YELL] = sConfigMgr->GetOption<float>("ListenRange.Yell", 300.0f);
1117
1118 _bool_configs[CONFIG_BATTLEGROUND_DISABLE_QUEST_SHARE_IN_BG] = sConfigMgr->GetOption<bool>("Battleground.DisableQuestShareInBG", false);
1119 _bool_configs[CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG] = sConfigMgr->GetOption<bool>("Battleground.DisableReadyCheckInBG", false);
1120 _bool_configs[CONFIG_BATTLEGROUND_CAST_DESERTER] = sConfigMgr->GetOption<bool>("Battleground.CastDeserter", true);
1121 _bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption<bool>("Battleground.QueueAnnouncer.Enable", false);
1122 _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_LEVEL] = sConfigMgr->GetOption<uint32>("Battleground.QueueAnnouncer.Limit.MinLevel", 0);
1123 _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_PLAYERS] = sConfigMgr->GetOption<uint32>("Battleground.QueueAnnouncer.Limit.MinPlayers", 3);
1124 _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY] = sConfigMgr->GetOption<uint32>("Battleground.QueueAnnouncer.SpamProtection.Delay", 30);
1125 _bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption<bool>("Battleground.QueueAnnouncer.PlayerOnly", false);
1126 _bool_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED] = sConfigMgr->GetOption<bool>("Battleground.QueueAnnouncer.Timed", false);
1127 _int_configs[CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMER] = sConfigMgr->GetOption<uint32>("Battleground.QueueAnnouncer.Timer", 30000);
1128 _bool_configs[CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE] = sConfigMgr->GetOption<bool>("Battleground.StoreStatistics.Enable", false);
1129 _bool_configs[CONFIG_BATTLEGROUND_TRACK_DESERTERS] = sConfigMgr->GetOption<bool>("Battleground.TrackDeserters.Enable", false);
1130 _int_configs[CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER] = sConfigMgr->GetOption<int32> ("Battleground.PrematureFinishTimer", 5 * MINUTE * IN_MILLISECONDS);
1131 _int_configs[CONFIG_BATTLEGROUND_INVITATION_TYPE] = sConfigMgr->GetOption<int32>("Battleground.InvitationType", 0);
1132 _int_configs[CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH] = sConfigMgr->GetOption<int32> ("Battleground.PremadeGroupWaitForMatch", 30 * MINUTE * IN_MILLISECONDS);
1133 _bool_configs[CONFIG_BG_XP_FOR_KILL] = sConfigMgr->GetOption<bool>("Battleground.GiveXPForKills", false);
1134 _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK_TIMER] = sConfigMgr->GetOption<int32>("Battleground.ReportAFK.Timer", 4);
1135 _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK] = sConfigMgr->GetOption<int32>("Battleground.ReportAFK", 3);
1137 {
1138 LOG_ERROR("server.loading", "Battleground.ReportAFK ({}) must be >0. Using 3 instead.", _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
1140 }
1142 {
1143 LOG_ERROR("server.loading", "Battleground.ReportAFK ({}) must be <10. Using 3 instead.", _int_configs[CONFIG_BATTLEGROUND_REPORT_AFK]);
1145 }
1146 _int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN] = sConfigMgr->GetOption<int32>("Battleground.PlayerRespawn", 30);
1148 {
1149 LOG_ERROR("server.loading", "Battleground.PlayerRespawn ({}) must be >2. Using 30 instead.", _int_configs[CONFIG_BATTLEGROUND_PLAYER_RESPAWN]);
1151 }
1152 _int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN] = sConfigMgr->GetOption<int32>("Battleground.RestorationBuffRespawn", 20);
1154 {
1155 LOG_ERROR("server.loading", "Battleground.RestorationBuffRespawn ({}) must be > 0. Using 20 instead.", _int_configs[CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN]);
1157 }
1158 _int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN] = sConfigMgr->GetOption<int32>("Battleground.BerserkingBuffRespawn", 120);
1160 {
1161 LOG_ERROR("server.loading", "Battleground.BerserkingBuffRespawn ({}) must be > 0. Using 120 instead.", _int_configs[CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN]);
1163 }
1164 _int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN] = sConfigMgr->GetOption<int32>("Battleground.SpeedBuffRespawn", 150);
1166 {
1167 LOG_ERROR("server.loading", "Battleground.SpeedBuffRespawn ({}) must be > 0. Using 150 instead.", _int_configs[CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN]);
1169 }
1170
1171 _int_configs[CONFIG_ARENA_MAX_RATING_DIFFERENCE] = sConfigMgr->GetOption<uint32>("Arena.MaxRatingDifference", 150);
1172 _int_configs[CONFIG_ARENA_RATING_DISCARD_TIMER] = sConfigMgr->GetOption<uint32>("Arena.RatingDiscardTimer", 10 * MINUTE * IN_MILLISECONDS);
1173 _int_configs[CONFIG_ARENA_PREV_OPPONENTS_DISCARD_TIMER] = sConfigMgr->GetOption<uint32>("Arena.PreviousOpponentsDiscardTimer", 2 * MINUTE * IN_MILLISECONDS);
1174 _bool_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS] = sConfigMgr->GetOption<bool>("Arena.AutoDistributePoints", false);
1175 _int_configs[CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS] = sConfigMgr->GetOption<uint32>("Arena.AutoDistributeInterval", 7); // pussywizard: spoiled by implementing constant day and hour, always 7 now
1176 _int_configs[CONFIG_ARENA_GAMES_REQUIRED] = sConfigMgr->GetOption<uint32>("Arena.GamesRequired", 10);
1177 _int_configs[CONFIG_ARENA_SEASON_ID] = sConfigMgr->GetOption<uint32>("Arena.ArenaSeason.ID", 1);
1178 _int_configs[CONFIG_ARENA_START_RATING] = sConfigMgr->GetOption<uint32>("Arena.ArenaStartRating", 0);
1179 _int_configs[CONFIG_ARENA_START_PERSONAL_RATING] = sConfigMgr->GetOption<uint32>("Arena.ArenaStartPersonalRating", 1000);
1180 _int_configs[CONFIG_ARENA_START_MATCHMAKER_RATING] = sConfigMgr->GetOption<uint32>("Arena.ArenaStartMatchmakerRating", 1500);
1181 _bool_configs[CONFIG_ARENA_SEASON_IN_PROGRESS] = sConfigMgr->GetOption<bool>("Arena.ArenaSeason.InProgress", true);
1182 _float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_1] = sConfigMgr->GetOption<float>("Arena.ArenaWinRatingModifier1", 48.0f);
1183 _float_configs[CONFIG_ARENA_WIN_RATING_MODIFIER_2] = sConfigMgr->GetOption<float>("Arena.ArenaWinRatingModifier2", 24.0f);
1184 _float_configs[CONFIG_ARENA_LOSE_RATING_MODIFIER] = sConfigMgr->GetOption<float>("Arena.ArenaLoseRatingModifier", 24.0f);
1185 _float_configs[CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER] = sConfigMgr->GetOption<float>("Arena.ArenaMatchmakerRatingModifier", 24.0f);
1186 _bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE] = sConfigMgr->GetOption<bool>("Arena.QueueAnnouncer.Enable", false);
1187 _bool_configs[CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY] = sConfigMgr->GetOption<bool>("Arena.QueueAnnouncer.PlayerOnly", false);
1188
1189 _bool_configs[CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN] = sConfigMgr->GetOption<bool>("OffhandCheckAtSpellUnlearn", true);
1190 _int_configs[CONFIG_CREATURE_STOP_FOR_PLAYER] = sConfigMgr->GetOption<uint32>("Creature.MovingStopTimeForPlayer", 3 * MINUTE * IN_MILLISECONDS);
1191
1192 _int_configs[CONFIG_WATER_BREATH_TIMER] = sConfigMgr->GetOption<uint32>("WaterBreath.Timer", 180000);
1194 {
1195 LOG_ERROR("server.loading", "WaterBreath.Timer ({}) must be > 0. Using 180000 instead.", _int_configs[CONFIG_WATER_BREATH_TIMER]);
1197 }
1198
1199 if (int32 clientCacheId = sConfigMgr->GetOption<int32>("ClientCacheVersion", 0))
1200 {
1201 // overwrite DB/old value
1202 if (clientCacheId > 0)
1203 {
1205 LOG_INFO("server.loading", "Client cache version set to: {}", clientCacheId);
1206 }
1207 else
1208 LOG_ERROR("server.loading", "ClientCacheVersion can't be negative {}, ignored.", clientCacheId);
1209 }
1210
1211 _int_configs[CONFIG_INSTANT_LOGOUT] = sConfigMgr->GetOption<int32>("InstantLogout", SEC_MODERATOR);
1212
1213 _int_configs[CONFIG_GUILD_EVENT_LOG_COUNT] = sConfigMgr->GetOption<int32>("Guild.EventLogRecordsCount", GUILD_EVENTLOG_MAX_RECORDS);
1216 _int_configs[CONFIG_GUILD_BANK_EVENT_LOG_COUNT] = sConfigMgr->GetOption<int32>("Guild.BankEventLogRecordsCount", GUILD_BANKLOG_MAX_RECORDS);
1219
1220 //visibility on continents
1221 _maxVisibleDistanceOnContinents = sConfigMgr->GetOption<float>("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
1222 if (_maxVisibleDistanceOnContinents < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
1223 {
1224 LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
1226 }
1228 {
1229 LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be greater {}", MAX_VISIBILITY_DISTANCE);
1231 }
1232
1233 //visibility in instances
1234 _maxVisibleDistanceInInstances = sConfigMgr->GetOption<float>("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
1235 if (_maxVisibleDistanceInInstances < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
1236 {
1237 LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
1239 }
1241 {
1242 LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be greater {}", MAX_VISIBILITY_DISTANCE);
1244 }
1245
1246 //visibility in BG/Arenas
1247 _maxVisibleDistanceInBGArenas = sConfigMgr->GetOption<float>("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
1248 if (_maxVisibleDistanceInBGArenas < 45 * sWorld->getRate(RATE_CREATURE_AGGRO))
1249 {
1250 LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be less max aggro radius {}", 45 * sWorld->getRate(RATE_CREATURE_AGGRO));
1252 }
1254 {
1255 LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be greater {}", MAX_VISIBILITY_DISTANCE);
1257 }
1258
1260 _int_configs[CONFIG_CHARDELETE_METHOD] = sConfigMgr->GetOption<int32>("CharDelete.Method", 0);
1261 _int_configs[CONFIG_CHARDELETE_MIN_LEVEL] = sConfigMgr->GetOption<int32>("CharDelete.MinLevel", 0);
1262 _int_configs[CONFIG_CHARDELETE_KEEP_DAYS] = sConfigMgr->GetOption<int32>("CharDelete.KeepDays", 30);
1263
1265 _bool_configs[CONFIG_ITEMDELETE_METHOD] = sConfigMgr->GetOption<bool>("ItemDelete.Method", 0);
1266 _bool_configs[CONFIG_ITEMDELETE_VENDOR] = sConfigMgr->GetOption<bool>("ItemDelete.Vendor", 0);
1267 _int_configs[CONFIG_ITEMDELETE_QUALITY] = sConfigMgr->GetOption<int32>("ItemDelete.Quality", 3);
1268 _int_configs[CONFIG_ITEMDELETE_ITEM_LEVEL] = sConfigMgr->GetOption<int32>("ItemDelete.ItemLevel", 80);
1269
1270 _int_configs[CONFIG_FFA_PVP_TIMER] = sConfigMgr->GetOption<int32>("FFAPvPTimer", 30);
1271
1272 _int_configs[CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION] = sConfigMgr->GetOption<int32>("LootNeedBeforeGreedILvlRestriction", 70);
1273
1274 _bool_configs[CONFIG_PLAYER_SETTINGS_ENABLED] = sConfigMgr->GetOption<bool>("EnablePlayerSettings", 0);
1275
1276 _bool_configs[CONFIG_ALLOW_JOIN_BG_AND_LFG] = sConfigMgr->GetOption<bool>("JoinBGAndLFG.Enable", false);
1277
1278 _bool_configs[CONFIG_LEAVE_GROUP_ON_LOGOUT] = sConfigMgr->GetOption<bool>("LeaveGroupOnLogout.Enabled", true);
1279
1280 _bool_configs[CONFIG_QUEST_POI_ENABLED] = sConfigMgr->GetOption<bool>("QuestPOI.Enabled", true);
1281
1282 _int_configs[CONFIG_CHANGE_FACTION_MAX_MONEY] = sConfigMgr->GetOption<uint32>("ChangeFaction.MaxMoney", 0);
1283
1284 _bool_configs[CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH] = sConfigMgr->GetOption<bool>("Pet.RankMod.Health", true);
1285
1287 std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
1288 if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
1289 dataPath.push_back('/');
1290
1291#if AC_PLATFORM == AC_PLATFORM_UNIX || AC_PLATFORM == AC_PLATFORM_APPLE
1292 if (dataPath[0] == '~')
1293 {
1294 const char* home = getenv("HOME");
1295 if (home)
1296 dataPath.replace(0, 1, home);
1297 }
1298#endif
1299
1300 if (reload)
1301 {
1302 if (dataPath != _dataPath)
1303 LOG_ERROR("server.loading", "DataDir option can't be changed at worldserver.conf reload, using current value ({}).", _dataPath);
1304 }
1305 else
1306 {
1307 _dataPath = dataPath;
1308 LOG_INFO("server.loading", "Using DataDir {}", _dataPath);
1309 }
1310
1311 _bool_configs[CONFIG_VMAP_INDOOR_CHECK] = sConfigMgr->GetOption<bool>("vmap.enableIndoorCheck", 0);
1312 bool enableIndoor = sConfigMgr->GetOption<bool>("vmap.enableIndoorCheck", true);
1313 bool enableLOS = sConfigMgr->GetOption<bool>("vmap.enableLOS", true);
1314 bool enableHeight = sConfigMgr->GetOption<bool>("vmap.enableHeight", true);
1315 bool enablePetLOS = sConfigMgr->GetOption<bool>("vmap.petLOS", true);
1316 _bool_configs[CONFIG_VMAP_BLIZZLIKE_PVP_LOS] = sConfigMgr->GetOption<bool>("vmap.BlizzlikePvPLOS", true);
1317
1318 if (!enableHeight)
1319 LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
1320
1323 LOG_INFO("server.loading", "WORLD: VMap support included. LineOfSight:{}, getHeight:{}, indoorCheck:{} PetLOS:{}", enableLOS, enableHeight, enableIndoor, enablePetLOS);
1324
1325 _bool_configs[CONFIG_PET_LOS] = sConfigMgr->GetOption<bool>("vmap.petLOS", true);
1326 _bool_configs[CONFIG_START_CUSTOM_SPELLS] = sConfigMgr->GetOption<bool>("PlayerStart.CustomSpells", false);
1327 _int_configs[CONFIG_HONOR_AFTER_DUEL] = sConfigMgr->GetOption<int32>("HonorPointsAfterDuel", 0);
1328 _bool_configs[CONFIG_START_ALL_EXPLORED] = sConfigMgr->GetOption<bool>("PlayerStart.MapsExplored", false);
1329 _bool_configs[CONFIG_START_ALL_REP] = sConfigMgr->GetOption<bool>("PlayerStart.AllReputation", false);
1330 _bool_configs[CONFIG_ALWAYS_MAXSKILL] = sConfigMgr->GetOption<bool>("AlwaysMaxWeaponSkill", false);
1331 _bool_configs[CONFIG_PVP_TOKEN_ENABLE] = sConfigMgr->GetOption<bool>("PvPToken.Enable", false);
1332 _int_configs[CONFIG_PVP_TOKEN_MAP_TYPE] = sConfigMgr->GetOption<int32>("PvPToken.MapAllowType", 4);
1333 _int_configs[CONFIG_PVP_TOKEN_ID] = sConfigMgr->GetOption<int32>("PvPToken.ItemID", 29434);
1334 _int_configs[CONFIG_PVP_TOKEN_COUNT] = sConfigMgr->GetOption<int32>("PvPToken.ItemCount", 1);
1337
1338 _bool_configs[CONFIG_NO_RESET_TALENT_COST] = sConfigMgr->GetOption<bool>("NoResetTalentsCost", false);
1339 _int_configs[CONFIG_TOGGLE_XP_COST] = sConfigMgr->GetOption<int32>("ToggleXP.Cost", 100000);
1340 _bool_configs[CONFIG_SHOW_KICK_IN_WORLD] = sConfigMgr->GetOption<bool>("ShowKickInWorld", false);
1341 _bool_configs[CONFIG_SHOW_MUTE_IN_WORLD] = sConfigMgr->GetOption<bool>("ShowMuteInWorld", false);
1342 _bool_configs[CONFIG_SHOW_BAN_IN_WORLD] = sConfigMgr->GetOption<bool>("ShowBanInWorld", false);
1343 _int_configs[CONFIG_NUMTHREADS] = sConfigMgr->GetOption<int32>("MapUpdate.Threads", 1);
1344 _int_configs[CONFIG_MAX_RESULTS_LOOKUP_COMMANDS] = sConfigMgr->GetOption<int32>("Command.LookupMaxResults", 0);
1345
1346 // Warden
1347 _bool_configs[CONFIG_WARDEN_ENABLED] = sConfigMgr->GetOption<bool>("Warden.Enabled", true);
1348 _int_configs[CONFIG_WARDEN_NUM_MEM_CHECKS] = sConfigMgr->GetOption<int32>("Warden.NumMemChecks", 3);
1349 _int_configs[CONFIG_WARDEN_NUM_LUA_CHECKS] = sConfigMgr->GetOption<int32>("Warden.NumLuaChecks", 1);
1350 _int_configs[CONFIG_WARDEN_NUM_OTHER_CHECKS] = sConfigMgr->GetOption<int32>("Warden.NumOtherChecks", 7);
1351 _int_configs[CONFIG_WARDEN_CLIENT_BAN_DURATION] = sConfigMgr->GetOption<int32>("Warden.BanDuration", 86400);
1352 _int_configs[CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF] = sConfigMgr->GetOption<int32>("Warden.ClientCheckHoldOff", 30);
1353 _int_configs[CONFIG_WARDEN_CLIENT_FAIL_ACTION] = sConfigMgr->GetOption<int32>("Warden.ClientCheckFailAction", 0);
1354 _int_configs[CONFIG_WARDEN_CLIENT_RESPONSE_DELAY] = sConfigMgr->GetOption<int32>("Warden.ClientResponseDelay", 600);
1355
1356 // Dungeon finder
1357 _int_configs[CONFIG_LFG_OPTIONSMASK] = sConfigMgr->GetOption<int32>("DungeonFinder.OptionsMask", 5);
1358
1359 // Max instances per hour
1360 _int_configs[CONFIG_MAX_INSTANCES_PER_HOUR] = sConfigMgr->GetOption<int32>("AccountInstancesPerHour", 5);
1361
1362 // AutoBroadcast
1363 _bool_configs[CONFIG_AUTOBROADCAST] = sConfigMgr->GetOption<bool>("AutoBroadcast.On", false);
1364 _int_configs[CONFIG_AUTOBROADCAST_CENTER] = sConfigMgr->GetOption<int32>("AutoBroadcast.Center", 0);
1365 _int_configs[CONFIG_AUTOBROADCAST_INTERVAL] = sConfigMgr->GetOption<int32>("AutoBroadcast.Timer", 60000);
1366 _int_configs[CONFIG_AUTOBROADCAST_MIN_LEVEL_DISABLE] = sConfigMgr->GetOption<int32>("AutoBroadcast.MinDisableLevel", 0);
1367 if (reload)
1368 {
1371 }
1372
1373 // MySQL ping time interval
1374 _int_configs[CONFIG_DB_PING_INTERVAL] = sConfigMgr->GetOption<int32>("MaxPingTime", 30);
1375
1376 // misc
1377 _bool_configs[CONFIG_PDUMP_NO_PATHS] = sConfigMgr->GetOption<bool>("PlayerDump.DisallowPaths", true);
1378 _bool_configs[CONFIG_PDUMP_NO_OVERWRITE] = sConfigMgr->GetOption<bool>("PlayerDump.DisallowOverwrite", true);
1379 _bool_configs[CONFIG_ENABLE_MMAPS] = sConfigMgr->GetOption<bool>("MoveMaps.Enable", true);
1381
1382 // Wintergrasp
1383 _int_configs[CONFIG_WINTERGRASP_ENABLE] = sConfigMgr->GetOption<int32>("Wintergrasp.Enable", 1);
1384 _int_configs[CONFIG_WINTERGRASP_PLR_MAX] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMax", 100);
1385 _int_configs[CONFIG_WINTERGRASP_PLR_MIN] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMin", 0);
1386 _int_configs[CONFIG_WINTERGRASP_PLR_MIN_LVL] = sConfigMgr->GetOption<int32>("Wintergrasp.PlayerMinLvl", 77);
1387 _int_configs[CONFIG_WINTERGRASP_BATTLETIME] = sConfigMgr->GetOption<int32>("Wintergrasp.BattleTimer", 30);
1388 _int_configs[CONFIG_WINTERGRASP_NOBATTLETIME] = sConfigMgr->GetOption<int32>("Wintergrasp.NoBattleTimer", 150);
1389 _int_configs[CONFIG_WINTERGRASP_RESTART_AFTER_CRASH] = sConfigMgr->GetOption<int32>("Wintergrasp.CrashRestartTimer", 10);
1390
1391 _int_configs[CONFIG_BIRTHDAY_TIME] = sConfigMgr->GetOption<int32>("BirthdayTime", 1222964635);
1392 _bool_configs[CONFIG_MINIGOB_MANABONK] = sConfigMgr->GetOption<bool>("Minigob.Manabonk.Enable", true);
1393
1394 _bool_configs[CONFIG_ENABLE_CONTINENT_TRANSPORT] = sConfigMgr->GetOption<bool>("IsContinentTransport.Enabled", true);
1395 _bool_configs[CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING] = sConfigMgr->GetOption<bool>("IsPreloadedContinentTransport.Enabled", false);
1396
1397 _bool_configs[CONFIG_IP_BASED_ACTION_LOGGING] = sConfigMgr->GetOption<bool>("Allow.IP.Based.Action.Logging", false);
1398
1399 // Whether to use LoS from game objects
1400 _bool_configs[CONFIG_CHECK_GOBJECT_LOS] = sConfigMgr->GetOption<bool>("CheckGameObjectLoS", true);
1401
1402 _bool_configs[CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA] = sConfigMgr->GetOption<bool>("Calculate.Creature.Zone.Area.Data", false);
1403 _bool_configs[CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA] = sConfigMgr->GetOption<bool>("Calculate.Gameoject.Zone.Area.Data", false);
1404
1405 // Player can join LFG anywhere
1406 _bool_configs[CONFIG_LFG_LOCATION_ALL] = sConfigMgr->GetOption<bool>("LFG.Location.All", false);
1407
1408 // Prevent players AFK from being logged out
1409 _int_configs[CONFIG_AFK_PREVENT_LOGOUT] = sConfigMgr->GetOption<int32>("PreventAFKLogout", 0);
1410
1411 // Preload all grids of all non-instanced maps
1412 _bool_configs[CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS] = sConfigMgr->GetOption<bool>("PreloadAllNonInstancedMapGrids", false);
1413
1414 // ICC buff override
1415 _int_configs[CONFIG_ICC_BUFF_HORDE] = sConfigMgr->GetOption<int32>("ICC.Buff.Horde", 73822);
1416 _int_configs[CONFIG_ICC_BUFF_ALLIANCE] = sConfigMgr->GetOption<int32>("ICC.Buff.Alliance", 73828);
1417
1418 _bool_configs[CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE] = sConfigMgr->GetOption<bool>("SetAllCreaturesWithWaypointMovementActive", false);
1419
1420 // packet spoof punishment
1422 _int_configs[CONFIG_PACKET_SPOOF_BANMODE] = sConfigMgr->GetOption<int32>("PacketSpoof.BanMode", (uint32)0);
1425
1426 _int_configs[CONFIG_PACKET_SPOOF_BANDURATION] = sConfigMgr->GetOption<int32>("PacketSpoof.BanDuration", 86400);
1427
1428 // Random Battleground Rewards
1429 _int_configs[CONFIG_BG_REWARD_WINNER_HONOR_FIRST] = sConfigMgr->GetOption<int32>("Battleground.RewardWinnerHonorFirst", 30);
1430 _int_configs[CONFIG_BG_REWARD_WINNER_ARENA_FIRST] = sConfigMgr->GetOption<int32>("Battleground.RewardWinnerArenaFirst", 25);
1431 _int_configs[CONFIG_BG_REWARD_WINNER_HONOR_LAST] = sConfigMgr->GetOption<int32>("Battleground.RewardWinnerHonorLast", 15);
1432 _int_configs[CONFIG_BG_REWARD_WINNER_ARENA_LAST] = sConfigMgr->GetOption<int32>("Battleground.RewardWinnerArenaLast", 0);
1433 _int_configs[CONFIG_BG_REWARD_LOSER_HONOR_FIRST] = sConfigMgr->GetOption<int32>("Battleground.RewardLoserHonorFirst", 5);
1434 _int_configs[CONFIG_BG_REWARD_LOSER_HONOR_LAST] = sConfigMgr->GetOption<int32>("Battleground.RewardLoserHonorLast", 5);
1435
1436 _int_configs[CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER] = sConfigMgr->GetOption<int32>("WaypointMovementStopTimeForPlayer", 120);
1437
1438 _int_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PRINT_MODE] = sConfigMgr->GetOption<int32>("DungeonAccessRequirements.PrintMode", 1);
1439 _bool_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PORTAL_CHECK_ILVL] = sConfigMgr->GetOption<bool>("DungeonAccessRequirements.PortalAvgIlevelCheck", false);
1440 _bool_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_LFG_DBC_LEVEL_OVERRIDE] = sConfigMgr->GetOption<bool>("DungeonAccessRequirements.LFGLevelDBCOverride", false);
1441 _int_configs[CONFIG_DUNGEON_ACCESS_REQUIREMENTS_OPTIONAL_STRING_ID] = sConfigMgr->GetOption<int32>("DungeonAccessRequirements.OptionalStringID", 0);
1442 _int_configs[CONFIG_NPC_EVADE_IF_NOT_REACHABLE] = sConfigMgr->GetOption<int32>("NpcEvadeIfTargetIsUnreachable", 5);
1443 _int_configs[CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID] = sConfigMgr->GetOption<int32>("NpcRegenHPTimeIfTargetIsUnreachable", 10);
1444 _bool_configs[CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID] = sConfigMgr->GetOption<bool>("NpcRegenHPIfTargetIsUnreachable", true);
1445
1446 //Debug
1447 _bool_configs[CONFIG_DEBUG_BATTLEGROUND] = sConfigMgr->GetOption<bool>("Debug.Battleground", false);
1448 _bool_configs[CONFIG_DEBUG_ARENA] = sConfigMgr->GetOption<bool>("Debug.Arena", false);
1449
1450 _int_configs[CONFIG_GM_LEVEL_CHANNEL_MODERATION] = sConfigMgr->GetOption<int32>("Channel.ModerationGMLevel", 1);
1451
1452 _bool_configs[CONFIG_SET_BOP_ITEM_TRADEABLE] = sConfigMgr->GetOption<bool>("Item.SetItemTradeable", true);
1453
1454 // Specifies if IP addresses can be logged to the database
1455 _bool_configs[CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE] = sConfigMgr->GetOption<bool>("AllowLoggingIPAddressesInDatabase", true, true);
1456
1457 // LFG group mechanics.
1458 _int_configs[CONFIG_LFG_MAX_KICK_COUNT] = sConfigMgr->GetOption<int32>("LFG.MaxKickCount", 2);
1460 {
1462 LOG_ERROR("server.loading", "LFG.MaxKickCount can't be higher than 3.");
1463 }
1464
1465 _int_configs[CONFIG_LFG_KICK_PREVENTION_TIMER] = sConfigMgr->GetOption<int32>("LFG.KickPreventionTimer", 15 * MINUTE * IN_MILLISECONDS) * IN_MILLISECONDS;
1467 {
1469 LOG_ERROR("server.loading", "LFG.KickPreventionTimer can't be higher than 15 minutes.");
1470 }
1471
1472 // Realm Availability
1473 _bool_configs[CONFIG_REALM_LOGIN_ENABLED] = sConfigMgr->GetOption<bool>("World.RealmAvailability", true);
1474
1475 // call ScriptMgr if we're reloading the configuration
1476 sScriptMgr->OnAfterConfigLoad(reload);
1477}
constexpr auto IN_MILLISECONDS
Definition: Common.h:62
constexpr auto HOUR
Definition: Common.h:57
@ SEC_ADMINISTRATOR
Definition: Common.h:69
@ SEC_MODERATOR
Definition: Common.h:67
@ SEC_CONSOLE
Definition: Common.h:70
constexpr auto MINUTE
Definition: Common.h:56
#define sLog
Definition: Log.h:128
#define sMetric
Definition: Metric.h:132
#define MAX_VISIBILITY_DISTANCE
Definition: ObjectDefines.h:31
#define DEFAULT_VISIBILITY_DISTANCE
Definition: ObjectDefines.h:40
#define CONTACT_DISTANCE
Definition: ObjectDefines.h:23
#define DEFAULT_VISIBILITY_BGARENAS
Definition: ObjectDefines.h:43
#define NOMINAL_MELEE_RANGE
Definition: ObjectDefines.h:48
#define DEFAULT_VISIBILITY_INSTANCE
Definition: ObjectDefines.h:41
#define MAX_MONEY_AMOUNT
Definition: Player.h:922
float baseMoveSpeed[MAX_MOVE_TYPE]
Definition: Unit.cpp:76
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
Definition: Unit.cpp:89
#define MAX_MOVE_TYPE
Definition: Unit.h:389
#define MAX_PLAYER_NAME
Definition: ObjectMgr.h:688
#define MAX_CHARTER_NAME
Definition: ObjectMgr.h:691
#define MAX_PET_NAME
Definition: ObjectMgr.h:690
#define MIN_MAP_UPDATE_DELAY
Definition: GridDefines.h:42
#define sMapMgr
Definition: MapMgr.h:221
#define sScriptMgr
Definition: ScriptMgr.h:2702
WorldUpdateTime sWorldUpdateTime
Definition: UpdateTime.cpp:24
@ CONFIG_AUTOBROADCAST_CENTER
Definition: IWorld.h:351
@ CONFIG_CHANGE_FACTION_MAX_MONEY
Definition: IWorld.h:413
@ CONFIG_ARENA_START_MATCHMAKER_RATING
Definition: IWorld.h:328
@ CONFIG_ARENA_SEASON_ID
Definition: IWorld.h:325
@ CONFIG_MAX_ALLOWED_MMR_DROP
Definition: IWorld.h:340
@ CONFIG_BATTLEGROUND_PLAYER_RESPAWN
Definition: IWorld.h:313
@ CONFIG_START_HEROIC_PLAYER_MONEY
Definition: IWorld.h:239
@ CONFIG_CORPSE_DECAY_ELITE
Definition: IWorld.h:300
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_LEVEL
Definition: IWorld.h:317
@ CONFIG_ARENA_GAMES_REQUIRED
Definition: IWorld.h:324
@ CONFIG_MAX_INSTANCES_PER_HOUR
Definition: IWorld.h:359
@ CONFIG_GUILD_EVENT_LOG_COUNT
Definition: IWorld.h:342
@ CONFIG_ARENA_START_RATING
Definition: IWorld.h:326
@ CONFIG_SOCKET_TIMEOUTTIME
Definition: IWorld.h:214
@ CONFIG_BATTLEGROUND_REPORT_AFK_TIMER
Definition: IWorld.h:310
@ CONFIG_MAX_OVERSPEED_PINGS
Definition: IWorld.h:273
@ CONFIG_WARDEN_NUM_LUA_CHECKS
Definition: IWorld.h:374
@ CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN
Definition: IWorld.h:315
@ CONFIG_CHARDELETE_METHOD
Definition: IWorld.h:349
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY
Definition: IWorld.h:306
@ CONFIG_SESSION_ADD_DELAY
Definition: IWorld.h:215
@ CONFIG_AUTOBROADCAST_MIN_LEVEL_DISABLE
Definition: IWorld.h:353
@ CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK
Definition: IWorld.h:227
@ CONFIG_WARDEN_CLIENT_BAN_DURATION
Definition: IWorld.h:372
@ CONFIG_CLIENTCACHE_VERSION
Definition: IWorld.h:341
@ CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF
Definition: IWorld.h:285
@ CONFIG_SKILL_CHANCE_ORANGE
Definition: IWorld.h:263
@ CONFIG_GM_CHAT
Definition: IWorld.h:255
@ CONFIG_LFG_KICK_PREVENTION_TIMER
Definition: IWorld.h:412
@ CONFIG_FFA_PVP_TIMER
Definition: IWorld.h:409
@ CONFIG_CHATFLOOD_MUTE_TIME
Definition: IWorld.h:279
@ CONFIG_STRICT_PET_NAMES
Definition: IWorld.h:221
@ CONFIG_CHARACTER_CREATING_DISABLED
Definition: IWorld.h:225
@ CONFIG_MIN_PET_NAME
Definition: IWorld.h:224
@ CONFIG_LOGDB_CLEARTIME
Definition: IWorld.h:337
@ CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION
Definition: IWorld.h:410
@ CONFIG_INSTANCE_RESET_TIME_RELATIVE_TIMESTAMP
Definition: IWorld.h:248
@ CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF
Definition: IWorld.h:286
@ CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK
Definition: IWorld.h:226
@ CONFIG_INTERVAL_CHANGEWEATHER
Definition: IWorld.h:210
@ CONFIG_GUILD_BANK_TAB_COST_4
Definition: IWorld.h:403
@ CONFIG_NPC_EVADE_IF_NOT_REACHABLE
Definition: IWorld.h:407
@ CONFIG_EVENT_ANNOUNCE
Definition: IWorld.h:280
@ CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION
Definition: IWorld.h:356
@ CONFIG_GM_WHISPERING_TO
Definition: IWorld.h:256
@ CONFIG_SKILL_CHANCE_SKINNING_STEPS
Definition: IWorld.h:268
@ CONFIG_INSTANT_LOGOUT
Definition: IWorld.h:304
@ CONFIG_SKILL_CHANCE_YELLOW
Definition: IWorld.h:264
@ CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN
Definition: IWorld.h:314
@ CONFIG_DUNGEON_ACCESS_REQUIREMENTS_OPTIONAL_STRING_ID
Definition: IWorld.h:397
@ CONFIG_AUTOBROADCAST_INTERVAL
Definition: IWorld.h:352
@ CONFIG_MAX_HONOR_POINTS
Definition: IWorld.h:240
@ CONFIG_PVP_TOKEN_MAP_TYPE
Definition: IWorld.h:330
@ CONFIG_ENABLE_SINFO_LOGIN
Definition: IWorld.h:333
@ CONFIG_CHARTER_COST_GUILD
Definition: IWorld.h:390
@ CONFIG_CHARDELETE_MIN_LEVEL
Definition: IWorld.h:350
@ CONFIG_WARDEN_NUM_MEM_CHECKS
Definition: IWorld.h:373
@ CONFIG_MAX_ARENA_POINTS
Definition: IWorld.h:243
@ CONFIG_ARENA_MAX_RATING_DIFFERENCE
Definition: IWorld.h:320
@ CONFIG_BG_REWARD_LOSER_HONOR_LAST
Definition: IWorld.h:389
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_PLAYERS
Definition: IWorld.h:318
@ CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN
Definition: IWorld.h:316
@ CONFIG_START_GM_LEVEL
Definition: IWorld.h:259
@ CONFIG_MAIL_LEVEL_REQ
Definition: IWorld.h:297
@ CONFIG_SKILL_GAIN_DEFENSE
Definition: IWorld.h:270
@ CONFIG_MIN_PETITION_SIGNS
Definition: IWorld.h:251
@ CONFIG_BIRTHDAY_TIME
Definition: IWorld.h:376
@ CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF
Definition: IWorld.h:370
@ CONFIG_PARTY_LEVEL_REQ
Definition: IWorld.h:292
@ CONFIG_MIN_LEVEL_STAT_SAVE
Definition: IWorld.h:344
@ CONFIG_START_HEROIC_PLAYER_LEVEL
Definition: IWorld.h:237
@ CONFIG_BATTLEGROUND_INVITATION_TYPE
Definition: IWorld.h:312
@ CONFIG_GUILD_BANK_TAB_COST_3
Definition: IWorld.h:402
@ CONFIG_START_ARENA_POINTS
Definition: IWorld.h:244
@ CONFIG_MIN_CHARTER_NAME
Definition: IWorld.h:223
@ CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID
Definition: IWorld.h:408
@ CONFIG_CHAT_CHANNEL_LEVEL_REQ
Definition: IWorld.h:289
@ CONFIG_STRICT_CHANNEL_NAMES
Definition: IWorld.h:220
@ CONFIG_BG_REWARD_WINNER_ARENA_FIRST
Definition: IWorld.h:385
@ CONFIG_CHARACTERS_PER_ACCOUNT
Definition: IWorld.h:228
@ CONFIG_DEATH_SICKNESS_LEVEL
Definition: IWorld.h:303
@ CONFIG_CHARTER_COST_ARENA_5v5
Definition: IWorld.h:393
@ CONFIG_INSTANCE_RESET_TIME_HOUR
Definition: IWorld.h:247
@ CONFIG_GM_LEVEL_CHANNEL_MODERATION
Definition: IWorld.h:405
@ CONFIG_WINTERGRASP_PLR_MIN_LVL
Definition: IWorld.h:362
@ CONFIG_PVP_TOKEN_ID
Definition: IWorld.h:331
@ CONFIG_GUILD_RESET_HOUR
Definition: IWorld.h:347
@ CONFIG_SKILL_GAIN_WEAPON
Definition: IWorld.h:272
@ CONFIG_MAIL_DELIVERY_DELAY
Definition: IWorld.h:261
@ CONFIG_WINTERGRASP_BATTLETIME
Definition: IWorld.h:363
@ CONFIG_WINTERGRASP_NOBATTLETIME
Definition: IWorld.h:364
@ CONFIG_PVP_TOKEN_COUNT
Definition: IWorld.h:332
@ CONFIG_PACKET_SPOOF_BANDURATION
Definition: IWorld.h:368
@ CONFIG_WATER_BREATH_TIMER
Definition: IWorld.h:414
@ CONFIG_INSTANT_TAXI
Definition: IWorld.h:378
@ CONFIG_SKILL_CHANCE_MINING_STEPS
Definition: IWorld.h:267
@ CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS
Definition: IWorld.h:323
@ CONFIG_START_PLAYER_MONEY
Definition: IWorld.h:238
@ CONFIG_GUILD_BANK_EVENT_LOG_COUNT
Definition: IWorld.h:343
@ CONFIG_TRADE_LEVEL_REQ
Definition: IWorld.h:294
@ CONFIG_BG_REWARD_WINNER_ARENA_LAST
Definition: IWorld.h:387
@ CONFIG_ICC_BUFF_ALLIANCE
Definition: IWorld.h:381
@ CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH
Definition: IWorld.h:309
@ CONFIG_CORPSE_DECAY_NORMAL
Definition: IWorld.h:298
@ CONFIG_WINTERGRASP_RESTART_AFTER_CRASH
Definition: IWorld.h:365
@ CONFIG_TELEPORT_TIMEOUT_FAR
Definition: IWorld.h:339
@ CONFIG_SOCKET_TIMEOUTTIME_ACTIVE
Definition: IWorld.h:377
@ CONFIG_START_PLAYER_LEVEL
Definition: IWorld.h:236
@ CONFIG_GUILD_BANK_TAB_COST_2
Definition: IWorld.h:401
@ CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL
Definition: IWorld.h:245
@ CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE
Definition: IWorld.h:246
@ CONFIG_BG_REWARD_WINNER_HONOR_FIRST
Definition: IWorld.h:384
@ CONFIG_ARENA_START_PERSONAL_RATING
Definition: IWorld.h:327
@ CONFIG_COMPRESSION
Definition: IWorld.h:208
@ CONFIG_STRICT_CHARTER_NAMES
Definition: IWorld.h:219
@ CONFIG_INTERVAL_SAVE
Definition: IWorld.h:212
@ CONFIG_BG_REWARD_LOSER_HONOR_FIRST
Definition: IWorld.h:388
@ CONFIG_CORPSE_DECAY_WORLDBOSS
Definition: IWorld.h:302
@ CONFIG_TICKET_LEVEL_REQ
Definition: IWorld.h:295
@ CONFIG_PACKET_SPOOF_POLICY
Definition: IWorld.h:366
@ CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT
Definition: IWorld.h:277
@ CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PRINT_MODE
Definition: IWorld.h:396
@ CONFIG_GUILD_BANK_TAB_COST_5
Definition: IWorld.h:404
@ CONFIG_LFG_OPTIONSMASK
Definition: IWorld.h:358
@ CONFIG_GM_LOGIN_STATE
Definition: IWorld.h:252
@ CONFIG_ARENA_PREV_OPPONENTS_DISCARD_TIMER
Definition: IWorld.h:322
@ CONFIG_AUCTION_LEVEL_REQ
Definition: IWorld.h:296
@ CONFIG_REALM_ZONE
Definition: IWorld.h:217
@ CONFIG_CHAT_STRICT_LINK_CHECKING_KICK
Definition: IWorld.h:288
@ CONFIG_GM_LEVEL_IN_GM_LIST
Definition: IWorld.h:257
@ CONFIG_ARENA_RATING_DISCARD_TIMER
Definition: IWorld.h:321
@ CONFIG_WARDEN_NUM_OTHER_CHECKS
Definition: IWorld.h:375
@ CONFIG_HEROIC_CHARACTERS_PER_REALM
Definition: IWorld.h:231
@ CONFIG_WINTERGRASP_ENABLE
Definition: IWorld.h:319
@ CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER
Definition: IWorld.h:395
@ CONFIG_GM_VISIBLE_STATE
Definition: IWorld.h:253
@ CONFIG_MAX_WHO_LIST_RETURN
Definition: IWorld.h:394
@ CONFIG_GROUP_VISIBILITY
Definition: IWorld.h:260
@ CONFIG_CREATURE_FAMILY_FLEE_DELAY
Definition: IWorld.h:283
@ CONFIG_PACKET_SPOOF_BANMODE
Definition: IWorld.h:367
@ CONFIG_CHARDELETE_KEEP_DAYS
Definition: IWorld.h:348
@ CONFIG_MAX_RESULTS_LOOKUP_COMMANDS
Definition: IWorld.h:354
@ CONFIG_START_HONOR_POINTS
Definition: IWorld.h:242
@ CONFIG_CREATURE_STOP_FOR_PLAYER
Definition: IWorld.h:230
@ CONFIG_CHAT_WHISPER_LEVEL_REQ
Definition: IWorld.h:290
@ CONFIG_SKILL_GAIN_GATHERING
Definition: IWorld.h:271
@ CONFIG_CHARTER_COST_ARENA_2v2
Definition: IWorld.h:391
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMER
Definition: IWorld.h:307
@ CONFIG_AFK_PREVENT_LOGOUT
Definition: IWorld.h:379
@ CONFIG_CHATFLOOD_MESSAGE_DELAY
Definition: IWorld.h:276
@ CONFIG_DISABLE_BREATHING
Definition: IWorld.h:305
@ CONFIG_STRICT_PLAYER_NAMES
Definition: IWorld.h:218
@ CONFIG_LOGDB_CLEARINTERVAL
Definition: IWorld.h:336
@ CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT
Definition: IWorld.h:241
@ CONFIG_BATTLEGROUND_REPORT_AFK
Definition: IWorld.h:311
@ CONFIG_INSTANCE_UNLOAD_DELAY
Definition: IWorld.h:249
@ CONFIG_GM_LEVEL_IN_WHO_LIST
Definition: IWorld.h:258
@ CONFIG_TELEPORT_TIMEOUT_NEAR
Definition: IWorld.h:338
@ CONFIG_GUILD_BANK_TAB_COST_1
Definition: IWorld.h:400
@ CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER
Definition: IWorld.h:308
@ CONFIG_GUILD_BANK_TAB_COST_0
Definition: IWorld.h:399
@ CONFIG_HONOR_AFTER_DUEL
Definition: IWorld.h:329
@ CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS
Definition: IWorld.h:357
@ CONFIG_EXPANSION
Definition: IWorld.h:274
@ CONFIG_CORPSE_DECAY_RARE
Definition: IWorld.h:299
@ CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY
Definition: IWorld.h:287
@ CONFIG_UPTIME_UPDATE
Definition: IWorld.h:262
@ CONFIG_WARDEN_CLIENT_RESPONSE_DELAY
Definition: IWorld.h:369
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD
Definition: IWorld.h:282
@ CONFIG_WINTERGRASP_PLR_MAX
Definition: IWorld.h:360
@ CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER
Definition: IWorld.h:232
@ CONFIG_PORT_WORLD
Definition: IWorld.h:213
@ CONFIG_MIN_DUALSPEC_LEVEL
Definition: IWorld.h:235
@ CONFIG_LFG_MAX_KICK_COUNT
Definition: IWorld.h:411
@ CONFIG_SKILL_GAIN_CRAFTING
Definition: IWorld.h:269
@ CONFIG_RANDOM_BG_RESET_HOUR
Definition: IWorld.h:345
@ CONFIG_DB_PING_INTERVAL
Definition: IWorld.h:355
@ CONFIG_WORLD_BOSS_LEVEL_DIFF
Definition: IWorld.h:284
@ CONFIG_CORPSE_DECAY_RAREELITE
Definition: IWorld.h:301
@ CONFIG_CHATFLOOD_MESSAGE_COUNT
Definition: IWorld.h:275
@ CONFIG_CHAT_TIME_MUTE_FIRST_LOGIN
Definition: IWorld.h:293
@ CONFIG_WARDEN_CLIENT_FAIL_ACTION
Definition: IWorld.h:371
@ CONFIG_ITEMDELETE_QUALITY
Definition: IWorld.h:382
@ CONFIG_CHARTER_COST_ARENA_3v3
Definition: IWorld.h:392
@ CONFIG_MIN_PLAYER_NAME
Definition: IWorld.h:222
@ CONFIG_ICC_BUFF_HORDE
Definition: IWorld.h:380
@ CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY
Definition: IWorld.h:278
@ CONFIG_SKILL_CHANCE_GREY
Definition: IWorld.h:266
@ CONFIG_TOGGLE_XP_COST
Definition: IWorld.h:406
@ CONFIG_INTERVAL_MAPUPDATE
Definition: IWorld.h:209
@ CONFIG_NUMTHREADS
Definition: IWorld.h:335
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY
Definition: IWorld.h:281
@ CONFIG_MAX_PRIMARY_TRADE_SKILL
Definition: IWorld.h:250
@ CONFIG_ITEMDELETE_ITEM_LEVEL
Definition: IWorld.h:383
@ CONFIG_SKIP_CINEMATICS
Definition: IWorld.h:233
@ CONFIG_SKILL_CHANCE_GREEN
Definition: IWorld.h:265
@ CONFIG_CHAT_SAY_LEVEL_REQ
Definition: IWorld.h:291
@ CONFIG_WINTERGRASP_PLR_MIN
Definition: IWorld.h:361
@ CONFIG_BG_REWARD_WINNER_HONOR_LAST
Definition: IWorld.h:386
@ CONFIG_CHARACTERS_PER_REALM
Definition: IWorld.h:229
@ CONFIG_GUILD_BANK_INITIAL_TABS
Definition: IWorld.h:398
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR
Definition: IWorld.h:77
@ CONFIG_SHOW_KICK_IN_WORLD
Definition: IWorld.h:135
@ CONFIG_QUEST_IGNORE_AUTO_COMPLETE
Definition: IWorld.h:148
@ CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY
Definition: IWorld.h:97
@ CONFIG_BG_XP_FOR_KILL
Definition: IWorld.h:121
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT
Definition: IWorld.h:78
@ CONFIG_AUTOBROADCAST
Definition: IWorld.h:138
@ CONFIG_CHECK_GOBJECT_LOS
Definition: IWorld.h:157
@ CONFIG_WEATHER
Definition: IWorld.h:98
@ CONFIG_ALL_TAXI_PATHS
Definition: IWorld.h:87
@ CONFIG_GM_LOWER_SECURITY
Definition: IWorld.h:94
@ CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS
Definition: IWorld.h:122
@ CONFIG_DUNGEON_ACCESS_REQUIREMENTS_LFG_DBC_LEVEL_OVERRIDE
Definition: IWorld.h:168
@ CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS
Definition: IWorld.h:146
@ CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL
Definition: IWorld.h:103
@ CONFIG_BATTLEGROUND_DISABLE_QUEST_SHARE_IN_BG
Definition: IWorld.h:113
@ CONFIG_START_CUSTOM_SPELLS
Definition: IWorld.h:129
@ CONFIG_SKILL_MILLING
Definition: IWorld.h:96
@ CONFIG_PDUMP_NO_OVERWRITE
Definition: IWorld.h:143
@ CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP
Definition: IWorld.h:107
@ CONFIG_ALLOW_TWO_SIDE_WHO_LIST
Definition: IWorld.h:84
@ CONFIG_STRICT_NAMES_PROFANITY
Definition: IWorld.h:183
@ CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE
Definition: IWorld.h:171
@ CONFIG_SHOW_MUTE_IN_WORLD
Definition: IWorld.h:136
@ CONFIG_STRICT_NAMES_RESERVED
Definition: IWorld.h:182
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION
Definition: IWorld.h:82
@ CONFIG_ALLOW_GM_GROUP
Definition: IWorld.h:92
@ CONFIG_DECLINED_NAMES_USED
Definition: IWorld.h:112
@ CONFIG_MINIGOB_MANABONK
Definition: IWorld.h:153
@ CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS
Definition: IWorld.h:160
@ CONFIG_LFG_LOCATION_ALL
Definition: IWorld.h:159
@ CONFIG_LEAVE_GROUP_ON_LOGOUT
Definition: IWorld.h:176
@ CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA
Definition: IWorld.h:156
@ CONFIG_ALLOW_PLAYER_COMMANDS
Definition: IWorld.h:73
@ CONFIG_ALLOW_GM_FRIEND
Definition: IWorld.h:93
@ CONFIG_INSTANCE_GMSUMMON_PLAYER
Definition: IWorld.h:90
@ CONFIG_QUEST_IGNORE_RAID
Definition: IWorld.h:100
@ CONFIG_SHOW_BAN_IN_WORLD
Definition: IWorld.h:137
@ CONFIG_CLEAN_CHARACTER_DB
Definition: IWorld.h:74
@ CONFIG_CHAT_MUTE_FIRST_LOGIN
Definition: IWorld.h:106
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY
Definition: IWorld.h:117
@ CONFIG_CHAT_FAKE_MESSAGE_PREVENTING
Definition: IWorld.h:105
@ CONFIG_ALLOW_TWO_SIDE_TRADE
Definition: IWorld.h:86
@ CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE
Definition: IWorld.h:108
@ CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND
Definition: IWorld.h:85
@ CONFIG_SKILL_PROSPECTING
Definition: IWorld.h:95
@ CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS
Definition: IWorld.h:175
@ CONFIG_IP_BASED_ACTION_LOGGING
Definition: IWorld.h:154
@ CONFIG_ADDON_CHANNEL
Definition: IWorld.h:72
@ CONFIG_START_ALL_REP
Definition: IWorld.h:131
@ CONFIG_PVP_TOKEN_ENABLE
Definition: IWorld.h:133
@ CONFIG_ARENA_SEASON_IN_PROGRESS
Definition: IWorld.h:123
@ CONFIG_DETECT_POS_COLLISION
Definition: IWorld.h:101
@ CONFIG_DEATH_BONES_BG_OR_ARENA
Definition: IWorld.h:110
@ CONFIG_VMAP_BLIZZLIKE_PVP_LOS
Definition: IWorld.h:178
@ CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE
Definition: IWorld.h:119
@ CONFIG_INSTANCE_IGNORE_RAID
Definition: IWorld.h:89
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL
Definition: IWorld.h:83
@ CONFIG_BATTLEGROUND_CAST_DESERTER
Definition: IWorld.h:115
@ CONFIG_CLOSE_IDLE_CONNECTIONS
Definition: IWorld.h:158
@ CONFIG_OBJECT_QUEST_MARKERS
Definition: IWorld.h:181
@ CONFIG_SET_BOP_ITEM_TRADEABLE
Definition: IWorld.h:170
@ CONFIG_STATS_SAVE_ONLY_ON_LOGOUT
Definition: IWorld.h:75
@ CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING
Definition: IWorld.h:152
@ CONFIG_DEBUG_ARENA
Definition: IWorld.h:166
@ CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE
Definition: IWorld.h:124
@ CONFIG_RESTRICTED_LFG_CHANNEL
Definition: IWorld.h:102
@ CONFIG_NO_RESET_TALENT_COST
Definition: IWorld.h:134
@ CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA
Definition: IWorld.h:155
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL
Definition: IWorld.h:79
@ CONFIG_PRESERVE_CUSTOM_CHANNELS
Definition: IWorld.h:141
@ CONFIG_ENABLE_MMAPS
Definition: IWorld.h:144
@ CONFIG_ALLOW_JOIN_BG_AND_LFG
Definition: IWorld.h:174
@ CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH
Definition: IWorld.h:184
@ CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN
Definition: IWorld.h:126
@ CONFIG_QUEST_POI_ENABLED
Definition: IWorld.h:177
@ CONFIG_ITEMDELETE_METHOD
Definition: IWorld.h:162
@ CONFIG_DURABILITY_LOSS_IN_PVP
Definition: IWorld.h:71
@ CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY
Definition: IWorld.h:125
@ CONFIG_ENABLE_LOGIN_AFTER_DC
Definition: IWorld.h:145
@ CONFIG_BATTLEGROUND_TRACK_DESERTERS
Definition: IWorld.h:120
@ CONFIG_QUEST_IGNORE_AUTO_ACCEPT
Definition: IWorld.h:147
@ CONFIG_DIE_COMMAND_MODE
Definition: IWorld.h:111
@ CONFIG_DEBUG_BATTLEGROUND
Definition: IWorld.h:165
@ CONFIG_ALLOW_TWO_SIDE_ACCOUNTS
Definition: IWorld.h:76
@ CONFIG_PLAYER_SETTINGS_ENABLED
Definition: IWorld.h:173
@ CONFIG_VMAP_INDOOR_CHECK
Definition: IWorld.h:127
@ CONFIG_INSTANCE_SHARED_ID
Definition: IWorld.h:91
@ CONFIG_WARDEN_ENABLED
Definition: IWorld.h:150
@ CONFIG_ITEMDELETE_VENDOR
Definition: IWorld.h:163
@ CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE
Definition: IWorld.h:164
@ CONFIG_PDUMP_NO_PATHS
Definition: IWorld.h:142
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE
Definition: IWorld.h:161
@ CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL
Definition: IWorld.h:99
@ CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG
Definition: IWorld.h:114
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP
Definition: IWorld.h:80
@ CONFIG_OBJECT_SPARKLES
Definition: IWorld.h:179
@ CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PORTAL_CHECK_ILVL
Definition: IWorld.h:167
@ CONFIG_DELETE_CHARACTER_TICKET_TRACE
Definition: IWorld.h:140
@ CONFIG_REALM_LOGIN_ENABLED
Definition: IWorld.h:172
@ CONFIG_ENABLE_CONTINENT_TRANSPORT
Definition: IWorld.h:151
@ CONFIG_DEATH_BONES_WORLD
Definition: IWorld.h:109
@ CONFIG_QUEST_ENABLE_QUEST_TRACKER
Definition: IWorld.h:149
@ CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID
Definition: IWorld.h:169
@ CONFIG_ALWAYS_MAXSKILL
Definition: IWorld.h:132
@ CONFIG_TALENTS_INSPECTING
Definition: IWorld.h:104
@ CONFIG_LOW_LEVEL_REGEN_BOOST
Definition: IWorld.h:180
@ CONFIG_ALLOW_TICKETS
Definition: IWorld.h:139
@ CONFIG_START_ALL_EXPLORED
Definition: IWorld.h:130
@ CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD
Definition: IWorld.h:81
@ CONFIG_PET_LOS
Definition: IWorld.h:128
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED
Definition: IWorld.h:118
@ CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE
Definition: IWorld.h:116
@ CONFIG_INSTANCE_IGNORE_LEVEL
Definition: IWorld.h:88
@ RATE_REWARD_BONUS_MONEY
Definition: IWorld.h:457
@ RATE_SELLVALUE_ITEM_ARTIFACT
Definition: IWorld.h:446
@ RATE_BUYVALUE_ITEM_ARTIFACT
Definition: IWorld.h:454
@ RATE_CREATURE_NORMAL_SPELLDAMAGE
Definition: IWorld.h:485
@ RATE_CREATURE_NORMAL_HP
Definition: IWorld.h:475
@ RATE_DAMAGE_FALL
Definition: IWorld.h:494
@ RATE_DROP_ITEM_REFERENCED_AMOUNT
Definition: IWorld.h:439
@ RATE_CREATURE_NORMAL_DAMAGE
Definition: IWorld.h:480
@ RATE_POWER_RAGE_INCOME
Definition: IWorld.h:423
@ RATE_CREATURE_ELITE_RARE_DAMAGE
Definition: IWorld.h:484
@ RATE_CREATURE_AGGRO
Definition: IWorld.h:490
@ RATE_BUYVALUE_ITEM_POOR
Definition: IWorld.h:448
@ RATE_SELLVALUE_ITEM_EPIC
Definition: IWorld.h:444
@ RATE_POWER_RAGE_LOSS
Definition: IWorld.h:424
@ RATE_REPUTATION_LOWLEVEL_QUEST
Definition: IWorld.h:473
@ RATE_ARENA_POINTS
Definition: IWorld.h:499
@ RATE_DURABILITY_LOSS_BLOCK
Definition: IWorld.h:508
@ RATE_DROP_ITEM_RARE
Definition: IWorld.h:433
@ RATE_XP_PET_NEXT_LEVEL
Definition: IWorld.h:469
@ RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE
Definition: IWorld.h:486
@ RATE_REPUTATION_LOWLEVEL_KILL
Definition: IWorld.h:472
@ RATE_XP_KILL
Definition: IWorld.h:458
@ RATE_XP_QUEST_DF
Definition: IWorld.h:466
@ RATE_POWER_RUNICPOWER_INCOME
Definition: IWorld.h:425
@ RATE_INSTANCE_RESET_TIME
Definition: IWorld.h:502
@ RATE_REST_OFFLINE_IN_WILDERNESS
Definition: IWorld.h:493
@ RATE_POWER_RUNICPOWER_LOSS
Definition: IWorld.h:426
@ RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE
Definition: IWorld.h:483
@ RATE_XP_BG_KILL_SOTA
Definition: IWorld.h:463
@ RATE_POWER_ENERGY
Definition: IWorld.h:428
@ RATE_TALENT
Definition: IWorld.h:500
@ RATE_SELLVALUE_ITEM_NORMAL
Definition: IWorld.h:441
@ RATE_XP_BG_KILL_WSG
Definition: IWorld.h:460
@ RATE_CREATURE_ELITE_RAREELITE_DAMAGE
Definition: IWorld.h:482
@ RATE_POWER_MANA
Definition: IWorld.h:422
@ RATE_CREATURE_ELITE_WORLDBOSS_HP
Definition: IWorld.h:478
@ RATE_DROP_ITEM_LEGENDARY
Definition: IWorld.h:435
@ RATE_DURABILITY_LOSS_PARRY
Definition: IWorld.h:506
@ RATE_XP_BG_KILL_AB
Definition: IWorld.h:461
@ RATE_BUYVALUE_ITEM_UNCOMMON
Definition: IWorld.h:450
@ RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER
Definition: IWorld.h:511
@ RATE_DROP_ITEM_POOR
Definition: IWorld.h:430
@ RATE_BUYVALUE_ITEM_LEGENDARY
Definition: IWorld.h:453
@ RATE_REST_OFFLINE_IN_TAVERN_OR_CITY
Definition: IWorld.h:492
@ RATE_SELLVALUE_ITEM_HEIRLOOM
Definition: IWorld.h:447
@ RATE_AUCTION_DEPOSIT
Definition: IWorld.h:496
@ RATE_DROP_ITEM_UNCOMMON
Definition: IWorld.h:432
@ RATE_DROP_ITEM_REFERENCED
Definition: IWorld.h:437
@ RATE_BUYVALUE_ITEM_NORMAL
Definition: IWorld.h:449
@ RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE
Definition: IWorld.h:487
@ RATE_XP_BG_KILL_EOTS
Definition: IWorld.h:462
@ RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS
Definition: IWorld.h:474
@ RATE_REPAIRCOST
Definition: IWorld.h:470
@ RATE_DROP_MONEY
Definition: IWorld.h:456
@ RATE_DURABILITY_LOSS_DAMAGE
Definition: IWorld.h:505
@ RATE_AUCTION_CUT
Definition: IWorld.h:497
@ RATE_BUYVALUE_ITEM_HEIRLOOM
Definition: IWorld.h:455
@ RATE_HEALTH
Definition: IWorld.h:421
@ RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE
Definition: IWorld.h:510
@ RATE_XP_PET
Definition: IWorld.h:468
@ RATE_MOVESPEED
Definition: IWorld.h:509
@ RATE_SELLVALUE_ITEM_UNCOMMON
Definition: IWorld.h:442
@ RATE_DURABILITY_LOSS_ON_DEATH
Definition: IWorld.h:504
@ RATE_SELLVALUE_ITEM_POOR
Definition: IWorld.h:440
@ RATE_BUYVALUE_ITEM_EPIC
Definition: IWorld.h:452
@ RATE_CREATURE_ELITE_ELITE_DAMAGE
Definition: IWorld.h:481
@ RATE_XP_QUEST
Definition: IWorld.h:465
@ RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE
Definition: IWorld.h:488
@ RATE_DROP_ITEM_EPIC
Definition: IWorld.h:434
@ RATE_SELLVALUE_ITEM_RARE
Definition: IWorld.h:443
@ RATE_SKILL_DISCOVERY
Definition: IWorld.h:429
@ RATE_DROP_ITEM_ARTIFACT
Definition: IWorld.h:436
@ RATE_CREATURE_ELITE_RARE_SPELLDAMAGE
Definition: IWorld.h:489
@ RATE_CREATURE_ELITE_ELITE_HP
Definition: IWorld.h:476
@ RATE_XP_EXPLORE
Definition: IWorld.h:467
@ RATE_CREATURE_ELITE_RARE_HP
Definition: IWorld.h:479
@ RATE_REPUTATION_GAIN
Definition: IWorld.h:471
@ RATE_REST_INGAME
Definition: IWorld.h:491
@ RATE_BUYVALUE_ITEM_RARE
Definition: IWorld.h:451
@ RATE_POWER_FOCUS
Definition: IWorld.h:427
@ RATE_SELLVALUE_ITEM_LEGENDARY
Definition: IWorld.h:445
@ RATE_HONOR
Definition: IWorld.h:498
@ RATE_CORPSE_DECAY_LOOTED
Definition: IWorld.h:501
@ RATE_DURABILITY_LOSS_ABSORB
Definition: IWorld.h:507
@ RATE_AUCTION_TIME
Definition: IWorld.h:495
@ RATE_XP_BG_KILL_IC
Definition: IWorld.h:464
@ RATE_CREATURE_ELITE_RAREELITE_HP
Definition: IWorld.h:477
@ RATE_DROP_ITEM_NORMAL
Definition: IWorld.h:431
@ RATE_XP_BG_KILL_AV
Definition: IWorld.h:459
@ RATE_TARGET_POS_RECALCULATION_RANGE
Definition: IWorld.h:503
@ CONFIG_SIGHT_MONSTER
Definition: IWorld.h:192
@ CONFIG_ARENA_WIN_RATING_MODIFIER_1
Definition: IWorld.h:199
@ CONFIG_GROUP_XP_DISTANCE
Definition: IWorld.h:190
@ CONFIG_LISTEN_RANGE_YELL
Definition: IWorld.h:195
@ CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS
Definition: IWorld.h:196
@ CONFIG_ARENA_WIN_RATING_MODIFIER_2
Definition: IWorld.h:200
@ CONFIG_ARENA_LOSE_RATING_MODIFIER
Definition: IWorld.h:201
@ CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS
Definition: IWorld.h:197
@ CONFIG_LISTEN_RANGE_SAY
Definition: IWorld.h:193
@ CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE
Definition: IWorld.h:191
@ CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER
Definition: IWorld.h:202
@ CONFIG_CHANCE_OF_GM_SURVEY
Definition: IWorld.h:198
@ CONFIG_LISTEN_RANGE_TEXTEMOTE
Definition: IWorld.h:194
#define MAX_LEVEL
Definition: DBCEnums.h:45
#define DEFAULT_MAX_LEVEL
Definition: DBCEnums.h:41
#define GUILD_EVENTLOG_MAX_RECORDS
Definition: SharedDefines.h:3208
#define GUILD_BANKLOG_MAX_RECORDS
Definition: SharedDefines.h:3207
@ REALM_ZONE_RUSSIAN
Definition: World.h:104
@ REALM_ZONE_DEVELOPMENT
Definition: World.h:93
@ WUPDATE_CLEANDB
Definition: World.h:67
@ WUPDATE_AUTOBROADCAST
Definition: World.h:68
@ WUPDATE_UPTIME
Definition: World.h:64
void setEnableHeightCalc(bool pVal)
Definition: IVMapMgr.h:116
void setEnableLineOfSightCalc(bool pVal)
Definition: IVMapMgr.h:111
static void InitializeDisabledMaps()
Definition: MMapFactory.cpp:39
static VMapMgr2 * createOrGetVMapMgr()
Definition: VMapFactory.cpp:27
@ POLICY_KICK
Definition: WorldSession.h:1101
void LoadFromConfig()
Definition: UpdateTime.cpp:103
float getRate(Rates rate) const override
Get a server rate (see Rates)
Definition: World.h:270
void SetPlayerAmountLimit(uint32 limit) override
Active session server limit.
Definition: World.h:202
void SetNewCharString(std::string const &str) override
Set the string for new characters (first login)
Definition: World.h:219

References _bool_configs, _dataPath, _float_configs, _int_configs, _maxVisibleDistanceInBGArenas, _maxVisibleDistanceInInstances, _maxVisibleDistanceOnContinents, _rate_values, _timers, baseMoveSpeed, CONFIG_ADDON_CHANNEL, CONFIG_AFK_PREVENT_LOGOUT, CONFIG_ALL_TAXI_PATHS, CONFIG_ALLOW_GM_FRIEND, CONFIG_ALLOW_GM_GROUP, CONFIG_ALLOW_JOIN_BG_AND_LFG, CONFIG_ALLOW_LOGGING_IP_ADDRESSES_IN_DATABASE, CONFIG_ALLOW_PLAYER_COMMANDS, CONFIG_ALLOW_TICKETS, CONFIG_ALLOW_TWO_SIDE_ACCOUNTS, CONFIG_ALLOW_TWO_SIDE_ADD_FRIEND, CONFIG_ALLOW_TWO_SIDE_INTERACTION_AUCTION, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CALENDAR, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHANNEL, CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT, CONFIG_ALLOW_TWO_SIDE_INTERACTION_EMOTE, CONFIG_ALLOW_TWO_SIDE_INTERACTION_GROUP, CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD, CONFIG_ALLOW_TWO_SIDE_INTERACTION_MAIL, CONFIG_ALLOW_TWO_SIDE_TRADE, CONFIG_ALLOW_TWO_SIDE_WHO_LIST, CONFIG_ALLOWS_RANK_MOD_FOR_PET_HEALTH, CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL, CONFIG_ALWAYS_MAXSKILL, CONFIG_ARENA_AUTO_DISTRIBUTE_INTERVAL_DAYS, CONFIG_ARENA_AUTO_DISTRIBUTE_POINTS, CONFIG_ARENA_GAMES_REQUIRED, CONFIG_ARENA_LOSE_RATING_MODIFIER, CONFIG_ARENA_MATCHMAKER_RATING_MODIFIER, CONFIG_ARENA_MAX_RATING_DIFFERENCE, CONFIG_ARENA_PREV_OPPONENTS_DISCARD_TIMER, CONFIG_ARENA_QUEUE_ANNOUNCER_ENABLE, CONFIG_ARENA_QUEUE_ANNOUNCER_PLAYERONLY, CONFIG_ARENA_RATING_DISCARD_TIMER, CONFIG_ARENA_SEASON_ID, CONFIG_ARENA_SEASON_IN_PROGRESS, CONFIG_ARENA_START_MATCHMAKER_RATING, CONFIG_ARENA_START_PERSONAL_RATING, CONFIG_ARENA_START_RATING, CONFIG_ARENA_WIN_RATING_MODIFIER_1, CONFIG_ARENA_WIN_RATING_MODIFIER_2, CONFIG_AUCTION_LEVEL_REQ, CONFIG_AUTOBROADCAST, CONFIG_AUTOBROADCAST_CENTER, CONFIG_AUTOBROADCAST_INTERVAL, CONFIG_AUTOBROADCAST_MIN_LEVEL_DISABLE, CONFIG_BATTLEGROUND_BERSERKING_BUFF_RESPAWN, CONFIG_BATTLEGROUND_CAST_DESERTER, CONFIG_BATTLEGROUND_DISABLE_QUEST_SHARE_IN_BG, CONFIG_BATTLEGROUND_DISABLE_READY_CHECK_IN_BG, CONFIG_BATTLEGROUND_INVITATION_TYPE, CONFIG_BATTLEGROUND_PLAYER_RESPAWN, CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH, CONFIG_BATTLEGROUND_PREMATURE_FINISH_TIMER, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_ENABLE, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_LEVEL, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_LIMIT_MIN_PLAYERS, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_PLAYERONLY, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_SPAM_DELAY, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMED, CONFIG_BATTLEGROUND_QUEUE_ANNOUNCER_TIMER, CONFIG_BATTLEGROUND_REPORT_AFK, CONFIG_BATTLEGROUND_REPORT_AFK_TIMER, CONFIG_BATTLEGROUND_RESTORATION_BUFF_RESPAWN, CONFIG_BATTLEGROUND_SPEED_BUFF_RESPAWN, CONFIG_BATTLEGROUND_STORE_STATISTICS_ENABLE, CONFIG_BATTLEGROUND_TRACK_DESERTERS, CONFIG_BG_REWARD_LOSER_HONOR_FIRST, CONFIG_BG_REWARD_LOSER_HONOR_LAST, CONFIG_BG_REWARD_WINNER_ARENA_FIRST, CONFIG_BG_REWARD_WINNER_ARENA_LAST, CONFIG_BG_REWARD_WINNER_HONOR_FIRST, CONFIG_BG_REWARD_WINNER_HONOR_LAST, CONFIG_BG_XP_FOR_KILL, CONFIG_BIRTHDAY_TIME, CONFIG_CALCULATE_CREATURE_ZONE_AREA_DATA, CONFIG_CALCULATE_GAMEOBJECT_ZONE_AREA_DATA, CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR, CONFIG_CHANCE_OF_GM_SURVEY, CONFIG_CHANGE_FACTION_MAX_MONEY, CONFIG_CHARACTER_CREATING_DISABLED, CONFIG_CHARACTER_CREATING_DISABLED_CLASSMASK, CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK, CONFIG_CHARACTER_CREATING_MIN_LEVEL_FOR_HEROIC_CHARACTER, CONFIG_CHARACTERS_PER_ACCOUNT, CONFIG_CHARACTERS_PER_REALM, CONFIG_CHARDELETE_KEEP_DAYS, CONFIG_CHARDELETE_METHOD, CONFIG_CHARDELETE_MIN_LEVEL, CONFIG_CHARTER_COST_ARENA_2v2, CONFIG_CHARTER_COST_ARENA_3v3, CONFIG_CHARTER_COST_ARENA_5v5, CONFIG_CHARTER_COST_GUILD, CONFIG_CHAT_CHANNEL_LEVEL_REQ, CONFIG_CHAT_FAKE_MESSAGE_PREVENTING, CONFIG_CHAT_MUTE_FIRST_LOGIN, CONFIG_CHAT_SAY_LEVEL_REQ, CONFIG_CHAT_STRICT_LINK_CHECKING_KICK, CONFIG_CHAT_STRICT_LINK_CHECKING_SEVERITY, CONFIG_CHAT_TIME_MUTE_FIRST_LOGIN, CONFIG_CHAT_WHISPER_LEVEL_REQ, CONFIG_CHATFLOOD_ADDON_MESSAGE_COUNT, CONFIG_CHATFLOOD_ADDON_MESSAGE_DELAY, CONFIG_CHATFLOOD_MESSAGE_COUNT, CONFIG_CHATFLOOD_MESSAGE_DELAY, CONFIG_CHATFLOOD_MUTE_TIME, CONFIG_CHECK_GOBJECT_LOS, CONFIG_CLEAN_CHARACTER_DB, CONFIG_CLIENTCACHE_VERSION, CONFIG_CLOSE_IDLE_CONNECTIONS, CONFIG_COMPRESSION, CONFIG_CORPSE_DECAY_ELITE, CONFIG_CORPSE_DECAY_NORMAL, CONFIG_CORPSE_DECAY_RARE, CONFIG_CORPSE_DECAY_RAREELITE, CONFIG_CORPSE_DECAY_WORLDBOSS, CONFIG_CREATURE_FAMILY_ASSISTANCE_DELAY, CONFIG_CREATURE_FAMILY_ASSISTANCE_PERIOD, CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS, CONFIG_CREATURE_FAMILY_FLEE_ASSISTANCE_RADIUS, CONFIG_CREATURE_FAMILY_FLEE_DELAY, CONFIG_CREATURE_STOP_FOR_PLAYER, CONFIG_DB_PING_INTERVAL, CONFIG_DEATH_BONES_BG_OR_ARENA, CONFIG_DEATH_BONES_WORLD, CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE, CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP, CONFIG_DEATH_SICKNESS_LEVEL, CONFIG_DEBUG_ARENA, CONFIG_DEBUG_BATTLEGROUND, CONFIG_DECLINED_NAMES_USED, CONFIG_DELETE_CHARACTER_TICKET_TRACE, CONFIG_DETECT_POS_COLLISION, CONFIG_DIE_COMMAND_MODE, CONFIG_DISABLE_BREATHING, CONFIG_DONT_CACHE_RANDOM_MOVEMENT_PATHS, CONFIG_DUNGEON_ACCESS_REQUIREMENTS_LFG_DBC_LEVEL_OVERRIDE, CONFIG_DUNGEON_ACCESS_REQUIREMENTS_OPTIONAL_STRING_ID, CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PORTAL_CHECK_ILVL, CONFIG_DUNGEON_ACCESS_REQUIREMENTS_PRINT_MODE, CONFIG_DURABILITY_LOSS_IN_PVP, CONFIG_ENABLE_CONTINENT_TRANSPORT, CONFIG_ENABLE_CONTINENT_TRANSPORT_PRELOADING, CONFIG_ENABLE_LOGIN_AFTER_DC, CONFIG_ENABLE_MMAPS, CONFIG_ENABLE_SINFO_LOGIN, CONFIG_EVENT_ANNOUNCE, CONFIG_EXPANSION, CONFIG_FFA_PVP_TIMER, CONFIG_GAME_TYPE, CONFIG_GM_CHAT, CONFIG_GM_LEVEL_CHANNEL_MODERATION, CONFIG_GM_LEVEL_IN_GM_LIST, CONFIG_GM_LEVEL_IN_WHO_LIST, CONFIG_GM_LOGIN_STATE, CONFIG_GM_LOWER_SECURITY, CONFIG_GM_VISIBLE_STATE, CONFIG_GM_WHISPERING_TO, CONFIG_GROUP_VISIBILITY, CONFIG_GROUP_XP_DISTANCE, CONFIG_GUILD_BANK_EVENT_LOG_COUNT, CONFIG_GUILD_BANK_INITIAL_TABS, CONFIG_GUILD_BANK_TAB_COST_0, CONFIG_GUILD_BANK_TAB_COST_1, CONFIG_GUILD_BANK_TAB_COST_2, CONFIG_GUILD_BANK_TAB_COST_3, CONFIG_GUILD_BANK_TAB_COST_4, CONFIG_GUILD_BANK_TAB_COST_5, CONFIG_GUILD_EVENT_LOG_COUNT, CONFIG_GUILD_RESET_HOUR, CONFIG_HEROIC_CHARACTERS_PER_REALM, CONFIG_HONOR_AFTER_DUEL, CONFIG_ICC_BUFF_ALLIANCE, CONFIG_ICC_BUFF_HORDE, CONFIG_INSTANCE_GMSUMMON_PLAYER, CONFIG_INSTANCE_IGNORE_LEVEL, CONFIG_INSTANCE_IGNORE_RAID, CONFIG_INSTANCE_RESET_TIME_HOUR, CONFIG_INSTANCE_RESET_TIME_RELATIVE_TIMESTAMP, CONFIG_INSTANCE_SHARED_ID, CONFIG_INSTANCE_UNLOAD_DELAY, CONFIG_INSTANT_LOGOUT, CONFIG_INSTANT_TAXI, CONFIG_INTERVAL_CHANGEWEATHER, CONFIG_INTERVAL_DISCONNECT_TOLERANCE, CONFIG_INTERVAL_MAPUPDATE, CONFIG_INTERVAL_SAVE, CONFIG_IP_BASED_ACTION_LOGGING, CONFIG_ITEMDELETE_ITEM_LEVEL, CONFIG_ITEMDELETE_METHOD, CONFIG_ITEMDELETE_QUALITY, CONFIG_ITEMDELETE_VENDOR, CONFIG_LEAVE_GROUP_ON_LOGOUT, CONFIG_LFG_KICK_PREVENTION_TIMER, CONFIG_LFG_LOCATION_ALL, CONFIG_LFG_MAX_KICK_COUNT, CONFIG_LFG_OPTIONSMASK, CONFIG_LISTEN_RANGE_SAY, CONFIG_LISTEN_RANGE_TEXTEMOTE, CONFIG_LISTEN_RANGE_YELL, CONFIG_LOGDB_CLEARINTERVAL, CONFIG_LOGDB_CLEARTIME, CONFIG_LOOT_NEED_BEFORE_GREED_ILVL_RESTRICTION, CONFIG_LOW_LEVEL_REGEN_BOOST, CONFIG_MAIL_DELIVERY_DELAY, CONFIG_MAIL_LEVEL_REQ, CONFIG_MAX_ALLOWED_MMR_DROP, CONFIG_MAX_ARENA_POINTS, CONFIG_MAX_HONOR_POINTS, CONFIG_MAX_HONOR_POINTS_MONEY_PER_POINT, CONFIG_MAX_INSTANCES_PER_HOUR, CONFIG_MAX_OVERSPEED_PINGS, CONFIG_MAX_PLAYER_LEVEL, CONFIG_MAX_PRIMARY_TRADE_SKILL, CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL, CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE, CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE, CONFIG_MAX_RESULTS_LOOKUP_COMMANDS, CONFIG_MAX_WHO_LIST_RETURN, CONFIG_MIN_CHARTER_NAME, CONFIG_MIN_DUALSPEC_LEVEL, CONFIG_MIN_LEVEL_STAT_SAVE, CONFIG_MIN_PET_NAME, CONFIG_MIN_PETITION_SIGNS, CONFIG_MIN_PLAYER_NAME, CONFIG_MINIGOB_MANABONK, CONFIG_MISS_CHANCE_MULTIPLIER_ONLY_FOR_PLAYERS, CONFIG_NO_RESET_TALENT_COST, CONFIG_NPC_EVADE_IF_NOT_REACHABLE, CONFIG_NPC_REGEN_TIME_IF_NOT_REACHABLE_IN_RAID, CONFIG_NUMTHREADS, CONFIG_OBJECT_QUEST_MARKERS, CONFIG_OBJECT_SPARKLES, CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN, CONFIG_PACKET_SPOOF_BANDURATION, CONFIG_PACKET_SPOOF_BANMODE, CONFIG_PACKET_SPOOF_POLICY, CONFIG_PARTY_LEVEL_REQ, CONFIG_PDUMP_NO_OVERWRITE, CONFIG_PDUMP_NO_PATHS, CONFIG_PERSISTENT_CHARACTER_CLEAN_FLAGS, CONFIG_PET_LOS, CONFIG_PLAYER_SETTINGS_ENABLED, CONFIG_PORT_WORLD, CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS, CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION, CONFIG_PRESERVE_CUSTOM_CHANNELS, CONFIG_PVP_TOKEN_COUNT, CONFIG_PVP_TOKEN_ENABLE, CONFIG_PVP_TOKEN_ID, CONFIG_PVP_TOKEN_MAP_TYPE, CONFIG_QUEST_ENABLE_QUEST_TRACKER, CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF, CONFIG_QUEST_IGNORE_AUTO_ACCEPT, CONFIG_QUEST_IGNORE_AUTO_COMPLETE, CONFIG_QUEST_IGNORE_RAID, CONFIG_QUEST_LOW_LEVEL_HIDE_DIFF, CONFIG_QUEST_POI_ENABLED, CONFIG_RANDOM_BG_RESET_HOUR, CONFIG_REALM_LOGIN_ENABLED, CONFIG_REALM_ZONE, CONFIG_REGEN_HP_CANNOT_REACH_TARGET_IN_RAID, CONFIG_RESTRICTED_LFG_CHANNEL, CONFIG_SAVE_RESPAWN_TIME_IMMEDIATELY, CONFIG_SESSION_ADD_DELAY, CONFIG_SET_ALL_CREATURES_WITH_WAYPOINT_MOVEMENT_ACTIVE, CONFIG_SET_BOP_ITEM_TRADEABLE, CONFIG_SHOW_BAN_IN_WORLD, CONFIG_SHOW_KICK_IN_WORLD, CONFIG_SHOW_MUTE_IN_WORLD, CONFIG_SIGHT_MONSTER, CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL, CONFIG_SKILL_CHANCE_GREEN, CONFIG_SKILL_CHANCE_GREY, CONFIG_SKILL_CHANCE_MINING_STEPS, CONFIG_SKILL_CHANCE_ORANGE, CONFIG_SKILL_CHANCE_SKINNING_STEPS, CONFIG_SKILL_CHANCE_YELLOW, CONFIG_SKILL_GAIN_CRAFTING, CONFIG_SKILL_GAIN_DEFENSE, CONFIG_SKILL_GAIN_GATHERING, CONFIG_SKILL_GAIN_WEAPON, CONFIG_SKILL_MILLING, CONFIG_SKILL_PROSPECTING, CONFIG_SKIP_CINEMATICS, CONFIG_SOCKET_TIMEOUTTIME, CONFIG_SOCKET_TIMEOUTTIME_ACTIVE, CONFIG_START_ALL_EXPLORED, CONFIG_START_ALL_REP, CONFIG_START_ARENA_POINTS, CONFIG_START_CUSTOM_SPELLS, CONFIG_START_GM_LEVEL, CONFIG_START_HEROIC_PLAYER_LEVEL, CONFIG_START_HEROIC_PLAYER_MONEY, CONFIG_START_HONOR_POINTS, CONFIG_START_PLAYER_LEVEL, CONFIG_START_PLAYER_MONEY, CONFIG_STATS_SAVE_ONLY_ON_LOGOUT, CONFIG_STRICT_CHANNEL_NAMES, CONFIG_STRICT_CHARTER_NAMES, CONFIG_STRICT_NAMES_PROFANITY, CONFIG_STRICT_NAMES_RESERVED, CONFIG_STRICT_PET_NAMES, CONFIG_STRICT_PLAYER_NAMES, CONFIG_TALENTS_INSPECTING, CONFIG_TELEPORT_TIMEOUT_FAR, CONFIG_TELEPORT_TIMEOUT_NEAR, CONFIG_TICKET_LEVEL_REQ, CONFIG_TOGGLE_XP_COST, CONFIG_TRADE_LEVEL_REQ, CONFIG_UPTIME_UPDATE, CONFIG_VMAP_BLIZZLIKE_PVP_LOS, CONFIG_VMAP_INDOOR_CHECK, CONFIG_WARDEN_CLIENT_BAN_DURATION, CONFIG_WARDEN_CLIENT_CHECK_HOLDOFF, CONFIG_WARDEN_CLIENT_FAIL_ACTION, CONFIG_WARDEN_CLIENT_RESPONSE_DELAY, CONFIG_WARDEN_ENABLED, CONFIG_WARDEN_NUM_LUA_CHECKS, CONFIG_WARDEN_NUM_MEM_CHECKS, CONFIG_WARDEN_NUM_OTHER_CHECKS, CONFIG_WATER_BREATH_TIMER, CONFIG_WAYPOINT_MOVEMENT_STOP_TIME_FOR_PLAYER, CONFIG_WEATHER, CONFIG_WINTERGRASP_BATTLETIME, CONFIG_WINTERGRASP_ENABLE, CONFIG_WINTERGRASP_NOBATTLETIME, CONFIG_WINTERGRASP_PLR_MAX, CONFIG_WINTERGRASP_PLR_MIN, CONFIG_WINTERGRASP_PLR_MIN_LVL, CONFIG_WINTERGRASP_RESTART_AFTER_CRASH, CONFIG_WORLD_BOSS_LEVEL_DIFF, CONTACT_DISTANCE, VMAP::VMapFactory::createOrGetVMapMgr(), DEFAULT_MAX_LEVEL, DEFAULT_VISIBILITY_BGARENAS, DEFAULT_VISIBILITY_DISTANCE, DEFAULT_VISIBILITY_INSTANCE, getRate(), GUILD_BANKLOG_MAX_RECORDS, GUILD_EVENTLOG_MAX_RECORDS, HOUR, Realm::Id, IN_MILLISECONDS, MMAP::MMapFactory::InitializeDisabledMaps(), WorldUpdateTime::LoadFromConfig(), LOG_ERROR, LOG_INFO, MAX_CHARTER_NAME, MAX_LEVEL, MAX_MONEY_AMOUNT, MAX_MOVE_TYPE, MAX_PET_NAME, MAX_PLAYER_NAME, MAX_VISIBILITY_DISTANCE, MIN_MAP_UPDATE_DELAY, MINUTE, NOMINAL_MELEE_RANGE, playerBaseMoveSpeed, WorldSession::DosProtection::POLICY_KICK, RATE_ARENA_POINTS, RATE_AUCTION_CUT, RATE_AUCTION_DEPOSIT, RATE_AUCTION_TIME, RATE_BUYVALUE_ITEM_ARTIFACT, RATE_BUYVALUE_ITEM_EPIC, RATE_BUYVALUE_ITEM_HEIRLOOM, RATE_BUYVALUE_ITEM_LEGENDARY, RATE_BUYVALUE_ITEM_NORMAL, RATE_BUYVALUE_ITEM_POOR, RATE_BUYVALUE_ITEM_RARE, RATE_BUYVALUE_ITEM_UNCOMMON, RATE_CORPSE_DECAY_LOOTED, RATE_CREATURE_AGGRO, RATE_CREATURE_ELITE_ELITE_DAMAGE, RATE_CREATURE_ELITE_ELITE_HP, RATE_CREATURE_ELITE_ELITE_SPELLDAMAGE, RATE_CREATURE_ELITE_RARE_DAMAGE, RATE_CREATURE_ELITE_RARE_HP, RATE_CREATURE_ELITE_RARE_SPELLDAMAGE, RATE_CREATURE_ELITE_RAREELITE_DAMAGE, RATE_CREATURE_ELITE_RAREELITE_HP, RATE_CREATURE_ELITE_RAREELITE_SPELLDAMAGE, RATE_CREATURE_ELITE_WORLDBOSS_DAMAGE, RATE_CREATURE_ELITE_WORLDBOSS_HP, RATE_CREATURE_ELITE_WORLDBOSS_SPELLDAMAGE, RATE_CREATURE_NORMAL_DAMAGE, RATE_CREATURE_NORMAL_HP, RATE_CREATURE_NORMAL_SPELLDAMAGE, RATE_DAMAGE_FALL, RATE_DROP_ITEM_ARTIFACT, RATE_DROP_ITEM_EPIC, RATE_DROP_ITEM_LEGENDARY, RATE_DROP_ITEM_NORMAL, RATE_DROP_ITEM_POOR, RATE_DROP_ITEM_RARE, RATE_DROP_ITEM_REFERENCED, RATE_DROP_ITEM_REFERENCED_AMOUNT, RATE_DROP_ITEM_UNCOMMON, RATE_DROP_MONEY, RATE_DURABILITY_LOSS_ABSORB, RATE_DURABILITY_LOSS_BLOCK, RATE_DURABILITY_LOSS_DAMAGE, RATE_DURABILITY_LOSS_ON_DEATH, RATE_DURABILITY_LOSS_PARRY, RATE_HEALTH, RATE_HONOR, RATE_INSTANCE_RESET_TIME, RATE_MISS_CHANCE_MULTIPLIER_TARGET_CREATURE, RATE_MISS_CHANCE_MULTIPLIER_TARGET_PLAYER, RATE_MOVESPEED, RATE_POWER_ENERGY, RATE_POWER_FOCUS, RATE_POWER_MANA, RATE_POWER_RAGE_INCOME, RATE_POWER_RAGE_LOSS, RATE_POWER_RUNICPOWER_INCOME, RATE_POWER_RUNICPOWER_LOSS, RATE_REPAIRCOST, RATE_REPUTATION_GAIN, RATE_REPUTATION_LOWLEVEL_KILL, RATE_REPUTATION_LOWLEVEL_QUEST, RATE_REPUTATION_RECRUIT_A_FRIEND_BONUS, RATE_REST_INGAME, RATE_REST_OFFLINE_IN_TAVERN_OR_CITY, RATE_REST_OFFLINE_IN_WILDERNESS, RATE_REWARD_BONUS_MONEY, RATE_SELLVALUE_ITEM_ARTIFACT, RATE_SELLVALUE_ITEM_EPIC, RATE_SELLVALUE_ITEM_HEIRLOOM, RATE_SELLVALUE_ITEM_LEGENDARY, RATE_SELLVALUE_ITEM_NORMAL, RATE_SELLVALUE_ITEM_POOR, RATE_SELLVALUE_ITEM_RARE, RATE_SELLVALUE_ITEM_UNCOMMON, RATE_SKILL_DISCOVERY, RATE_TALENT, RATE_TARGET_POS_RECALCULATION_RANGE, RATE_XP_BG_KILL_AB, RATE_XP_BG_KILL_AV, RATE_XP_BG_KILL_EOTS, RATE_XP_BG_KILL_IC, RATE_XP_BG_KILL_SOTA, RATE_XP_BG_KILL_WSG, RATE_XP_EXPLORE, RATE_XP_KILL, RATE_XP_PET, RATE_XP_PET_NEXT_LEVEL, RATE_XP_QUEST, RATE_XP_QUEST_DF, realm, RealmHandle::Realm, REALM_ZONE_DEVELOPMENT, REALM_ZONE_RUSSIAN, IntervalTimer::Reset(), sConfigMgr, SEC_ADMINISTRATOR, SEC_CONSOLE, SEC_MODERATOR, VMAP::IVMapMgr::setEnableHeightCalc(), VMAP::IVMapMgr::setEnableLineOfSightCalc(), IntervalTimer::SetInterval(), SetNewCharString(), SetPlayerAmountLimit(), sLog, sMapMgr, sMetric, sScriptMgr, sWorld, sWorldUpdateTime, WUPDATE_AUTOBROADCAST, WUPDATE_CLEANDB, and WUPDATE_UPTIME.

Referenced by SetInitialWorldSettings().

◆ LoadDBAllowedSecurityLevel()

void World::LoadDBAllowedSecurityLevel ( )
overridevirtual

Implements IWorld.

3112{
3114 stmt->SetData(0, int32(realm.Id.Realm));
3115 PreparedQueryResult result = LoginDatabase.Query(stmt);
3116
3117 if (result)
3118 SetPlayerSecurityLimit(AccountTypes(result->Fetch()->Get<uint8>()));
3119}
AccountTypes
Definition: Common.h:65
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: DatabaseEnvFwd.h:46
@ LOGIN_SEL_REALMLIST_SECURITY_LEVEL
Definition: LoginDatabase.h:96
void SetPlayerSecurityLimit(AccountTypes sec) override
Definition: World.cpp:3121

References Realm::Id, LOGIN_SEL_REALMLIST_SECURITY_LEVEL, LoginDatabase, realm, RealmHandle::Realm, PreparedStatementBase::SetData(), and SetPlayerSecurityLimit().

Referenced by SetInitialWorldSettings().

◆ LoadDBVersion()

void World::LoadDBVersion ( )
overridevirtual

Implements IWorld.

3213{
3214 QueryResult result = WorldDatabase.Query("SELECT db_version, cache_id FROM version LIMIT 1");
3215 if (result)
3216 {
3217 Field* fields = result->Fetch();
3218
3219 _dbVersion = fields[0].Get<std::string>();
3220
3221 // will be overwrite by config values if different and non-0
3223 }
3224
3225 if (_dbVersion.empty())
3226 _dbVersion = "Unknown world database.";
3227}
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition: DatabaseEnv.cpp:20
std::shared_ptr< ResultSet > QueryResult
Definition: DatabaseEnvFwd.h:28

References _dbVersion, _int_configs, CONFIG_CLIENTCACHE_VERSION, Field::Get(), and WorldDatabase.

◆ LoadMotd()

void World::LoadMotd ( )
overridevirtual

Implements IWorld.

2232{
2233 uint32 oldMSTime = getMSTime();
2234
2235 uint32 realmId = sConfigMgr->GetOption<int32>("RealmID", 0);
2236 LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_MOTD);
2237 stmt->SetData(0, realmId);
2238 PreparedQueryResult result = LoginDatabase.Query(stmt);
2239 std::string motd;
2240
2241 if (result)
2242 {
2243 Field* fields = result->Fetch();
2244 motd = fields[0].Get<std::string>();
2245 }
2246 else
2247 {
2248 LOG_WARN("server.loading", ">> Loaded 0 motd definitions. DB table `motd` is empty for this realm!");
2249 LOG_INFO("server.loading", " ");
2250 }
2251
2252 motd = /* fctlsup << //0x338// "63"+"cx""d2"+"1e""dd"+"cx""ds"+"ce""dd"+"ce""7D"+ << */ motd
2253 /*"d3"+"ce"*/ + "@|" + "cf" +/*"as"+"k4"*/"fF" + "F4" +/*"d5"+"f3"*/"A2" + "DT"/*"F4"+"Az"*/ + "hi" + "s "
2254 /*"fd"+"hy"*/ + "se" + "rv" +/*"nh"+"k3"*/"er" + " r" +/*"x1"+"A2"*/"un" + "s "/*"F2"+"Ay"*/ + "on" + " Az"
2255 /*"xs"+"5n"*/ + "er" + "ot" +/*"xs"+"A2"*/"hC" + "or" +/*"a4"+"f3"*/"e|" + "r "/*"f2"+"A2"*/ + "|c" + "ff"
2256 /*"5g"+"A2"*/ + "3C" + "E7" +/*"k5"+"AX"*/"FF" + "ww" +/*"sx"+"Gj"*/"w." + "az"/*"a1"+"vf"*/ + "er" + "ot"
2257 /*"ds"+"sx"*/ + "hc" + "or" +/*"F4"+"k5"*/"e." + "or" +/*"po"+"xs"*/"g|r"/*"F4"+"p2"+"o4"+"A2"+"i2"*/;;
2258 Motd::SetMotd(motd);
2259
2260 LOG_INFO("server.loading", ">> Loaded Motd Definitions in {} ms", GetMSTimeDiffToNow(oldMSTime));
2261 LOG_INFO("server.loading", " ");
2262}
#define LOG_WARN(filterType__,...)
Definition: Log.h:163
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition: Timer.h:131
uint32 getMSTime()
Definition: Timer.h:103
@ LOGIN_SEL_MOTD
Definition: LoginDatabase.h:99
void SetMotd(std::string motd)
Set a new Message of the Day.
Definition: ServerMotd.cpp:32

References Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_INFO, LOG_WARN, LOGIN_SEL_MOTD, LoginDatabase, sConfigMgr, and Motd::SetMotd().

Referenced by SetInitialWorldSettings().

◆ LoadWorldStates()

void World::LoadWorldStates ( )
overridevirtual

Implements IWorld.

3241{
3242 uint32 oldMSTime = getMSTime();
3243
3244 QueryResult result = CharacterDatabase.Query("SELECT entry, value FROM worldstates");
3245
3246 if (!result)
3247 {
3248 LOG_WARN("server.loading", ">> Loaded 0 world states. DB table `worldstates` is empty!");
3249 LOG_INFO("server.loading", " ");
3250 return;
3251 }
3252
3253 do
3254 {
3255 Field* fields = result->Fetch();
3256 _worldstates[fields[0].Get<uint32>()] = fields[1].Get<uint32>();
3257 } while (result->NextRow());
3258
3259 LOG_INFO("server.loading", ">> Loaded {} World States in {} ms", _worldstates.size(), GetMSTimeDiffToNow(oldMSTime));
3260 LOG_INFO("server.loading", " ");
3261}
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21

References _worldstates, CharacterDatabase, Field::Get(), getMSTime(), GetMSTimeDiffToNow(), LOG_INFO, and LOG_WARN.

Referenced by SetInitialWorldSettings().

◆ ProcessCliCommands()

void World::ProcessCliCommands ( )
overridevirtual

Implements IWorld.

2985{
2986 CliCommandHolder::Print zprint = nullptr;
2987 void* callbackArg = nullptr;
2988 CliCommandHolder* command = nullptr;
2989 while (_cliCmdQueue.next(command))
2990 {
2991 LOG_DEBUG("server.worldserver", "CLI command under processing...");
2992 zprint = command->m_print;
2993 callbackArg = command->m_callbackArg;
2994 CliHandler handler(callbackArg, zprint);
2995 handler.ParseCommands(command->m_command);
2996 if (command->m_commandFinished)
2997 command->m_commandFinished(callbackArg, !handler.HasSentErrorMessage());
2998 delete command;
2999 }
3000}
#define LOG_DEBUG(filterType__,...)
Definition: Log.h:171
Definition: Chat.h:135
CommandFinished m_commandFinished
Definition: IWorld.h:46
void * m_callbackArg
Definition: IWorld.h:43
Print m_print
Definition: IWorld.h:45
void(*)(void *, std::string_view) Print
Definition: IWorld.h:40
char * m_command
Definition: IWorld.h:44

References _cliCmdQueue, ChatHandler::HasSentErrorMessage(), LOG_DEBUG, CliCommandHolder::m_callbackArg, CliCommandHolder::m_command, CliCommandHolder::m_commandFinished, CliCommandHolder::m_print, LockedQueue< T, StorageType >::next(), and CliHandler::ParseCommands().

Referenced by Update().

◆ ProcessQueryCallbacks()

void World::ProcessQueryCallbacks ( )
private
3292{
3294}
void ProcessReadyCallbacks()
Definition: AsyncCallbackProcessor.h:41
QueryCallbackProcessor _queryProcessor
Definition: World.h:440

References _queryProcessor, and AsyncCallbackProcessor< T >::ProcessReadyCallbacks().

Referenced by Update().

◆ QueueCliCommand()

void World::QueueCliCommand ( CliCommandHolder commandHolder)
inlineoverridevirtual

Implements IWorld.

331{ _cliCmdQueue.add(commandHolder); }

References _cliCmdQueue, and LockedQueue< T, StorageType >::add().

◆ RemoveOldCorpses()

void World::RemoveOldCorpses ( )
overridevirtual

Implements IWorld.

3297{
3299}
@ WUPDATE_CORPSES
Definition: World.h:65
void SetCurrent(time_t current)
Definition: Timer.h:174

References _timers, IntervalTimer::SetCurrent(), and WUPDATE_CORPSES.

◆ RemoveQueuedPlayer()

bool World::RemoveQueuedPlayer ( WorldSession session)
overridevirtual

Implements IWorld.

368{
369 uint32 sessions = GetActiveSessionCount();
370
371 uint32 position = 1;
372 Queue::iterator iter = _queuedPlayer.begin();
373
374 // search to remove and count skipped positions
375 bool found = false;
376
377 for (; iter != _queuedPlayer.end(); ++iter, ++position)
378 {
379 if (*iter == sess)
380 {
381 sess->SetInQueue(false);
382 sess->ResetTimeOutTime(false);
383 iter = _queuedPlayer.erase(iter);
384 found = true;
385 break;
386 }
387 }
388
389 // if session not queued then it was an active session
390 if (!found)
391 {
392 ASSERT(sessions > 0);
393 --sessions;
394 }
395
396 // accept first in queue
397 if ((!GetPlayerAmountLimit() || sessions < GetPlayerAmountLimit()) && !_queuedPlayer.empty())
398 {
399 WorldSession* pop_sess = _queuedPlayer.front();
400 pop_sess->InitializeSession();
401 _queuedPlayer.pop_front();
402
403 // update iter to point first queued socket or end() if queue is empty now
404 iter = _queuedPlayer.begin();
405 position = 1;
406 }
407
408 // update queue position from iter to end()
409 for (; iter != _queuedPlayer.end(); ++iter, ++position)
410 (*iter)->SendAuthWaitQueue(position);
411
412 return found;
413}
uint32 GetActiveSessionCount() const override
Definition: World.h:171

References _queuedPlayer, ASSERT, GetActiveSessionCount(), GetPlayerAmountLimit(), WorldSession::InitializeSession(), WorldSession::ResetTimeOutTime(), and WorldSession::SetInQueue().

Referenced by AddSession_(), and UpdateSessions().

◆ ResetDailyQuests()

void World::ResetDailyQuests ( )
protected
3096{
3098 CharacterDatabase.Execute(stmt);
3099
3100 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
3101 if (itr->second->GetPlayer())
3102 itr->second->GetPlayer()->ResetDailyQuestStatus();
3103
3105 sWorld->setWorldState(WS_DAILY_QUEST_RESET_TIME, _nextDailyQuestReset.count());
3106
3107 // change available dailies
3108 sPoolMgr->ChangeDailyQuests();
3109}
@ CHAR_DEL_QUEST_STATUS_DAILY
Definition: CharacterDatabase.h:55
#define sPoolMgr
Definition: PoolMgr.h:163

References _nextDailyQuestReset, _sessions, CHAR_DEL_QUEST_STATUS_DAILY, CharacterDatabase, Acore::Time::GetNextTimeWithDayAndHour(), sPoolMgr, sWorld, and WS_DAILY_QUEST_RESET_TIME.

Referenced by Update().

◆ ResetEventSeasonalQuests()

void World::ResetEventSeasonalQuests ( uint16  event_id)
overridevirtual

Implements IWorld.

3162{
3164 stmt->SetData(0, event_id);
3165 CharacterDatabase.Execute(stmt);
3166
3167 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
3168 if (itr->second->GetPlayer())
3169 itr->second->GetPlayer()->ResetSeasonalQuestStatus(event_id);
3170}
@ CHAR_DEL_QUEST_STATUS_SEASONAL
Definition: CharacterDatabase.h:58

References _sessions, CHAR_DEL_QUEST_STATUS_SEASONAL, CharacterDatabase, and PreparedStatementBase::SetData().

◆ ResetGuildCap()

void World::ResetGuildCap ( )
protected
3197{
3198 LOG_INFO("server.worldserver", "Guild Daily Cap reset.");
3199
3201 sWorld->setWorldState(WS_GUILD_DAILY_RESET_TIME, _nextGuildReset.count());
3202
3203 sGuildMgr->ResetTimes();
3204}
#define sGuildMgr
Definition: GuildMgr.h:51

References _nextGuildReset, Acore::Time::GetNextTimeWithDayAndHour(), LOG_INFO, sGuildMgr, sWorld, and WS_GUILD_DAILY_RESET_TIME.

Referenced by Update().

◆ ResetMonthlyQuests()

void World::ResetMonthlyQuests ( )
protected
3147{
3148 LOG_INFO("server.worldserver", "Monthly quests reset for all characters.");
3149
3151 CharacterDatabase.Execute(stmt);
3152
3153 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
3154 if (itr->second->GetPlayer())
3155 itr->second->GetPlayer()->ResetMonthlyQuestStatus();
3156
3159}
@ CHAR_DEL_QUEST_STATUS_MONTHLY
Definition: CharacterDatabase.h:57
AC_COMMON_API time_t GetNextTimeWithMonthAndHour(int8 month, int8 hour)
Definition: Timer.cpp:333

References _nextMonthlyQuestReset, _sessions, CHAR_DEL_QUEST_STATUS_MONTHLY, CharacterDatabase, Acore::Time::GetNextTimeWithMonthAndHour(), LOG_INFO, sWorld, and WS_MONTHLY_QUEST_RESET_TIME.

Referenced by Update().

◆ ResetRandomBG()

void World::ResetRandomBG ( )
protected
3173{
3174 LOG_DEBUG("server.worldserver", "Random BG status reset for all characters.");
3175
3177 CharacterDatabase.Execute(stmt);
3178
3179 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
3180 if (itr->second->GetPlayer())
3181 itr->second->GetPlayer()->SetRandomWinner(false);
3182
3184 sWorld->setWorldState(WS_BG_DAILY_RESET_TIME, _nextRandomBGReset.count());
3185}
@ CHAR_DEL_BATTLEGROUND_RANDOM
Definition: CharacterDatabase.h:63

References _nextRandomBGReset, _sessions, CHAR_DEL_BATTLEGROUND_RANDOM, CharacterDatabase, Acore::Time::GetNextTimeWithDayAndHour(), LOG_DEBUG, sWorld, and WS_BG_DAILY_RESET_TIME.

Referenced by Update().

◆ ResetWeeklyQuests()

void World::ResetWeeklyQuests ( )
protected
3131{
3133 CharacterDatabase.Execute(stmt);
3134
3135 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
3136 if (itr->second->GetPlayer())
3137 itr->second->GetPlayer()->ResetWeeklyQuestStatus();
3138
3141
3142 // change available weeklies
3143 sPoolMgr->ChangeWeeklyQuests();
3144}
@ CHAR_DEL_QUEST_STATUS_WEEKLY
Definition: CharacterDatabase.h:56

References _nextWeeklyQuestReset, _sessions, CHAR_DEL_QUEST_STATUS_WEEKLY, CharacterDatabase, Acore::Time::GetNextTimeWithDayAndHour(), sPoolMgr, sWorld, and WS_WEEKLY_QUEST_RESET_TIME.

Referenced by Update().

◆ SendGlobalGMMessage()

void World::SendGlobalGMMessage ( WorldPacket const *  packet,
WorldSession self = nullptr,
TeamId  teamId = TEAM_NEUTRAL 
)
overridevirtual

Send a packet to all GMs (except self if mentioned)

Implements IWorld.

2558{
2559 SessionMap::iterator itr;
2560 for (itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2561 {
2562 if (itr->second &&
2563 itr->second->GetPlayer() &&
2564 itr->second->GetPlayer()->IsInWorld() &&
2565 itr->second != self &&
2566 !AccountMgr::IsPlayerAccount(itr->second->GetSecurity()) &&
2567 (teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
2568 {
2569 itr->second->SendPacket(packet);
2570 }
2571 }
2572}
@ TEAM_NEUTRAL
Definition: SharedDefines.h:734

References _sessions, AccountMgr::IsPlayerAccount(), and TEAM_NEUTRAL.

◆ SendGlobalMessage()

void World::SendGlobalMessage ( WorldPacket const *  packet,
WorldSession self = nullptr,
TeamId  teamId = TEAM_NEUTRAL 
)
overridevirtual

Send a packet to all players (except self if mentioned)

Implements IWorld.

2541{
2542 SessionMap::const_iterator itr;
2543 for (itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2544 {
2545 if (itr->second &&
2546 itr->second->GetPlayer() &&
2547 itr->second->GetPlayer()->IsInWorld() &&
2548 itr->second != self &&
2549 (teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
2550 {
2551 itr->second->SendPacket(packet);
2552 }
2553 }
2554}

References _sessions, and TEAM_NEUTRAL.

Referenced by SendGlobalText(), and SendServerMessage().

◆ SendGlobalText()

void World::SendGlobalText ( const char *  text,
WorldSession self 
)
overridevirtual
Deprecated:
only for debug purpose. Send a System Message to all players (except self if mentioned)

Implements IWorld.

2693{
2694 WorldPacket data;
2695
2696 // need copy to prevent corruption by strtok call in LineFromMessage original string
2697 char* buf = strdup(text);
2698 char* pos = buf;
2699
2700 while (char* line = ChatHandler::LineFromMessage(pos))
2701 {
2702 ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, line);
2703 SendGlobalMessage(&data, self);
2704 }
2705
2706 free(buf);
2707}
@ CHAT_MSG_SYSTEM
Definition: SharedDefines.h:3124
@ LANG_UNIVERSAL
Definition: SharedDefines.h:707
static char * LineFromMessage(char *&pos)
Definition: Chat.h:51
static size_t BuildChatPacket(WorldPacket &data, ChatMsg chatType, Language language, ObjectGuid senderGUID, ObjectGuid receiverGUID, std::string_view message, uint8 chatTag, std::string const &senderName="", std::string const &receiverName="", uint32 achievementId=0, bool gmMessage=false, std::string const &channelName="")
Definition: Chat.cpp:192
Definition: WorldPacket.h:27
void SendGlobalMessage(WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL) override
Send a packet to all players (except self if mentioned)
Definition: World.cpp:2540

References ChatHandler::BuildChatPacket(), CHAT_MSG_SYSTEM, LANG_UNIVERSAL, ChatHandler::LineFromMessage(), and SendGlobalMessage().

◆ SendGMText()

void World::SendGMText ( uint32  string_id,
  ... 
)
overridevirtual

Send a System Message to all GMs (except self if mentioned)

Implements IWorld.

2667{
2668 va_list ap;
2669 va_start(ap, string_id);
2670
2671 Acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
2673 for (SessionMap::iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2674 {
2675 // Session should have permissions to receive global gm messages
2676 WorldSession* session = itr->second;
2677 if (!session || AccountMgr::IsPlayerAccount(session->GetSecurity()))
2678 continue;
2679
2680 // Player should be in world
2681 Player* player = session->GetPlayer();
2682 if (!player || !player->IsInWorld())
2683 continue;
2684
2685 wt_do(session->GetPlayer());
2686 }
2687
2688 va_end(ap);
2689}
Definition: GridNotifiers.h:1722
Player * GetPlayer() const
Definition: WorldSession.h:361
Definition: World.cpp:2577

References _sessions, WorldSession::GetPlayer(), WorldSession::GetSecurity(), Object::IsInWorld(), and AccountMgr::IsPlayerAccount().

◆ SendServerMessage()

void World::SendServerMessage ( ServerMessageType  messageID,
std::string  stringParam = "",
Player player = nullptr 
)
overridevirtual

Send a server message to the user(s)

Implements IWorld.

2898{
2899 WorldPackets::Chat::ChatServerMessage chatServerMessage;
2900 chatServerMessage.MessageID = int32(messageID);
2901 if (messageID <= SERVER_MSG_STRING)
2902 chatServerMessage.StringParam = stringParam;
2903
2904 if (player)
2905 player->SendDirectMessage(chatServerMessage.Write());
2906 else
2907 SendGlobalMessage(chatServerMessage.Write());
2908}
@ SERVER_MSG_STRING
Definition: IWorld.h:63
void SendDirectMessage(WorldPacket const *data) const
Definition: Player.cpp:5594
Definition: ChatPackets.h:50
std::string StringParam
Definition: ChatPackets.h:57
WorldPacket const * Write() override
Definition: ChatPackets.cpp:33
int32 MessageID
Definition: ChatPackets.h:56

References WorldPackets::Chat::ChatServerMessage::MessageID, Player::SendDirectMessage(), SendGlobalMessage(), SERVER_MSG_STRING, WorldPackets::Chat::ChatServerMessage::StringParam, and WorldPackets::Chat::ChatServerMessage::Write().

Referenced by ShutdownCancel(), and ShutdownMsg().

◆ SendWorldText()

void World::SendWorldText ( uint32  string_id,
  ... 
)
overridevirtual

Send a System Message to all players (except self if mentioned)

Implements IWorld.

2620{
2621 va_list ap;
2622 va_start(ap, string_id);
2623
2624 Acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
2626 for (SessionMap::const_iterator itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2627 {
2628 if (!itr->second || !itr->second->GetPlayer() || !itr->second->GetPlayer()->IsInWorld())
2629 continue;
2630
2631 wt_do(itr->second->GetPlayer());
2632 }
2633
2634 va_end(ap);
2635}

References _sessions.

◆ SendWorldTextOptional()

void World::SendWorldTextOptional ( uint32  string_id,
uint32  flag,
  ... 
)
overridevirtual

Implements IWorld.

2638{
2639 va_list ap;
2640 va_start(ap, flag);
2641
2642 Acore::WorldWorldTextBuilder wt_builder(string_id, &ap);
2644 for (auto const& itr : _sessions)
2645 {
2646 if (!itr.second || !itr.second->GetPlayer() || !itr.second->GetPlayer()->IsInWorld())
2647 {
2648 continue;
2649 }
2650
2651 if (sWorld->getBoolConfig(CONFIG_PLAYER_SETTINGS_ENABLED))
2652 {
2653 if (itr.second->GetPlayer()->GetPlayerSetting(AzerothcorePSSource, SETTING_ANNOUNCER_FLAGS).HasFlag(flag))
2654 {
2655 continue;
2656 }
2657 }
2658
2659 wt_do(itr.second->GetPlayer());
2660 }
2661
2662 va_end(ap);
2663}
const std::string AzerothcorePSSource
Definition: PlayerSettings.h:23
@ SETTING_ANNOUNCER_FLAGS
Definition: PlayerSettings.h:27

References _sessions, AzerothcorePSSource, CONFIG_PLAYER_SETTINGS_ENABLED, SETTING_ANNOUNCER_FLAGS, and sWorld.

◆ SendZoneMessage()

bool World::SendZoneMessage ( uint32  zone,
WorldPacket const *  packet,
WorldSession self = nullptr,
TeamId  teamId = TEAM_NEUTRAL 
)
overridevirtual

Send a packet to all players (or players selected team) in the zone (except self if mentioned)

Implements IWorld.

2711{
2712 bool foundPlayerToSend = false;
2713 SessionMap::const_iterator itr;
2714
2715 for (itr = _sessions.begin(); itr != _sessions.end(); ++itr)
2716 {
2717 if (itr->second &&
2718 itr->second->GetPlayer() &&
2719 itr->second->GetPlayer()->IsInWorld() &&
2720 itr->second->GetPlayer()->GetZoneId() == zone &&
2721 itr->second != self &&
2722 (teamId == TEAM_NEUTRAL || itr->second->GetPlayer()->GetTeamId() == teamId))
2723 {
2724 itr->second->SendPacket(packet);
2725 foundPlayerToSend = true;
2726 }
2727 }
2728
2729 return foundPlayerToSend;
2730}

References _sessions, and TEAM_NEUTRAL.

Referenced by SendZoneText().

◆ SendZoneText()

void World::SendZoneText ( uint32  zone,
const char *  text,
WorldSession self = nullptr,
TeamId  teamId = TEAM_NEUTRAL 
)
overridevirtual

Send a System Message to all players in the zone (except self if mentioned)

Implements IWorld.

2734{
2735 WorldPacket data;
2736 ChatHandler::BuildChatPacket(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, nullptr, nullptr, text);
2737 SendZoneMessage(zone, &data, self, teamId);
2738}
bool SendZoneMessage(uint32 zone, WorldPacket const *packet, WorldSession *self=nullptr, TeamId teamId=TEAM_NEUTRAL) override
Send a packet to all players (or players selected team) in the zone (except self if mentioned)
Definition: World.cpp:2710

References ChatHandler::BuildChatPacket(), CHAT_MSG_SYSTEM, LANG_UNIVERSAL, and SendZoneMessage().

◆ SetAllowMovement()

void World::SetAllowMovement ( bool  allow)
inlineoverridevirtual

Allow/Disallow object movements.

Implements IWorld.

216{ _allowMovement = allow; }

References _allowMovement.

◆ setBoolConfig()

void World::setBoolConfig ( WorldBoolConfigs  index,
bool  value 
)
inlineoverridevirtual

Set a server configuration element (see #WorldConfigs)

Implements IWorld.

274 {
275 if (index < BOOL_CONFIG_VALUE_COUNT)
276 _bool_configs[index] = value;
277 }

References _bool_configs, and BOOL_CONFIG_VALUE_COUNT.

◆ SetCleaningFlags()

void World::SetCleaningFlags ( uint32  flags)
inlineoverridevirtual

Implements IWorld.

348{ _cleaningFlags = flags; }

References _cleaningFlags.

◆ SetClosed()

void World::SetClosed ( bool  val)
overridevirtual

Close world.

Implements IWorld.

203{
204 _isClosed = val;
205
206 // Invert the value, for simplicity for scripters.
207 sScriptMgr->OnOpenStateChange(!val);
208}

References _isClosed, and sScriptMgr.

◆ setFloatConfig()

void World::setFloatConfig ( WorldFloatConfigs  index,
float  value 
)
inlineoverridevirtual

Set a server configuration element (see #WorldConfigs)

Implements IWorld.

287 {
288 if (index < FLOAT_CONFIG_VALUE_COUNT)
289 _float_configs[index] = value;
290 }

References _float_configs, and FLOAT_CONFIG_VALUE_COUNT.

◆ SetInitialWorldSettings()

void World::SetInitialWorldSettings ( )
overridevirtual

Initialize the World.

  • Server startup begin
  • Initialize the random number generator
  • Initialize detour memory management
  • Initialize VMapMgr function pointers (to untangle game/collision circular deps)
  • Initialize config settings
  • Initialize Allowed Security Level
  • Init highest guids before any table loading to prevent using not initialized guids in some code.
  • Check the existence of the map files for all starting areas.
  • Initialize pool manager
  • Initialize game event manager
  • Loading strings. Getting no records means core load has to be canceled because no error message can be output.
  • Update the realm entry in the database with the realm type from the config file
  • Custom Hook for loading DB items
  • Load the DBC files
  • Initilize static helper structures
  • Load dynamic data tables from the database
  • Handle outdated emails (delete/return)
  • Load AutoBroadCast
  • Load Motd
  • Load and initialize scripts
  • Initialize game time and timers
  • Initialize MapMgr
  • Initialize Battlegrounds
  • Initialize outdoor pvp
  • Initialize Battlefield
  • Initialize Warden

Implements IWorld.

1481{
1483 uint32 startupBegin = getMSTime();
1484
1486 srand((unsigned int)GameTime::GetGameTime().count());
1487
1489 dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
1490
1495
1498
1501
1503 sObjectMgr->SetHighestGuids();
1504
1505 if (!sConfigMgr->isDryRun())
1506 {
1508 if (!MapMgr::ExistMapAndVMap(0, -6240.32f, 331.033f)
1509 || !MapMgr::ExistMapAndVMap(0, -8949.95f, -132.493f)
1510 || !MapMgr::ExistMapAndVMap(1, -618.518f, -4251.67f)
1511 || !MapMgr::ExistMapAndVMap(0, 1676.35f, 1677.45f)
1512 || !MapMgr::ExistMapAndVMap(1, 10311.3f, 832.463f)
1513 || !MapMgr::ExistMapAndVMap(1, -2917.58f, -257.98f)
1515 !MapMgr::ExistMapAndVMap(530, 10349.6f, -6357.29f) ||
1516 !MapMgr::ExistMapAndVMap(530, -3961.64f, -13931.2f))))
1517 {
1518 exit(1);
1519 }
1520 }
1521
1523 sPoolMgr->Initialize();
1524
1526 sGameEventMgr->Initialize();
1527
1529 LOG_INFO("server.loading", " ");
1530 LOG_INFO("server.loading", "Loading Acore Strings...");
1531 if (!sObjectMgr->LoadAcoreStrings())
1532 exit(1); // Error message displayed in function already
1533
1535 //No SQL injection as values are treated as integers
1536
1537 // not send custom type REALM_FFA_PVP to realm list
1538 uint32 server_type;
1539 if (IsFFAPvPRealm())
1540 server_type = REALM_TYPE_PVP;
1541 else
1542 server_type = getIntConfig(CONFIG_GAME_TYPE);
1543
1545
1546 LoginDatabase.Execute("UPDATE realmlist SET icon = {}, timezone = {} WHERE id = '{}'", server_type, realm_zone, realm.Id.Realm); // One-time query
1547
1549 sScriptMgr->OnLoadCustomDatabaseTable();
1550
1552 LOG_INFO("server.loading", "Initialize Data Stores...");
1554 DetectDBCLang();
1555
1556 // Load cinematic cameras
1558
1559 // Load IP Location Database
1560 sIPLocation->Load();
1561
1562 std::vector<uint32> mapIds;
1563 for (auto const map : sMapStore)
1564 {
1565 mapIds.emplace_back(map->MapID);
1566 }
1567
1568 vmmgr2->InitializeThreadUnsafe(mapIds);
1569
1571 mmmgr->InitializeThreadUnsafe(mapIds);
1572
1573 LOG_INFO("server.loading", "Loading Game Graveyard...");
1574 sGraveyard->LoadGraveyardFromDB();
1575
1576 LOG_INFO("server.loading", "Initializing PlayerDump Tables...");
1578
1581
1582 LOG_INFO("server.loading", "Loading SpellInfo Store...");
1583 sSpellMgr->LoadSpellInfoStore();
1584
1585 LOG_INFO("server.loading", "Loading Spell Cooldown Overrides...");
1586 sSpellMgr->LoadSpellCooldownOverrides();
1587
1588 LOG_INFO("server.loading", "Loading SpellInfo Data Corrections...");
1589 sSpellMgr->LoadSpellInfoCorrections();
1590
1591 LOG_INFO("server.loading", "Loading Spell Rank Data...");
1592 sSpellMgr->LoadSpellRanks();
1593
1594 LOG_INFO("server.loading", "Loading Spell Specific And Aura State...");
1595 sSpellMgr->LoadSpellSpecificAndAuraState();
1596
1597 LOG_INFO("server.loading", "Loading SkillLineAbilityMultiMap Data...");
1598 sSpellMgr->LoadSkillLineAbilityMap();
1599
1600 LOG_INFO("server.loading", "Loading SpellInfo Custom Attributes...");
1601 sSpellMgr->LoadSpellInfoCustomAttributes();
1602
1603 LOG_INFO("server.loading", "Loading GameObject Models...");
1605
1606 LOG_INFO("server.loading", "Loading Script Names...");
1607 sObjectMgr->LoadScriptNames();
1608
1609 LOG_INFO("server.loading", "Loading Instance Template...");
1610 sObjectMgr->LoadInstanceTemplate();
1611
1612 LOG_INFO("server.loading", "Loading Instance Saved Gameobject State Data...");
1613 sObjectMgr->LoadInstanceSavedGameobjectStateData();
1614
1615 LOG_INFO("server.loading", "Loading Character Cache...");
1616 sCharacterCache->LoadCharacterCacheStorage();
1617
1618 // Must be called before `creature_respawn`/`gameobject_respawn` tables
1619 LOG_INFO("server.loading", "Loading Instances...");
1620 sInstanceSaveMgr->LoadInstances();
1621
1622 LOG_INFO("server.loading", "Loading Broadcast Texts...");
1623 sObjectMgr->LoadBroadcastTexts();
1624 sObjectMgr->LoadBroadcastTextLocales();
1625
1626 LOG_INFO("server.loading", "Loading Localization Strings...");
1627 uint32 oldMSTime = getMSTime();
1628 sObjectMgr->LoadCreatureLocales();
1629 sObjectMgr->LoadGameObjectLocales();
1630 sObjectMgr->LoadItemLocales();
1631 sObjectMgr->LoadItemSetNameLocales();
1632 sObjectMgr->LoadQuestLocales();
1633 sObjectMgr->LoadQuestOfferRewardLocale();
1634 sObjectMgr->LoadQuestRequestItemsLocale();
1635 sObjectMgr->LoadNpcTextLocales();
1636 sObjectMgr->LoadPageTextLocales();
1637 sObjectMgr->LoadGossipMenuItemsLocales();
1638 sObjectMgr->LoadPointOfInterestLocales();
1639 sObjectMgr->LoadPetNamesLocales();
1640
1641 sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
1642 LOG_INFO("server.loading", ">> Localization Strings loaded in {} ms", GetMSTimeDiffToNow(oldMSTime));
1643 LOG_INFO("server.loading", " ");
1644
1645 LOG_INFO("server.loading", "Loading Page Texts...");
1646 sObjectMgr->LoadPageTexts();
1647
1648 LOG_INFO("server.loading", "Loading Game Object Templates..."); // must be after LoadPageTexts
1649 sObjectMgr->LoadGameObjectTemplate();
1650
1651 LOG_INFO("server.loading", "Loading Game Object Template Addons...");
1652 sObjectMgr->LoadGameObjectTemplateAddons();
1653
1654 LOG_INFO("server.loading", "Loading Transport Templates...");
1655 sTransportMgr->LoadTransportTemplates();
1656
1657 LOG_INFO("server.loading", "Loading Spell Required Data...");
1658 sSpellMgr->LoadSpellRequired();
1659
1660 LOG_INFO("server.loading", "Loading Spell Group Types...");
1661 sSpellMgr->LoadSpellGroups();
1662
1663 LOG_INFO("server.loading", "Loading Spell Learn Skills...");
1664 sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
1665
1666 LOG_INFO("server.loading", "Loading Spell Proc Event Conditions...");
1667 sSpellMgr->LoadSpellProcEvents();
1668
1669 LOG_INFO("server.loading", "Loading Spell Proc Conditions and Data...");
1670 sSpellMgr->LoadSpellProcs();
1671
1672 LOG_INFO("server.loading", "Loading Spell Bonus Data...");
1673 sSpellMgr->LoadSpellBonuses();
1674
1675 LOG_INFO("server.loading", "Loading Aggro Spells Definitions...");
1676 sSpellMgr->LoadSpellThreats();
1677
1678 LOG_INFO("server.loading", "Loading Mixology Bonuses...");
1679 sSpellMgr->LoadSpellMixology();
1680
1681 LOG_INFO("server.loading", "Loading Spell Group Stack Rules...");
1682 sSpellMgr->LoadSpellGroupStackRules();
1683
1684 LOG_INFO("server.loading", "Loading NPC Texts...");
1685 sObjectMgr->LoadGossipText();
1686
1687 LOG_INFO("server.loading", "Loading Enchant Spells Proc Datas...");
1688 sSpellMgr->LoadSpellEnchantProcData();
1689
1690 LOG_INFO("server.loading", "Loading Item Random Enchantments Table...");
1692
1693 LOG_INFO("server.loading", "Loading Disables");
1694 DisableMgr::LoadDisables(); // must be before loading quests and items
1695
1696 LOG_INFO("server.loading", "Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
1697 sObjectMgr->LoadItemTemplates();
1698
1699 LOG_INFO("server.loading", "Loading Item Set Names..."); // must be after LoadItemPrototypes
1700 sObjectMgr->LoadItemSetNames();
1701
1702 LOG_INFO("server.loading", "Loading Creature Model Based Info Data...");
1703 sObjectMgr->LoadCreatureModelInfo();
1704
1705 LOG_INFO("server.loading", "Loading Creature Custom IDs Config...");
1706 sObjectMgr->LoadCreatureCustomIDs();
1707
1708 LOG_INFO("server.loading", "Loading Creature Templates...");
1709 sObjectMgr->LoadCreatureTemplates();
1710
1711 LOG_INFO("server.loading", "Loading Equipment Templates..."); // must be after LoadCreatureTemplates
1712 sObjectMgr->LoadEquipmentTemplates();
1713
1714 LOG_INFO("server.loading", "Loading Creature Template Addons...");
1715 sObjectMgr->LoadCreatureTemplateAddons();
1716
1717 LOG_INFO("server.loading", "Loading Reputation Reward Rates...");
1718 sObjectMgr->LoadReputationRewardRate();
1719
1720 LOG_INFO("server.loading", "Loading Creature Reputation OnKill Data...");
1721 sObjectMgr->LoadReputationOnKill();
1722
1723 LOG_INFO("server.loading", "Loading Reputation Spillover Data..." );
1724 sObjectMgr->LoadReputationSpilloverTemplate();
1725
1726 LOG_INFO("server.loading", "Loading Points Of Interest Data...");
1727 sObjectMgr->LoadPointsOfInterest();
1728
1729 LOG_INFO("server.loading", "Loading Creature Base Stats...");
1730 sObjectMgr->LoadCreatureClassLevelStats();
1731
1732 LOG_INFO("server.loading", "Loading Creature Data...");
1733 sObjectMgr->LoadCreatures();
1734
1735 LOG_INFO("server.loading", "Loading Temporary Summon Data...");
1736 sObjectMgr->LoadTempSummons(); // must be after LoadCreatureTemplates() and LoadGameObjectTemplates()
1737
1738 LOG_INFO("server.loading", "Loading Pet Levelup Spells...");
1739 sSpellMgr->LoadPetLevelupSpellMap();
1740
1741 LOG_INFO("server.loading", "Loading Pet default Spells additional to Levelup Spells...");
1742 sSpellMgr->LoadPetDefaultSpells();
1743
1744 LOG_INFO("server.loading", "Loading Creature Addon Data...");
1745 sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
1746
1747 LOG_INFO("server.loading", "Loading Creature Movement Overrides...");
1748 sObjectMgr->LoadCreatureMovementOverrides(); // must be after LoadCreatures()
1749
1750 LOG_INFO("server.loading", "Loading Gameobject Data...");
1751 sObjectMgr->LoadGameobjects();
1752
1753 LOG_INFO("server.loading", "Loading GameObject Addon Data...");
1754 sObjectMgr->LoadGameObjectAddons(); // must be after LoadGameObjectTemplate() and LoadGameobjects()
1755
1756 LOG_INFO("server.loading", "Loading GameObject Quest Items...");
1757 sObjectMgr->LoadGameObjectQuestItems();
1758
1759 LOG_INFO("server.loading", "Loading Creature Quest Items...");
1760 sObjectMgr->LoadCreatureQuestItems();
1761
1762 LOG_INFO("server.loading", "Loading Creature Linked Respawn...");
1763 sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
1764
1765 LOG_INFO("server.loading", "Loading Weather Data...");
1767
1768 LOG_INFO("server.loading", "Loading Quests...");
1769 sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
1770
1771 LOG_INFO("server.loading", "Checking Quest Disables");
1772 DisableMgr::CheckQuestDisables(); // must be after loading quests
1773
1774 LOG_INFO("server.loading", "Loading Quest POI");
1775 sObjectMgr->LoadQuestPOI();
1776
1777 LOG_INFO("server.loading", "Loading Quests Starters and Enders...");
1778 sObjectMgr->LoadQuestStartersAndEnders(); // must be after quest load
1779
1780 LOG_INFO("server.loading", "Loading Quest Greetings...");
1781 sObjectMgr->LoadQuestGreetings(); // must be loaded after creature_template, gameobject_template tables
1782 LOG_INFO("server.loading", "Loading Quest Greeting Locales...");
1783 sObjectMgr->LoadQuestGreetingsLocales(); // must be loaded after creature_template, gameobject_template tables
1784
1785 LOG_INFO("server.loading", "Loading Quest Money Rewards...");
1786 sObjectMgr->LoadQuestMoneyRewards();
1787
1788 LOG_INFO("server.loading", "Loading Objects Pooling Data...");
1789 sPoolMgr->LoadFromDB();
1790
1791 LOG_INFO("server.loading", "Loading Game Event Data..."); // must be after loading pools fully
1792 sGameEventMgr->LoadHolidayDates(); // Must be after loading DBC
1793 sGameEventMgr->LoadFromDB(); // Must be after loading holiday dates
1794
1795 LOG_INFO("server.loading", "Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
1796 sObjectMgr->LoadNPCSpellClickSpells();
1797
1798 LOG_INFO("server.loading", "Loading Vehicle Template Accessories...");
1799 sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
1800
1801 LOG_INFO("server.loading", "Loading Vehicle Accessories...");
1802 sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
1803
1804 LOG_INFO("server.loading", "Loading SpellArea Data..."); // must be after quest load
1805 sSpellMgr->LoadSpellAreas();
1806
1807 LOG_INFO("server.loading", "Loading Area Trigger Definitions");
1808 sObjectMgr->LoadAreaTriggers();
1809
1810 LOG_INFO("server.loading", "Loading Area Trigger Teleport Definitions...");
1811 sObjectMgr->LoadAreaTriggerTeleports();
1812
1813 LOG_INFO("server.loading", "Loading Access Requirements...");
1814 sObjectMgr->LoadAccessRequirements(); // must be after item template load
1815
1816 LOG_INFO("server.loading", "Loading Quest Area Triggers...");
1817 sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests
1818
1819 LOG_INFO("server.loading", "Loading Tavern Area Triggers...");
1820 sObjectMgr->LoadTavernAreaTriggers();
1821
1822 LOG_INFO("server.loading", "Loading AreaTrigger Script Names...");
1823 sObjectMgr->LoadAreaTriggerScripts();
1824
1825 LOG_INFO("server.loading", "Loading LFG Entrance Positions..."); // Must be after areatriggers
1826 sLFGMgr->LoadLFGDungeons();
1827
1828 LOG_INFO("server.loading", "Loading Dungeon Boss Data...");
1829 sObjectMgr->LoadInstanceEncounters();
1830
1831 LOG_INFO("server.loading", "Loading LFG Rewards...");
1832 sLFGMgr->LoadRewards();
1833
1834 LOG_INFO("server.loading", "Loading Graveyard-Zone Links...");
1835 sGraveyard->LoadGraveyardZones();
1836
1837 LOG_INFO("server.loading", "Loading Spell Pet Auras...");
1838 sSpellMgr->LoadSpellPetAuras();
1839
1840 LOG_INFO("server.loading", "Loading Spell Target Coordinates...");
1841 sSpellMgr->LoadSpellTargetPositions();
1842
1843 LOG_INFO("server.loading", "Loading Enchant Custom Attributes...");
1844 sSpellMgr->LoadEnchantCustomAttr();
1845
1846 LOG_INFO("server.loading", "Loading linked Spells...");
1847 sSpellMgr->LoadSpellLinked();
1848
1849 LOG_INFO("server.loading", "Loading Player Create Data...");
1850 sObjectMgr->LoadPlayerInfo();
1851
1852 LOG_INFO("server.loading", "Loading Exploration BaseXP Data...");
1853 sObjectMgr->LoadExplorationBaseXP();
1854
1855 LOG_INFO("server.loading", "Loading Pet Name Parts...");
1856 sObjectMgr->LoadPetNames();
1857
1859
1860 LOG_INFO("server.loading", "Loading The Max Pet Number...");
1861 sObjectMgr->LoadPetNumber();
1862
1863 LOG_INFO("server.loading", "Loading Pet Level Stats...");
1864 sObjectMgr->LoadPetLevelInfo();
1865
1866 LOG_INFO("server.loading", "Loading Player Level Dependent Mail Rewards...");
1867 sObjectMgr->LoadMailLevelRewards();
1868
1869 LOG_INFO("server.loading", "Load Mail Server Template...");
1870 sObjectMgr->LoadMailServerTemplates();
1871
1872 // Loot tables
1874
1875 LOG_INFO("server.loading", "Loading Skill Discovery Table...");
1877
1878 LOG_INFO("server.loading", "Loading Skill Extra Item Table...");
1880
1881 LOG_INFO("server.loading", "Loading Skill Perfection Data Table...");
1883
1884 LOG_INFO("server.loading", "Loading Skill Fishing Base Level Requirements...");
1885 sObjectMgr->LoadFishingBaseSkillLevel();
1886
1887 LOG_INFO("server.loading", "Loading Achievements...");
1888 sAchievementMgr->LoadAchievementReferenceList();
1889 LOG_INFO("server.loading", "Loading Achievement Criteria Lists...");
1890 sAchievementMgr->LoadAchievementCriteriaList();
1891 LOG_INFO("server.loading", "Loading Achievement Criteria Data...");
1892 sAchievementMgr->LoadAchievementCriteriaData();
1893 LOG_INFO("server.loading", "Loading Achievement Rewards...");
1894 sAchievementMgr->LoadRewards();
1895 LOG_INFO("server.loading", "Loading Achievement Reward Locales...");
1896 sAchievementMgr->LoadRewardLocales();
1897 LOG_INFO("server.loading", "Loading Completed Achievements...");
1898 sAchievementMgr->LoadCompletedAchievements();
1899
1901 LOG_INFO("server.loading", "Loading Item Auctions...");
1902 sAuctionMgr->LoadAuctionItems();
1903 LOG_INFO("server.loading", "Loading Auctions...");
1904 sAuctionMgr->LoadAuctions();
1905
1906 sGuildMgr->LoadGuilds();
1907
1908 LOG_INFO("server.loading", "Loading ArenaTeams...");
1909 sArenaTeamMgr->LoadArenaTeams();
1910
1911 LOG_INFO("server.loading", "Loading Groups...");
1912 sGroupMgr->LoadGroups();
1913
1914 LOG_INFO("server.loading", "Loading Reserved Names...");
1915 sObjectMgr->LoadReservedPlayersNames();
1916
1917 LOG_INFO("server.loading", "Loading Profanity Names...");
1918 sObjectMgr->LoadProfanityPlayersNames();
1919
1920 LOG_INFO("server.loading", "Loading GameObjects for Quests...");
1921 sObjectMgr->LoadGameObjectForQuests();
1922
1923 LOG_INFO("server.loading", "Loading BattleMasters...");
1924 sBattlegroundMgr->LoadBattleMastersEntry();
1925
1926 LOG_INFO("server.loading", "Loading GameTeleports...");
1927 sObjectMgr->LoadGameTele();
1928
1929 LOG_INFO("server.loading", "Loading Gossip Menu...");
1930 sObjectMgr->LoadGossipMenu();
1931
1932 LOG_INFO("server.loading", "Loading Gossip Menu Options...");
1933 sObjectMgr->LoadGossipMenuItems();
1934
1935 LOG_INFO("server.loading", "Loading Vendors...");
1936 sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
1937
1938 LOG_INFO("server.loading", "Loading Trainers...");
1939 sObjectMgr->LoadTrainerSpell(); // must be after load CreatureTemplate
1940
1941 LOG_INFO("server.loading", "Loading Waypoints...");
1942 sWaypointMgr->Load();
1943
1944 LOG_INFO("server.loading", "Loading SmartAI Waypoints...");
1945 sSmartWaypointMgr->LoadFromDB();
1946
1947 LOG_INFO("server.loading", "Loading Creature Formations...");
1948 sFormationMgr->LoadCreatureFormations();
1949
1950 LOG_INFO("server.loading", "Loading World States..."); // must be loaded before battleground, outdoor PvP and conditions
1952
1953 LOG_INFO("server.loading", "Loading Conditions...");
1954 sConditionMgr->LoadConditions();
1955
1956 LOG_INFO("server.loading", "Loading Faction Change Achievement Pairs...");
1957 sObjectMgr->LoadFactionChangeAchievements();
1958
1959 LOG_INFO("server.loading", "Loading Faction Change Spell Pairs...");
1960 sObjectMgr->LoadFactionChangeSpells();
1961
1962 LOG_INFO("server.loading", "Loading Faction Change Item Pairs...");
1963 sObjectMgr->LoadFactionChangeItems();
1964
1965 LOG_INFO("server.loading", "Loading Faction Change Reputation Pairs...");
1966 sObjectMgr->LoadFactionChangeReputations();
1967
1968 LOG_INFO("server.loading", "Loading Faction Change Title Pairs...");
1969 sObjectMgr->LoadFactionChangeTitles();
1970
1971 LOG_INFO("server.loading", "Loading Faction Change Quest Pairs...");
1972 sObjectMgr->LoadFactionChangeQuests();
1973
1974 LOG_INFO("server.loading", "Loading GM Tickets...");
1975 sTicketMgr->LoadTickets();
1976
1977 LOG_INFO("server.loading", "Loading GM Surveys...");
1978 sTicketMgr->LoadSurveys();
1979
1980 LOG_INFO("server.loading", "Loading Client Addons...");
1982
1983 // pussywizard:
1984 LOG_INFO("server.loading", "Deleting Invalid Mail Items...");
1985 LOG_INFO("server.loading", " ");
1986 CharacterDatabase.Execute("DELETE mi FROM mail_items mi LEFT JOIN item_instance ii ON mi.item_guid = ii.guid WHERE ii.guid IS NULL");
1987 CharacterDatabase.Execute("DELETE mi FROM mail_items mi LEFT JOIN mail m ON mi.mail_id = m.id WHERE m.id IS NULL");
1988 CharacterDatabase.Execute("UPDATE mail m LEFT JOIN mail_items mi ON m.id = mi.mail_id SET m.has_items=0 WHERE m.has_items<>0 AND mi.mail_id IS NULL");
1989
1991 LOG_INFO("server.loading", "Returning Old Mails...");
1992 LOG_INFO("server.loading", " ");
1993 sObjectMgr->ReturnOrDeleteOldMails(false);
1994
1996 LOG_INFO("server.loading", "Loading Autobroadcasts...");
1997 sAutobroadcastMgr->LoadAutobroadcasts();
1998
2000 LOG_INFO("server.loading", "Loading MotD...");
2001 LoadMotd();
2002
2004 sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
2005 sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
2006 sObjectMgr->LoadWaypointScripts();
2007
2008 LOG_INFO("server.loading", "Loading Spell Script Names...");
2009 sObjectMgr->LoadSpellScriptNames();
2010
2011 LOG_INFO("server.loading", "Loading Creature Texts...");
2012 sCreatureTextMgr->LoadCreatureTexts();
2013
2014 LOG_INFO("server.loading", "Loading Creature Text Locales...");
2015 sCreatureTextMgr->LoadCreatureTextLocales();
2016
2017 LOG_INFO("server.loading", "Loading Scripts...");
2018 sScriptMgr->LoadDatabase();
2019
2020 LOG_INFO("server.loading", "Validating Spell Scripts...");
2021 sObjectMgr->ValidateSpellScripts();
2022
2023 LOG_INFO("server.loading", "Loading SmartAI Scripts...");
2024 sSmartScriptMgr->LoadSmartAIFromDB();
2025
2026 LOG_INFO("server.loading", "Loading Calendar Data...");
2027 sCalendarMgr->LoadFromDB();
2028
2029 LOG_INFO("server.loading", "Initializing SpellInfo Precomputed Data..."); // must be called after loading items, professions, spells and pretty much anything
2030 LOG_INFO("server.loading", " ");
2031 sObjectMgr->InitializeSpellInfoPrecomputedData();
2032
2033 LOG_INFO("server.loading", "Initialize Commands...");
2035
2037 LOG_INFO("server.loading", "Initialize Game Time and Timers");
2038 LOG_INFO("server.loading", " ");
2039
2040 LoginDatabase.Execute("INSERT INTO uptime (realmid, starttime, uptime, revision) VALUES ({}, {}, 0, '{}')",
2041 realm.Id.Realm, uint32(GameTime::GetStartTime().count()), GitRevision::GetFullVersion()); // One-time query
2042
2047 //Update "uptime" table based on configuration entry in minutes.
2048
2050 //erase corpses every 20 minutes
2052 // clean logs table every 14 days by default
2054
2056
2057 // our speed up
2059
2060 _timers[WUPDATE_WHO_LIST].SetInterval(5 * IN_MILLISECONDS); // update who list cache every 5 seconds
2061
2063
2065 LOG_INFO("server.loading", "Starting Map System");
2066 LOG_INFO("server.loading", " ");
2067 sMapMgr->Initialize();
2068
2069 LOG_INFO("server.loading", "Starting Game Event system...");
2070 LOG_INFO("server.loading", " ");
2071 uint32 nextGameEvent = sGameEventMgr->StartSystem();
2072 _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
2073
2074 // Delete all characters which have been deleted X days before
2076
2077 // Delete all custom channels which haven't been used for PreserveCustomChannelDuration days.
2079
2080 LOG_INFO("server.loading", "Initializing Opcodes...");
2082
2083 LOG_INFO("server.loading", "Starting Arena Season...");
2084 LOG_INFO("server.loading", " ");
2085 sGameEventMgr->StartArenaSeason();
2086
2087 sTicketMgr->Initialize();
2088
2090 LOG_INFO("server.loading", "Starting Battleground System");
2091 sBattlegroundMgr->LoadBattlegroundTemplates();
2092 sBattlegroundMgr->InitAutomaticArenaPointDistribution();
2093
2095 LOG_INFO("server.loading", "Starting Outdoor PvP System");
2096 sOutdoorPvPMgr->InitOutdoorPvP();
2097
2099 LOG_INFO("server.loading", "Starting Battlefield System");
2100 sBattlefieldMgr->InitBattlefield();
2101
2102 LOG_INFO("server.loading", "Loading Transports...");
2103 sTransportMgr->SpawnContinentTransports();
2104
2106 LOG_INFO("server.loading", "Loading Warden Checks..." );
2107 sWardenCheckMgr->LoadWardenChecks();
2108
2109 LOG_INFO("server.loading", "Loading Warden Action Overrides..." );
2110 sWardenCheckMgr->LoadWardenOverrides();
2111
2112 LOG_INFO("server.loading", "Deleting Expired Bans...");
2113 LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query
2114
2115 LOG_INFO("server.loading", "Calculate Next Daily Quest Reset Time...");
2117
2118 LOG_INFO("server.loading", "Calculate Next Weekly Quest Reset Time..." );
2120
2121 LOG_INFO("server.loading", "Calculate Next Monthly Quest Reset Time...");
2123
2124 LOG_INFO("server.loading", "Calculate Random Battleground Reset Time..." );
2126
2127 LOG_INFO("server.loading", "Calculate Deletion Of Old Calendar Events Time...");
2129
2130 LOG_INFO("server.loading", "Calculate Guild Cap Reset Time...");
2131 LOG_INFO("server.loading", " ");
2133
2134 LOG_INFO("server.loading", "Load Petitions...");
2135 sPetitionMgr->LoadPetitions();
2136
2137 LOG_INFO("server.loading", "Load Petition Signs...");
2138 sPetitionMgr->LoadSignatures();
2139
2140 LOG_INFO("server.loading", "Load Stored Loot Items...");
2141 sLootItemStorage->LoadStorageFromDB();
2142
2143 LOG_INFO("server.loading", "Load Channel Rights...");
2145
2146 LOG_INFO("server.loading", "Load Channels...");
2148
2149 sScriptMgr->OnBeforeWorldInitialized();
2150
2152 {
2153 LOG_INFO("server.loading", "Loading All Grids For All Non-Instanced Maps...");
2154
2155 for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
2156 {
2157 MapEntry const* mapEntry = sMapStore.LookupEntry(i);
2158
2159 if (mapEntry && !mapEntry->Instanceable())
2160 {
2161 Map* map = sMapMgr->CreateBaseMap(mapEntry->MapID);
2162
2163 if (map)
2164 {
2165 LOG_INFO("server.loading", ">> Loading All Grids For Map {}", map->GetId());
2166 map->LoadAllCells();
2167 }
2168 }
2169 }
2170 }
2171
2172 uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
2173
2174 LOG_INFO("server.loading", " ");
2175 LOG_INFO("server.loading", "WORLD: World Initialized In {} Minutes {} Seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); // outError for red color in console
2176 LOG_INFO("server.loading", " ");
2177
2178 METRIC_EVENT("events", "World initialized", "World Initialized In " + std::to_string(startupDuration / 60000) + " Minutes " + std::to_string((startupDuration % 60000) / 1000) + " Seconds");
2179
2180 if (sConfigMgr->isDryRun())
2181 {
2182 sMapMgr->UnloadAll();
2183 LOG_INFO("server.loading", "AzerothCore Dry Run Completed, Terminating.");
2184 exit(0);
2185 }
2186}
void dtCustomFree(void *ptr)
Definition: MMapMgr.h:35
void * dtCustomAlloc(size_t size, dtAllocHint)
Definition: MMapMgr.h:30
void LoadGameObjectModelList(std::string const &dataPath)
Definition: GameObjectModel.cpp:45
#define sIPLocation
Definition: IPLocation.h:49
#define METRIC_EVENT(category, title, description)
Definition: Metric.h:187
#define sAchievementMgr
Definition: AchievementMgr.h:421
#define sSmartWaypointMgr
Definition: SmartScriptMgr.h:2057
#define sSmartScriptMgr
Definition: SmartScriptMgr.h:2056
#define sAuctionMgr
Definition: AuctionHouseMgr.h:228
#define sAutobroadcastMgr
Definition: AutobroadcastMgr.h:52
#define sBattlefieldMgr
Definition: BattlefieldMgr.h:77
#define sArenaTeamMgr
Definition: ArenaTeamMgr.h:67
#define sBattlegroundMgr
Definition: BattlegroundMgr.h:188
#define sCharacterCache
Definition: CharacterCache.h:83
#define sConditionMgr
Definition: ConditionMgr.h:289
uint32 GetLiquidFlags(uint32 liquidType)
Definition: DBCStores.cpp:827
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
void LoadDBCStores(const std::string &dataPath)
Definition: DBCStores.cpp:259
void LoadM2Cameras(std::string const &dataPath)
Definition: M2Stores.cpp:176
#define sLFGMgr
Definition: LFGMgr.h:638
#define sFormationMgr
Definition: CreatureGroups.h:126
void LoadRandomEnchantmentsTable()
Definition: ItemEnchantmentMgr.cpp:44
#define sObjectMgr
Definition: ObjectMgr.h:1640
#define sGroupMgr
Definition: GroupMgr.h:51
#define sInstanceSaveMgr
Definition: InstanceSaveMgr.h:202
#define sLootItemStorage
Definition: LootItemStorage.h:75
void LoadLootTables()
Definition: LootMgr.h:443
#define sTransportMgr
Definition: TransportMgr.h:163
#define sGraveyard
Definition: GameGraveyard.h:75
#define sWaypointMgr
Definition: WaypointMgr.h:77
#define sOutdoorPvPMgr
Definition: OutdoorPvPMgr.h:106
#define sPetitionMgr
Definition: PetitionMgr.h:88
void LoadSkillDiscoveryTable()
Definition: SkillDiscovery.cpp:46
void LoadSkillPerfectItemTable()
Definition: SkillExtraItems.cpp:52
void LoadSkillExtraItemTable()
Definition: SkillExtraItems.cpp:138
#define sSpellMgr
Definition: SpellMgr.h:818
#define sCreatureTextMgr
Definition: CreatureTextMgr.h:119
#define sTicketMgr
Definition: TicketMgr.h:258
#define sWardenCheckMgr
Definition: WardenCheckMgr.h:89
OpcodeTable opcodeTable
Definition: Opcodes.cpp:51
void Initialize()
Correspondence between opcodes and their names.
Definition: Opcodes.cpp:123
void LoadWeatherData()
Definition: WeatherMgr.cpp:84
@ WUPDATE_PINGDB
Definition: World.h:70
@ WUPDATE_WHO_LIST
Definition: World.h:72
@ WUPDATE_WEATHERS
Definition: World.h:63
@ WUPDATE_AUCTIONS
Definition: World.h:62
AC_COMMON_API char const * GetFullVersion()
Definition: GitRevision.cpp:70
void LoadFromDB()
Definition: AddonMgr.cpp:38
void Initialize()
Definition: CreatureAIRegistry.cpp:34
AC_GAME_API void LoadCommandMap()
Definition: ChatCommand.cpp:533
void CheckQuestDisables()
Definition: DisableMgr.cpp:275
bool IsVMAPDisabledFor(uint32 entry, uint8 flags)
Definition: DisableMgr.cpp:406
void LoadDisables()
Definition: DisableMgr.cpp:50
Seconds GetStartTime()
Definition: GameTime.cpp:33
void CleanDatabase()
Definition: CharacterDatabaseCleaner.cpp:26
static MMapMgr * createOrGetMMapMgr()
Definition: MMapFactory.cpp:29
Definition: MMapMgr.h:75
void InitializeThreadUnsafe(const std::vector< uint32 > &mapIds)
Definition: MMapMgr.cpp:41
Definition: VMapMgr2.h:77
IsVMAPDisabledForFn IsVMAPDisabledForPtr
Definition: VMapMgr2.h:138
void InitializeThreadUnsafe(const std::vector< uint32 > &mapIds)
Definition: VMapMgr2.cpp:54
GetLiquidFlagsFn GetLiquidFlagsPtr
Definition: VMapMgr2.h:135
static void CleanOldChannelsInDB()
Definition: Channel.cpp:140
static void LoadChannelRights()
Definition: ChannelMgr.cpp:166
static void LoadChannels()
Definition: ChannelMgr.cpp:50
static void DeleteOldCharacters()
Definition: Player.cpp:4264
Definition: Map.h:312
uint32 GetId() const
Definition: Map.h:378
void LoadAllCells()
Definition: Map.cpp:499
static bool ExistMapAndVMap(uint32 mapid, float x, float y)
Definition: MapMgr.cpp:300
static void InitializeTables()
Definition: PlayerDump.cpp:253
bool IsFFAPvPRealm() const override
Definition: World.cpp:3306
void LoadConfigSettings(bool reload=false) override
Initialize config values.
Definition: World.cpp:416
void LoadWorldStates() override
Definition: World.cpp:3240
void InitCalendarOldEventsDeletionTime()
Definition: World.cpp:3073
void InitDailyQuestResetTime()
Definition: World.cpp:3040
void LoadDBAllowedSecurityLevel() override
Definition: World.cpp:3111
void DetectDBCLang()
Definition: World.cpp:2188
void InitGuildResetTime()
Definition: World.cpp:3084
void InitRandomBGResetTime()
Definition: World.cpp:3062
void InitWeeklyQuestResetTime()
Definition: World.cpp:3029
void LoadMotd() override
Definition: World.cpp:2231
void InitMonthlyQuestResetTime()
Definition: World.cpp:3051
Definition: DBCStructure.h:1308
uint32 MapID
Definition: DBCStructure.h:1309
bool Instanceable() const
Definition: DBCStructure.h:1336

References _dataPath, _int_configs, _mail_expire_check_timer, _timers, CharacterDatabase, DisableMgr::CheckQuestDisables(), CharacterDatabaseCleaner::CleanDatabase(), Channel::CleanOldChannelsInDB(), CONFIG_AUTOBROADCAST_INTERVAL, CONFIG_DB_PING_INTERVAL, CONFIG_EXPANSION, CONFIG_GAME_TYPE, CONFIG_LOGDB_CLEARINTERVAL, CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS, CONFIG_REALM_ZONE, CONFIG_UPTIME_UPDATE, MMAP::MMapFactory::createOrGetMMapMgr(), VMAP::VMapFactory::createOrGetVMapMgr(), Player::DeleteOldCharacters(), DetectDBCLang(), dtCustomAlloc(), dtCustomFree(), MapMgr::ExistMapAndVMap(), GetDefaultDbcLocale(), GitRevision::GetFullVersion(), GameTime::GetGameTime(), Map::GetId(), getIntConfig(), GetLiquidFlags(), VMAP::VMapMgr2::GetLiquidFlagsPtr, getMSTime(), GetMSTimeDiffToNow(), GameTime::GetStartTime(), Realm::Id, IN_MILLISECONDS, InitCalendarOldEventsDeletionTime(), InitDailyQuestResetTime(), InitGuildResetTime(), AIRegistry::Initialize(), OpcodeTable::Initialize(), PlayerDump::InitializeTables(), MMAP::MMapMgr::InitializeThreadUnsafe(), VMAP::VMapMgr2::InitializeThreadUnsafe(), InitMonthlyQuestResetTime(), InitRandomBGResetTime(), InitWeeklyQuestResetTime(), MapEntry::Instanceable(), IsFFAPvPRealm(), DisableMgr::IsVMAPDisabledFor(), VMAP::VMapMgr2::IsVMAPDisabledForPtr, Map::LoadAllCells(), ChannelMgr::LoadChannelRights(), ChannelMgr::LoadChannels(), Acore::ChatCommands::LoadCommandMap(), LoadConfigSettings(), LoadDBAllowedSecurityLevel(), LoadDBCStores(), DisableMgr::LoadDisables(), AddonMgr::LoadFromDB(), LoadGameObjectModelList(), LoadLootTables(), LoadM2Cameras(), LoadMotd(), LoadRandomEnchantmentsTable(), LoadSkillDiscoveryTable(), LoadSkillExtraItemTable(), LoadSkillPerfectItemTable(), WeatherMgr::LoadWeatherData(), LoadWorldStates(), LOG_INFO, LoginDatabase, MapEntry::MapID, METRIC_EVENT, MINUTE, opcodeTable, realm, RealmHandle::Realm, REALM_TYPE_PVP, sAchievementMgr, sArenaTeamMgr, sAuctionMgr, sAutobroadcastMgr, sBattlefieldMgr, sBattlegroundMgr, sCalendarMgr, sCharacterCache, sConditionMgr, sConfigMgr, sCreatureTextMgr, IntervalTimer::SetCurrent(), IntervalTimer::SetInterval(), sFormationMgr, sGameEventMgr, sGraveyard, sGroupMgr, sGuildMgr, sInstanceSaveMgr, sIPLocation, sLFGMgr, sLootItemStorage, sMapMgr, sMapStore, sObjectMgr, sOutdoorPvPMgr, sPetitionMgr, sPoolMgr, sScriptMgr, sSmartScriptMgr, sSmartWaypointMgr, sSpellMgr, sTicketMgr, sTransportMgr, sWardenCheckMgr, sWaypointMgr, sWorld, WUPDATE_5_SECS, WUPDATE_AUCTIONS, WUPDATE_AUTOBROADCAST, WUPDATE_CLEANDB, WUPDATE_CORPSES, WUPDATE_EVENTS, WUPDATE_PINGDB, WUPDATE_UPTIME, WUPDATE_WEATHERS, and WUPDATE_WHO_LIST.

◆ setIntConfig()

void World::setIntConfig ( WorldIntConfigs  index,
uint32  value 
)
inlineoverridevirtual

Set a server configuration element (see #WorldConfigs)

Implements IWorld.

300 {
301 if (index < INT_CONFIG_VALUE_COUNT)
302 _int_configs[index] = value;
303 }

References _int_configs, and INT_CONFIG_VALUE_COUNT.

◆ SetNewCharString()

void World::SetNewCharString ( std::string const &  str)
inlineoverridevirtual

Set the string for new characters (first login)

Implements IWorld.

219{ _newCharString = str; }

References _newCharString.

Referenced by LoadConfigSettings().

◆ SetPlayerAmountLimit()

void World::SetPlayerAmountLimit ( uint32  limit)
inlineoverridevirtual

Active session server limit.

Implements IWorld.

202{ _playerLimit = limit; }

References _playerLimit.

Referenced by LoadConfigSettings().

◆ SetPlayerSecurityLimit()

void World::SetPlayerSecurityLimit ( AccountTypes  sec)
overridevirtual

Implements IWorld.

3122{
3123 AccountTypes sec = _sec < SEC_CONSOLE ? _sec : SEC_PLAYER;
3124 bool update = sec > _allowedSecurityLevel;
3126 if (update)
3128}
void KickAllLess(AccountTypes sec) override
Kick (and save) all players with security level less sec
Definition: World.cpp:2755

References _allowedSecurityLevel, KickAllLess(), SEC_CONSOLE, and SEC_PLAYER.

Referenced by LoadDBAllowedSecurityLevel().

◆ setRate()

void World::setRate ( Rates  rate,
float  value 
)
inlineoverridevirtual

Set a server rate (see Rates)

Implements IWorld.

268{ _rate_values[rate] = value; }

References _rate_values.

◆ SetRealmName()

void World::SetRealmName ( std::string  name)
inlineoverridevirtual

Implements IWorld.

352{ _realmName = name; } // pussywizard

References _realmName.

◆ setWorldState()

void World::setWorldState ( uint32  index,
uint64  value 
)
overridevirtual

Implements IWorld.

3265{
3266 auto const& it = _worldstates.find(index);
3267 if (it != _worldstates.end())
3268 {
3270 stmt->SetData(0, uint32(timeValue));
3271 stmt->SetData(1, index);
3272 CharacterDatabase.Execute(stmt);
3273 }
3274 else
3275 {
3277 stmt->SetData(0, index);
3278 stmt->SetData(1, uint32(timeValue));
3279 CharacterDatabase.Execute(stmt);
3280 }
3281
3282 _worldstates[index] = timeValue;
3283}
@ CHAR_INS_WORLDSTATE
Definition: CharacterDatabase.h:305
@ CHAR_UPD_WORLDSTATE
Definition: CharacterDatabase.h:304

References _worldstates, CHAR_INS_WORLDSTATE, CHAR_UPD_WORLDSTATE, CharacterDatabase, and PreparedStatementBase::SetData().

◆ ShutdownCancel()

void World::ShutdownCancel ( )
overridevirtual

Cancel a planned server shutdown.

Implements IWorld.

2879{
2880 // nothing cancel or too later
2881 if (!_shutdownTimer || _stopEvent)
2882 return;
2883
2885
2886 _shutdownMask = 0;
2887 _shutdownTimer = 0;
2888 _exitCode = SHUTDOWN_EXIT_CODE; // to default value
2889 SendServerMessage(msgid);
2890
2891 LOG_DEBUG("server.worldserver", "Server {} cancelled.", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
2892
2893 sScriptMgr->OnShutdownCancel();
2894}
ServerMessageType
Definition: IWorld.h:60
@ SERVER_MSG_SHUTDOWN_CANCELLED
Definition: IWorld.h:64
@ SERVER_MSG_RESTART_CANCELLED
Definition: IWorld.h:65
@ SHUTDOWN_MASK_RESTART
Definition: World.h:48
@ SHUTDOWN_EXIT_CODE
Definition: World.h:54
void SendServerMessage(ServerMessageType messageID, std::string stringParam="", Player *player=nullptr) override
Send a server message to the user(s)
Definition: World.cpp:2897

References _exitCode, _shutdownMask, _shutdownTimer, _stopEvent, LOG_DEBUG, SendServerMessage(), SERVER_MSG_RESTART_CANCELLED, SERVER_MSG_SHUTDOWN_CANCELLED, SHUTDOWN_EXIT_CODE, SHUTDOWN_MASK_RESTART, and sScriptMgr.

◆ ShutdownMsg()

void World::ShutdownMsg ( bool  show = false,
Player player = nullptr,
const std::string &  reason = std::string() 
)
overridevirtual

Display a shutdown message to the user(s)

  • Display a message every 12 hours, hours, 5 minutes, minute, 5 seconds and finally seconds

Implements IWorld.

2850{
2851 // not show messages for idle shutdown mode
2853 return;
2854
2856 if (show ||
2857 (_shutdownTimer < 5 * MINUTE && (_shutdownTimer % 15) == 0) || // < 5 min; every 15 sec
2858 (_shutdownTimer < 15 * MINUTE && (_shutdownTimer % MINUTE) == 0) || // < 15 min ; every 1 min
2859 (_shutdownTimer < 30 * MINUTE && (_shutdownTimer % (5 * MINUTE)) == 0) || // < 30 min ; every 5 min
2860 (_shutdownTimer < 12 * HOUR && (_shutdownTimer % HOUR) == 0) || // < 12 h ; every 1 h
2861 (_shutdownTimer > 12 * HOUR && (_shutdownTimer % (12 * HOUR)) == 0)) // > 12 h ; every 12 h
2862 {
2863 std::string str = secsToTimeString(_shutdownTimer).append(".");
2864
2865 if (!reason.empty())
2866 {
2867 str += " - " + reason;
2868 }
2869
2871
2872 SendServerMessage(msgid, str, player);
2873 LOG_DEBUG("server.worldserver", "Server is {} in {}", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"), str);
2874 }
2875}
std::string secsToTimeString(uint64 timeInSecs, bool shortText)
Definition: Util.cpp:74
@ SERVER_MSG_SHUTDOWN_TIME
Definition: IWorld.h:61
@ SERVER_MSG_RESTART_TIME
Definition: IWorld.h:62

References _shutdownMask, _shutdownTimer, HOUR, LOG_DEBUG, MINUTE, secsToTimeString(), SendServerMessage(), SERVER_MSG_RESTART_TIME, SERVER_MSG_SHUTDOWN_TIME, SHUTDOWN_MASK_IDLE, and SHUTDOWN_MASK_RESTART.

Referenced by _UpdateGameTime(), and ShutdownServ().

◆ ShutdownServ()

void World::ShutdownServ ( uint32  time,
uint32  options,
uint8  exitcode,
const std::string &  reason = std::string() 
)
overridevirtual

Shutdown the server.

  • If the shutdown time is 0, set m_stopEvent (except if shutdown is 'idle' with remaining sessions)
  • Else set the shutdown timer and warn users

Implements IWorld.

2795{
2796 // ignore if server shutdown at next tick
2797 if (IsStopped())
2798 return;
2799
2800 _shutdownMask = options;
2801 _exitCode = exitcode;
2802
2803 auto const& playersOnline = GetActiveSessionCount();
2804
2805 if (time < 5 && playersOnline)
2806 {
2807 // Set time to 5s for save all players
2808 time = 5;
2809 }
2810
2812
2813 if (time >= 5)
2814 {
2815 playersSaveScheduler.Schedule(Seconds(time - 5), [this](TaskContext /*context*/)
2816 {
2817 if (!GetActiveSessionCount())
2818 {
2819 LOG_INFO("server", "> No players online. Skip save before shutdown");
2820 return;
2821 }
2822
2823 LOG_INFO("server", "> Save players before shutdown server");
2825 });
2826 }
2827
2828 LOG_WARN("server", "Time left until shutdown/restart: {}", time);
2829
2831 if (time == 0)
2832 {
2833 if (!(options & SHUTDOWN_MASK_IDLE) || GetActiveAndQueuedSessionCount() == 0)
2834 _stopEvent = true; // exist code already set
2835 else
2836 _shutdownTimer = 1; //So that the session count is re-evaluated at next world tick
2837 }
2839 else
2840 {
2841 _shutdownTimer = time;
2842 ShutdownMsg(true, nullptr, reason);
2843 }
2844
2845 sScriptMgr->OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options));
2846}
ShutdownMask
Definition: World.h:47
ShutdownExitCode
Definition: World.h:53
void SaveAllPlayers()
Definition: ObjectAccessor.cpp:267
TaskScheduler playersSaveScheduler
Definition: World.cpp:102
TaskScheduler & CancelAll()
Definition: TaskScheduler.cpp:33
TaskScheduler & Schedule(std::chrono::duration< _Rep, _Period > const &time, task_handler_t const &task)
Definition: TaskScheduler.h:217
Definition: TaskScheduler.h:400

References _exitCode, _shutdownMask, _shutdownTimer, _stopEvent, TaskScheduler::CancelAll(), GetActiveAndQueuedSessionCount(), GetActiveSessionCount(), IsStopped(), LOG_INFO, LOG_WARN, ObjectAccessor::SaveAllPlayers(), TaskScheduler::Schedule(), SHUTDOWN_MASK_IDLE, ShutdownMsg(), and sScriptMgr.

◆ StopNow()

◆ Update()

void World::Update ( uint32  diff)
overridevirtual

Update the World !

  • Update the game time and check for shutdown time
  • Update the different timers
  • Update Who List Cache

Handle daily quests reset time

Handle weekly quests reset time

Handle monthly quests reset time

Handle session updates when the timer has passed

Handle weather updates when the timer has passed

Clean logs table

  • Update objects when the timer has passed (maps, transport, creatures, ...)

Update uptime table

  • Erase corpses once every 20 minutes
  • Process Game events when necessary
  • Ping to keep MySQL connections alive

Implements IWorld.

2266{
2267 METRIC_TIMER("world_update_time_total");
2268
2271 Seconds currentGameTime = GameTime::GetGameTime();
2272
2274
2275 // Record update if recording set in log and diff is greater then minimum set in log
2277
2279
2281 for (int i = 0; i < WUPDATE_COUNT; ++i)
2282 {
2283 if (_timers[i].GetCurrent() >= 0)
2284 _timers[i].Update(diff);
2285 else
2286 _timers[i].SetCurrent(0);
2287 }
2288
2289 // pussywizard: our speed up and functionality
2290 if (_timers[WUPDATE_5_SECS].Passed())
2291 {
2293
2294 // moved here from HandleCharEnumOpcode
2296 CharacterDatabase.Execute(stmt);
2297 }
2298
2300 if (_timers[WUPDATE_WHO_LIST].Passed())
2301 {
2302 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update who list"));
2304 sWhoListCacheMgr->Update();
2305 }
2306
2307 {
2308 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Check quest reset times"));
2309
2311 if (currentGameTime > _nextDailyQuestReset)
2312 {
2314 }
2315
2317 if (currentGameTime > _nextWeeklyQuestReset)
2318 {
2320 }
2321
2323 if (currentGameTime > _nextMonthlyQuestReset)
2324 {
2326 }
2327 }
2328
2329 if (currentGameTime > _nextRandomBGReset)
2330 {
2331 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Reset random BG"));
2332 ResetRandomBG();
2333 }
2334
2335 if (currentGameTime > _nextCalendarOldEventsDeletionTime)
2336 {
2337 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Delete old calendar events"));
2339 }
2340
2341 if (currentGameTime > _nextGuildReset)
2342 {
2343 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Reset guild cap"));
2344 ResetGuildCap();
2345 }
2346
2347 // pussywizard:
2348 // acquire mutex now, this is kind of waiting for listing thread to finish it's work (since it can't process next packet)
2349 // so we don't have to do it in every packet that modifies auctions
2351 {
2352 std::lock_guard<std::mutex> guard(AsyncAuctionListingMgr::GetLock());
2353
2354 // pussywizard: handle auctions when the timer has passed
2355 if (_timers[WUPDATE_AUCTIONS].Passed())
2356 {
2357 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update expired auctions"));
2358
2360
2361 // pussywizard: handle expired auctions, auctions expired when realm was offline are also handled here (not during loading when many required things aren't loaded yet)
2362 sAuctionMgr->Update();
2363 }
2364
2366
2367 if (currentGameTime > _mail_expire_check_timer)
2368 {
2369 sObjectMgr->ReturnOrDeleteOldMails(true);
2370 _mail_expire_check_timer = currentGameTime + 6h;
2371 }
2372
2373 {
2375 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update sessions"));
2376 UpdateSessions(diff);
2377 }
2378 }
2379
2380 // end of section with mutex
2382
2384 if (_timers[WUPDATE_WEATHERS].Passed())
2385 {
2388 }
2389
2391 if (sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
2392 {
2393 if (_timers[WUPDATE_CLEANDB].Passed())
2394 {
2395 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Clean logs table"));
2396
2398
2400 stmt->SetData(0, sWorld->getIntConfig(CONFIG_LOGDB_CLEARTIME));
2401 stmt->SetData(1, uint32(currentGameTime.count()));
2402 LoginDatabase.Execute(stmt);
2403 }
2404 }
2405
2406 {
2407 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update LFG 0"));
2408 sLFGMgr->Update(diff, 0); // pussywizard: remove obsolete stuff before finding compatibility during map update
2409 }
2410
2411 {
2413 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update maps"));
2414 sMapMgr->Update(diff);
2415 }
2416
2417 if (sWorld->getBoolConfig(CONFIG_AUTOBROADCAST))
2418 {
2419 if (_timers[WUPDATE_AUTOBROADCAST].Passed())
2420 {
2421 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Send autobroadcast"));
2423 sAutobroadcastMgr->SendAutobroadcasts();
2424 }
2425 }
2426
2427 {
2428 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update battlegrounds"));
2429 sBattlegroundMgr->Update(diff);
2430 }
2431
2432 {
2433 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update outdoor pvp"));
2434 sOutdoorPvPMgr->Update(diff);
2435 }
2436
2437 {
2438 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update battlefields"));
2439 sBattlefieldMgr->Update(diff);
2440 }
2441
2442 {
2443 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update LFG 2"));
2444 sLFGMgr->Update(diff, 2); // pussywizard: handle created proposals
2445 }
2446
2447 {
2448 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process query callbacks"));
2449 // execute callbacks from sql queries that were queued recently
2451 }
2452
2454 if (_timers[WUPDATE_UPTIME].Passed())
2455 {
2456 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update uptime"));
2457
2459
2461 stmt->SetData(0, uint32(GameTime::GetUptime().count()));
2462 stmt->SetData(1, uint16(GetMaxPlayerCount()));
2463 stmt->SetData(2, realm.Id.Realm);
2464 stmt->SetData(3, uint32(GameTime::GetStartTime().count()));
2465 LoginDatabase.Execute(stmt);
2466 }
2467
2469 if (_timers[WUPDATE_CORPSES].Passed())
2470 {
2471 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Remove old corpses"));
2473
2474 sMapMgr->DoForAllMaps([](Map* map)
2475 {
2476 map->RemoveOldCorpses();
2477 });
2478 }
2479
2481 if (_timers[WUPDATE_EVENTS].Passed())
2482 {
2483 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update game events"));
2484 _timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
2485 uint32 nextGameEvent = sGameEventMgr->Update();
2486 _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
2488 }
2489
2491 if (_timers[WUPDATE_PINGDB].Passed())
2492 {
2493 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Ping MySQL"));
2495 LOG_DEBUG("sql.driver", "Ping MySQL to keep connection alive");
2496 CharacterDatabase.KeepAlive();
2497 LoginDatabase.KeepAlive();
2498 WorldDatabase.KeepAlive();
2499 }
2500
2501 {
2502 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update instance reset times"));
2503 // update the instance reset times
2504 sInstanceSaveMgr->Update();
2505 }
2506
2507 {
2508 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process cli commands"));
2509 // And last, but not least handle the issued cli commands
2511 }
2512
2513 {
2514 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update world scripts"));
2515 sScriptMgr->OnWorldUpdate(diff);
2516 }
2517
2518 {
2519 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update playersSaveScheduler"));
2521 }
2522
2523 {
2524 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update metrics"));
2525 // Stats logger update
2526 sMetric->Update();
2527 METRIC_VALUE("update_time_diff", diff);
2528 }
2529}
#define METRIC_VALUE(category, value,...)
Definition: Metric.h:195
#define METRIC_TAG(name, value)
Definition: Metric.h:161
#define METRIC_TIMER(category,...)
Definition: Metric.h:204
@ CHAR_DEL_EXPIRED_BANS
Definition: CharacterDatabase.h:34
@ LOGIN_UPD_UPTIME_PLAYERS
Definition: LoginDatabase.h:76
@ LOGIN_DEL_OLD_LOGS
Definition: LoginDatabase.h:77
#define sWhoListCacheMgr
Definition: WhoListCacheMgr.h:96
void Update(uint32 diff)
Definition: WeatherMgr.cpp:152
@ WUPDATE_COUNT
Definition: World.h:73
Milliseconds GetGameTimeMS()
Definition: GameTime.cpp:43
Seconds GetUptime()
Uptime.
Definition: GameTime.cpp:58
TaskScheduler & Update(success_t const &callback=EmptyCallback)
Definition: TaskScheduler.cpp:15
void Update(time_t diff)
Definition: Timer.h:152
void RemoveOldCorpses()
Definition: Map.cpp:3660
static std::mutex & GetLock()
Definition: AsyncAuctionListing.h:78
static void SetAuctionListingAllowed(bool a)
Definition: AsyncAuctionListing.h:74
static void Update(uint32 diff)
Definition: AsyncAuctionListing.h:70
static void Update(uint32 sessionCount)
Definition: DynamicVisibility.cpp:22
void UpdateWithDiff(uint32 diff)
Definition: UpdateTime.cpp:74
void RecordUpdateTime(Milliseconds gameTimeMs, uint32 diff, uint32 sessionCount)
Definition: UpdateTime.cpp:114
void ProcessCliCommands() override
Definition: World.cpp:2984
void _UpdateGameTime()
Update the game time.
Definition: World.cpp:2764
uint32 GetMaxPlayerCount() const override
Definition: World.h:178
void ResetMonthlyQuests()
Definition: World.cpp:3146
void ResetGuildCap()
Definition: World.cpp:3196
void ResetWeeklyQuests()
Definition: World.cpp:3130
void ResetRandomBG()
Definition: World.cpp:3172
void UpdateSessions(uint32 diff) override
Definition: World.cpp:2910
void ResetDailyQuests()
Definition: World.cpp:3095
void CalendarDeleteOldEvents()
Definition: World.cpp:3187
void ProcessQueryCallbacks()
Definition: World.cpp:3291

References _mail_expire_check_timer, _nextCalendarOldEventsDeletionTime, _nextDailyQuestReset, _nextGuildReset, _nextMonthlyQuestReset, _nextRandomBGReset, _nextWeeklyQuestReset, _timers, _UpdateGameTime(), CalendarDeleteOldEvents(), CHAR_DEL_EXPIRED_BANS, CharacterDatabase, CONFIG_AUTOBROADCAST, CONFIG_LOGDB_CLEARTIME, GetActiveSessionCount(), GameTime::GetGameTime(), GameTime::GetGameTimeMS(), AsyncAuctionListingMgr::GetLock(), GetMaxPlayerCount(), GameTime::GetStartTime(), GameTime::GetUptime(), Realm::Id, LOG_DEBUG, LOGIN_DEL_OLD_LOGS, LOGIN_UPD_UPTIME_PLAYERS, LoginDatabase, METRIC_TAG, METRIC_TIMER, METRIC_VALUE, ProcessCliCommands(), ProcessQueryCallbacks(), realm, RealmHandle::Realm, WorldUpdateTime::RecordUpdateTime(), Map::RemoveOldCorpses(), IntervalTimer::Reset(), ResetDailyQuests(), ResetGuildCap(), ResetMonthlyQuests(), ResetRandomBG(), ResetWeeklyQuests(), sAuctionMgr, sAutobroadcastMgr, sBattlefieldMgr, sBattlegroundMgr, AsyncAuctionListingMgr::SetAuctionListingAllowed(), IntervalTimer::SetCurrent(), PreparedStatementBase::SetData(), IntervalTimer::SetInterval(), sGameEventMgr, sInstanceSaveMgr, sLFGMgr, sMapMgr, sMetric, sObjectMgr, sOutdoorPvPMgr, sScriptMgr, sWhoListCacheMgr, sWorld, sWorldUpdateTime, TaskScheduler::Update(), IntervalTimer::Update(), AsyncAuctionListingMgr::Update(), WeatherMgr::Update(), DynamicVisibilityMgr::Update(), UpdateSessions(), UpdateTime::UpdateWithDiff(), WorldDatabase, WUPDATE_5_SECS, WUPDATE_AUCTIONS, WUPDATE_AUTOBROADCAST, WUPDATE_CLEANDB, WUPDATE_CORPSES, WUPDATE_COUNT, WUPDATE_EVENTS, WUPDATE_PINGDB, WUPDATE_UPTIME, WUPDATE_WEATHERS, and WUPDATE_WHO_LIST.

◆ UpdateAreaDependentAuras()

void World::UpdateAreaDependentAuras ( )
overridevirtual

Implements IWorld.

3230{
3231 SessionMap::const_iterator itr;
3232 for (itr = _sessions.begin(); itr != _sessions.end(); ++itr)
3233 if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld())
3234 {
3235 itr->second->GetPlayer()->UpdateAreaDependentAuras(itr->second->GetPlayer()->GetAreaId());
3236 itr->second->GetPlayer()->UpdateZoneDependentAuras(itr->second->GetPlayer()->GetZoneId());
3237 }
3238}

References _sessions.

◆ UpdateMaxSessionCounters()

void World::UpdateMaxSessionCounters ( )
overridevirtual

Get the number of current active sessions.

Implements IWorld.

References _maxActiveSessionCount, _maxQueuedSessionCount, _queuedPlayer, and _sessions.

Referenced by AddSession_().

◆ UpdateRealmCharCount()

void World::UpdateRealmCharCount ( uint32  accid)
overridevirtual

Implements IWorld.

3003{
3005 stmt->SetData(0, accountId);
3006 _queryProcessor.AddCallback(CharacterDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&World::_UpdateRealmCharCount, this, std::placeholders::_1)));
3007}
@ CHAR_SEL_CHARACTER_COUNT
Definition: CharacterDatabase.h:136
T & AddCallback(T &&query)
Definition: AsyncCallbackProcessor.h:35
void _UpdateRealmCharCount(PreparedQueryResult resultCharCount)
Definition: World.cpp:3009

References _queryProcessor, _UpdateRealmCharCount(), AsyncCallbackProcessor< T >::AddCallback(), CHAR_SEL_CHARACTER_COUNT, CharacterDatabase, and PreparedStatementBase::SetData().

◆ UpdateSessions()

void World::UpdateSessions ( uint32  diff)
overridevirtual
  • Add new sessions
  • Then send an update signal to remaining ones
  • and remove not active sessions from the list

Implements IWorld.

2911{
2912 {
2913 METRIC_DETAILED_NO_THRESHOLD_TIMER("world_update_time",
2914 METRIC_TAG("type", "Add sessions"),
2915 METRIC_TAG("parent_type", "Update sessions"));
2916
2918 WorldSession* sess = nullptr;
2919 while (_addSessQueue.next(sess))
2920 {
2921 AddSession_(sess);
2922 }
2923 }
2924
2926 for (SessionMap::iterator itr = _sessions.begin(), next; itr != _sessions.end(); itr = next)
2927 {
2928 next = itr;
2929 ++next;
2930
2932 WorldSession* pSession = itr->second;
2933 WorldSessionFilter updater(pSession);
2934
2935 // pussywizard:
2936 if (pSession->HandleSocketClosed())
2937 {
2939 _disconnects[pSession->GetAccountId()] = GameTime::GetGameTime().count();
2940 _sessions.erase(itr);
2941 // there should be no offline session if current one is logged onto a character
2942 SessionMap::iterator iter;
2943 if ((iter = _offlineSessions.find(pSession->GetAccountId())) != _offlineSessions.end())
2944 {
2945 WorldSession* tmp = iter->second;
2946 _offlineSessions.erase(iter);
2947 delete tmp;
2948 }
2949 pSession->SetOfflineTime(GameTime::GetGameTime().count());
2950 _offlineSessions[pSession->GetAccountId()] = pSession;
2951 continue;
2952 }
2953
2954 [[maybe_unused]] uint32 currentSessionId = itr->first;
2955 METRIC_DETAILED_TIMER("world_update_sessions_time", METRIC_TAG("account_id", std::to_string(currentSessionId)));
2956
2957 if (!pSession->Update(diff, updater))
2958 {
2960 _disconnects[pSession->GetAccountId()] = GameTime::GetGameTime().count();
2961 _sessions.erase(itr);
2962 delete pSession;
2963 }
2964 }
2965
2966 // pussywizard:
2967 if (_offlineSessions.empty())
2968 return;
2969 uint32 currTime = GameTime::GetGameTime().count();
2970 for (SessionMap::iterator itr = _offlineSessions.begin(), next; itr != _offlineSessions.end(); itr = next)
2971 {
2972 next = itr;
2973 ++next;
2974 WorldSession* pSession = itr->second;
2975 if (!pSession->GetPlayer() || pSession->GetOfflineTime() + 60 < currTime || pSession->IsKicked())
2976 {
2977 _offlineSessions.erase(itr);
2978 delete pSession;
2979 }
2980 }
2981}
#define METRIC_DETAILED_TIMER(category,...)
Definition: Metric.h:221
#define METRIC_DETAILED_NO_THRESHOLD_TIMER(category,...)
Definition: Metric.h:222
Definition: WorldSession.h:257
bool Update(uint32 diff, PacketFilter &updater)
Update the WorldSession (triggered by World update)
Definition: WorldSession.cpp:289
uint32 GetOfflineTime() const
Definition: WorldSession.h:1066
bool IsKicked() const
Definition: WorldSession.h:1067
void AddSession_(WorldSession *s)
Definition: World.cpp:264

References _addSessQueue, _disconnects, _offlineSessions, _sessions, AddSession_(), CONFIG_INTERVAL_DISCONNECT_TOLERANCE, WorldSession::GetAccountId(), GameTime::GetGameTime(), getIntConfig(), WorldSession::GetOfflineTime(), WorldSession::GetPlayer(), WorldSession::HandleSocketClosed(), WorldSession::IsKicked(), METRIC_DETAILED_NO_THRESHOLD_TIMER, METRIC_DETAILED_TIMER, METRIC_TAG, LockedQueue< T, StorageType >::next(), RemoveQueuedPlayer(), WorldSession::SetOfflineTime(), and WorldSession::Update().

Referenced by Update().

Member Data Documentation

◆ _addSessQueue

LockedQueue<WorldSession*> World::_addSessQueue
private

Referenced by AddSession(), and UpdateSessions().

◆ _allowedSecurityLevel

AccountTypes World::_allowedSecurityLevel
private

◆ _allowMovement

bool World::_allowMovement
private

◆ _availableDbcLocaleMask

uint32 World::_availableDbcLocaleMask
private

◆ _bool_configs

bool World::_bool_configs[BOOL_CONFIG_VALUE_COUNT]
private

◆ _cleaningFlags

uint32 World::_cleaningFlags
private

◆ _cliCmdQueue

LockedQueue<CliCommandHolder*> World::_cliCmdQueue
private

◆ _dataPath

std::string World::_dataPath
private

◆ _dbVersion

std::string World::_dbVersion
private

Referenced by GetDBVersion(), and LoadDBVersion().

◆ _defaultDbcLocale

LocaleConstant World::_defaultDbcLocale
private

◆ _disconnects

DisconnectMap World::_disconnects
private

◆ _exitCode

uint8 World::_exitCode = SHUTDOWN_EXIT_CODE
staticprivate

◆ _float_configs

float World::_float_configs[FLOAT_CONFIG_VALUE_COUNT]
private

◆ _int_configs

◆ _isClosed

bool World::_isClosed
private

Referenced by IsClosed(), SetClosed(), and World().

◆ _mail_expire_check_timer

Seconds World::_mail_expire_check_timer
private

◆ _maxActiveSessionCount

uint32 World::_maxActiveSessionCount
private

◆ _maxPlayerCount

uint32 World::_maxPlayerCount
private

◆ _maxQueuedSessionCount

uint32 World::_maxQueuedSessionCount
private

◆ _maxVisibleDistanceInBGArenas

float World::_maxVisibleDistanceInBGArenas = DEFAULT_VISIBILITY_BGARENAS
staticprivate

◆ _maxVisibleDistanceInInstances

float World::_maxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE
staticprivate

◆ _maxVisibleDistanceOnContinents

float World::_maxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE
staticprivate

◆ _newCharString

std::string World::_newCharString
private

◆ _nextCalendarOldEventsDeletionTime

Seconds World::_nextCalendarOldEventsDeletionTime
private

◆ _nextDailyQuestReset

Seconds World::_nextDailyQuestReset
private

◆ _nextGuildReset

Seconds World::_nextGuildReset
private

◆ _nextMonthlyQuestReset

Seconds World::_nextMonthlyQuestReset
private

◆ _nextRandomBGReset

Seconds World::_nextRandomBGReset
private

◆ _nextWeeklyQuestReset

Seconds World::_nextWeeklyQuestReset
private

◆ _offlineSessions

◆ _playerCount

uint32 World::_playerCount
private

◆ _playerLimit

uint32 World::_playerLimit
private

◆ _queryProcessor

QueryCallbackProcessor World::_queryProcessor
private

◆ _queuedPlayer

◆ _rate_values

float World::_rate_values[MAX_RATES]
private

◆ _realmName

std::string World::_realmName
private

Referenced by GetRealmName(), and SetRealmName().

◆ _sessions

◆ _shutdownMask

uint32 World::_shutdownMask
private

◆ _shutdownTimer

◆ _stopEvent

std::atomic_long World::_stopEvent = false
staticprivate

◆ _timers

◆ _worldstates

WorldStatesMap World::_worldstates
private

◆ m_worldLoopCounter

uint32 World::m_worldLoopCounter = 0
static