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 Member Functions

 World ()
 World constructor.
 
 ~World () override
 World destructor.
 
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
 
bool getAllowMovement () const override
 
void SetAllowMovement (bool allow) override
 Allow/Disallow object movements.
 
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.
 
bool IsShuttingDown () const override
 Are we in the middle of a shutdown?
 
uint32 GetShutDownTimeLeft () const override
 
void ShutdownServ (uint32 time, uint32 options, uint8 exitcode, std::string const &reason=std::string()) override
 Shutdown the server.
 
void ShutdownCancel () override
 Cancel a planned server shutdown.
 
void ShutdownMsg (bool show=false, Player *player=nullptr, std::string const &reason=std::string()) override
 Displays a shutdown message at specific intervals or immediately if required.
 
void Update (uint32 diff) override
 Update the World !
 
void setRate (ServerConfigs index, float value) override
 
float getRate (ServerConfigs index) const override
 
void setBoolConfig (ServerConfigs index, bool value) override
 
bool getBoolConfig (ServerConfigs index) const override
 
void setFloatConfig (ServerConfigs index, float value) override
 
float getFloatConfig (ServerConfigs index) const override
 
void setIntConfig (ServerConfigs index, uint32 value) override
 
uint32 getIntConfig (ServerConfigs index) const override
 
void setStringConfig (ServerConfigs index, std::string const &value) override
 
std::string_view getStringConfig (ServerConfigs index) const override
 
bool IsPvPRealm () const override
 Are we on a "Player versus Player" server?
 
bool IsFFAPvPRealm () const override
 
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 UpdateAreaDependentAuras () override
 
uint32 GetCleaningFlags () const override
 
void SetCleaningFlags (uint32 flags) override
 
void ResetEventSeasonalQuests (uint16 event_id) override
 
void ReloadRBAC () override
 
std::string const & GetRealmName () const override
 
void SetRealmName (std::string name) override
 
- Public Member Functions inherited from IWorld
virtual ~IWorld ()=default
 

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.
 
bool RescheduleShutdownForWintergrasp ()
 
void _UpdateRealmCharCount (PreparedQueryResult resultCharCount, uint32 accountId)
 
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 Member Functions

void DetectDBCLang ()
 
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

WorldConfig _worldConfig
 
uint32 _shutdownTimer
 
uint32 _shutdownMask
 
std::string _shutdownReason
 
uint32 _cleaningFlags
 
bool _isClosed
 
IntervalTimer _timers [WUPDATE_COUNT]
 
Seconds _mail_expire_check_timer
 
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
 
std::string _dbVersion
 
uint32 _dbClientCacheVersion
 
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.

Constructor & Destructor Documentation

◆ World()

World::World ( )

World constructor.

119{
121 _allowMovement = true;
122 _shutdownMask = 0;
123 _shutdownTimer = 0;
129 _nextGuildReset = 0s;
132 _isClosed = false;
133 _cleaningFlags = 0;
135}
@ LOCALE_enUS
Definition Common.h:126
@ SEC_PLAYER
Definition Common.h:57
Seconds _nextGuildReset
Definition World.h:300
uint32 _shutdownMask
Definition World.h:267
uint32 _cleaningFlags
Definition World.h:270
LocaleConstant _defaultDbcLocale
Definition World.h:278
Seconds _nextDailyQuestReset
Definition World.h:295
bool _isClosed
Definition World.h:272
uint32 _dbClientCacheVersion
Definition World.h:304
Seconds _nextMonthlyQuestReset
Definition World.h:297
Seconds _nextCalendarOldEventsDeletionTime
Definition World.h:299
Seconds _nextWeeklyQuestReset
Definition World.h:296
uint32 _shutdownTimer
Definition World.h:266
Seconds _nextRandomBGReset
Definition World.h:298
bool _allowMovement
Definition World.h:281
AccountTypes _allowedSecurityLevel
Definition World.h:277
Seconds _mail_expire_check_timer
Definition World.h:275

References _allowedSecurityLevel, _allowMovement, _cleaningFlags, _dbClientCacheVersion, _defaultDbcLocale, _isClosed, _mail_expire_check_timer, _nextCalendarOldEventsDeletionTime, _nextDailyQuestReset, _nextGuildReset, _nextMonthlyQuestReset, _nextRandomBGReset, _nextWeeklyQuestReset, _shutdownMask, _shutdownTimer, LOCALE_enUS, and SEC_PLAYER.

◆ ~World()

World::~World ( )
override

World destructor.

139{
140 CliCommandHolder* command = nullptr;
141 while (_cliCmdQueue.next(command))
142 delete command;
143
145}
bool next(T &result)
Gets the next item in the queue and removes it.
Definition LockedQueue.h:77
static void clear()
Definition VMapFactory.cpp:39
LockedQueue< CliCommandHolder * > _cliCmdQueue
Definition World.h:292
Storage class for commands issued for delayed execution.
Definition IWorld.h:35

References _cliCmdQueue, 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)
  • ... unless a Wintergrasp battle is running and deferral is enabled, in which case the shutdown/restart is pushed past the end of the current battle and the world keeps running
  • ... else decrease it and if necessary display a shutdown countdown to the users
1478{
1480 Seconds lastGameTime = GameTime::GetGameTime();
1482
1483 Seconds elapsed = GameTime::GetGameTime() - lastGameTime;
1484
1486 if (!IsStopped() && _shutdownTimer > 0 && elapsed > 0s)
1487 {
1489 if (_shutdownTimer <= elapsed.count())
1490 {
1494 {
1495 if (!(_shutdownMask & SHUTDOWN_MASK_IDLE) || sWorldSessionMgr->GetActiveAndQueuedSessionCount() == 0)
1496 _stopEvent = true; // exist code already set
1497 else
1498 _shutdownTimer = 1; // minimum timer value to wait idle state
1499 }
1500 }
1502 else
1503 {
1504 _shutdownTimer -= elapsed.count();
1505
1506 ShutdownMsg();
1507 }
1508 }
1509}
std::chrono::seconds Seconds
Seconds shorthand typedef.
Definition Duration.h:30
#define sWorldSessionMgr
Definition WorldSessionMgr.h:118
void ShutdownMsg(bool show=false, Player *player=nullptr, std::string const &reason=std::string()) override
Displays a shutdown message at specific intervals or immediately if required.
Definition World.cpp:1586
bool RescheduleShutdownForWintergrasp()
Definition World.cpp:1513
static std::atomic_long _stopEvent
Definition World.h:264
static bool IsStopped()
Definition World.h:189
@ SHUTDOWN_MASK_IDLE
Definition World.h:48
void UpdateGameTimers()
Update all timers.
Definition GameTime.cpp:63
Seconds GetGameTime()
Definition GameTime.cpp:38

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

Referenced by Update().

◆ _UpdateRealmCharCount()

void World::_UpdateRealmCharCount ( PreparedQueryResult  resultCharCount,
uint32  accountId 
)
protected
1662{
1663 uint8 charCount{0};
1664 if (resultCharCount)
1665 {
1666 Field* fields = resultCharCount->Fetch();
1667 charCount = uint8(fields[1].Get<uint64>());
1668 }
1669
1670 LoginDatabaseTransaction trans = LoginDatabase.BeginTransaction();
1671
1673 stmt->SetData(0, charCount);
1674 stmt->SetData(1, accountId);
1675 stmt->SetData(2, realm.Id.Realm);
1676 trans->Append(stmt);
1677
1678 LoginDatabase.CommitTransaction(trans);
1679}
SQLTransaction< LoginDatabaseConnection > LoginDatabaseTransaction
Definition DatabaseEnvFwd.h:70
DatabaseWorkerPool< LoginDatabaseConnection > LoginDatabase
Accessor to the realm/login database.
Definition DatabaseEnv.cpp:22
std::uint8_t uint8
Definition Define.h:109
@ LOGIN_REP_REALM_CHARACTERS
Definition LoginDatabase.h:63
Class used to access individual fields of database query result.
Definition Field.h:98
Acore::Types::is_default< T > SetData(const uint8 index, T value)
Definition PreparedStatement.h:77
Definition PreparedStatement.h:157
AC_GAME_API Realm realm
Definition World.cpp:115
uint32 Realm
Definition Realm.h:43
RealmHandle Id
Definition Realm.h:69

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

Referenced by UpdateRealmCharCount().

◆ CalendarDeleteOldEvents()

void World::CalendarDeleteOldEvents ( )
protected
1855{
1856 LOG_INFO("server.worldserver", "Calendar deletion of old events.");
1857
1860 sCalendarMgr->DeleteOldEvents();
1861}
#define sCalendarMgr
Definition CalendarMgr.h:344
#define LOG_INFO(filterType__,...)
Definition Log.h:153
@ CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR
Definition WorldConfig.h:319
@ WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME
Definition WorldStateDefines.h:613
#define sWorldState
Definition WorldState.h:377
uint32 getIntConfig(ServerConfigs index) const override
Definition World.cpp:1408
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, sWorldState, and WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME.

Referenced by Update().

◆ DetectDBCLang()

void World::DetectDBCLang ( )
private
1076{
1077 uint8 m_lang_confid = sConfigMgr->GetOption<int32>("DBC.Locale", 255);
1078
1079 if (m_lang_confid != 255 && m_lang_confid >= TOTAL_LOCALES)
1080 {
1081 LOG_ERROR("server.loading", "Incorrect DBC.Locale! Must be >= 0 and < {} (set to 0)", TOTAL_LOCALES);
1082 m_lang_confid = LOCALE_enUS;
1083 }
1084
1085 ChrRacesEntry const* race = sChrRacesStore.LookupEntry(1);
1086 std::string availableLocalsStr;
1087
1088 uint8 default_locale = TOTAL_LOCALES;
1089 for (uint8 i = default_locale - 1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
1090 {
1091 if (race->name[i][0] != '\0') // check by race names
1092 {
1093 default_locale = i;
1094 _availableDbcLocaleMask |= (1 << i);
1095 availableLocalsStr += localeNames[i];
1096 availableLocalsStr += " ";
1097 }
1098 }
1099
1100 if (default_locale != m_lang_confid && m_lang_confid < TOTAL_LOCALES &&
1101 (_availableDbcLocaleMask & (1 << m_lang_confid)))
1102 {
1103 default_locale = m_lang_confid;
1104 }
1105
1106 if (default_locale >= TOTAL_LOCALES)
1107 {
1108 LOG_ERROR("server.loading", "Unable to determine your DBC Locale! (corrupt DBC?)");
1109 exit(1);
1110 }
1111
1112 _defaultDbcLocale = LocaleConstant(default_locale);
1113
1114 LOG_INFO("server.loading", "Using {} DBC Locale As Default. All Available DBC locales: {}", localeNames[GetDefaultDbcLocale()], availableLocalsStr.empty() ? "<none>" : availableLocalsStr);
1115 LOG_INFO("server.loading", " ");
1116}
char const * localeNames[TOTAL_LOCALES]
Definition Common.cpp:20
LocaleConstant
Definition Common.h:125
@ TOTAL_LOCALES
Definition Common.h:136
DBCStorage< ChrRacesEntry > sChrRacesStore(ChrRacesEntryfmt)
std::int32_t int32
Definition Define.h:103
#define LOG_ERROR(filterType__,...)
Definition Log.h:145
uint32 _availableDbcLocaleMask
Definition World.h:279
LocaleConstant GetDefaultDbcLocale() const override
Definition World.h:161
#define sConfigMgr
Definition Config.h:93
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.

◆ ForceGameEventUpdate()

void World::ForceGameEventUpdate ( )
overridevirtual

Implements IWorld.

1424{
1425 _timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
1426 uint32 nextGameEvent = sGameEventMgr->Update();
1427 _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
1429}
std::uint32_t uint32
Definition Define.h:107
#define sGameEventMgr
Definition GameEventMgr.h:201
IntervalTimer _timers[WUPDATE_COUNT]
Definition World.h:274
@ WUPDATE_EVENTS
Definition World.h:62
void SetInterval(time_t interval)
Definition Timer.h:179
void Reset()
Definition Timer.h:166

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

◆ getAllowMovement()

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

Implements IWorld.

157{ return _allowMovement; }

References _allowMovement.

◆ GetAvailableDbcLocale()

LocaleConstant World::GetAvailableDbcLocale ( LocaleConstant  locale) const
inlineoverridevirtual

Implements IWorld.

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

References _availableDbcLocaleMask, and _defaultDbcLocale.

◆ getBoolConfig()

bool World::getBoolConfig ( ServerConfigs  index) const
overridevirtual

Implements IWorld.

1389{
1390 return _worldConfig.GetConfigValue<bool>(index);
1391}
T GetConfigValue(ConfigEnum const config) const
Definition ConfigValueCache.h:97
WorldConfig _worldConfig
Definition World.h:262

References _worldConfig, and ConfigValueCache< ConfigEnum >::GetConfigValue().

Referenced by LoadConfigSettings(), SetInitialWorldSettings(), and Update().

◆ GetCleaningFlags()

uint32 World::GetCleaningFlags ( ) const
inlineoverridevirtual

Implements IWorld.

235{ return _cleaningFlags; }

References _cleaningFlags.

◆ GetConfigMaxSkillValue()

uint16 World::GetConfigMaxSkillValue ( ) const
inlineoverridevirtual

Get the maximum skill level a player can reach.

Implements IWorld.

173 {
175 return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
176 }
std::uint16_t uint16
Definition Define.h:108
@ CONFIG_MAX_PLAYER_LEVEL
Definition WorldConfig.h:195

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.

164{ return _dataPath; }
std::string _dataPath
Definition World.h:282

References _dataPath.

◆ GetDBVersion()

char const * World::GetDBVersion ( ) const
inlineoverridevirtual

Implements IWorld.

231{ return _dbVersion.c_str(); }
std::string _dbVersion
Definition World.h:303

References _dbVersion.

◆ GetDefaultDbcLocale()

LocaleConstant World::GetDefaultDbcLocale ( ) const
inlineoverridevirtual

Implements IWorld.

161{ return _defaultDbcLocale; }

References _defaultDbcLocale.

Referenced by DetectDBCLang(), and SetInitialWorldSettings().

◆ GetExitCode()

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

References _exitCode.

Referenced by main().

◆ getFloatConfig()

float World::getFloatConfig ( ServerConfigs  index) const
overridevirtual

Implements IWorld.

1399{
1400 return _worldConfig.GetConfigValue<float>(index);
1401}

References _worldConfig, and ConfigValueCache< ConfigEnum >::GetConfigValue().

Referenced by getRate().

◆ getIntConfig()

◆ GetMaxVisibleDistanceInBGArenas()

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

References _maxVisibleDistanceInBGArenas.

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

◆ GetMaxVisibleDistanceInInstances()

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

References _maxVisibleDistanceInInstances.

Referenced by InstanceMap::InitVisibilityDistance().

◆ GetMaxVisibleDistanceOnContinents()

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

References _maxVisibleDistanceOnContinents.

Referenced by Map::InitVisibilityDistance().

◆ GetNextDailyQuestsResetTime()

Seconds World::GetNextDailyQuestsResetTime ( ) const
inlineoverridevirtual

Next daily quests and random bg reset time.

Implements IWorld.

167{ return _nextDailyQuestReset; }

References _nextDailyQuestReset.

◆ GetNextRandomBGResetTime()

Seconds World::GetNextRandomBGResetTime ( ) const
inlineoverridevirtual

Implements IWorld.

169{ return _nextRandomBGReset; }

References _nextRandomBGReset.

◆ GetNextWeeklyQuestsResetTime()

Seconds World::GetNextWeeklyQuestsResetTime ( ) const
inlineoverridevirtual

Implements IWorld.

168{ return _nextWeeklyQuestReset; }

References _nextWeeklyQuestReset.

◆ GetNextWhoListUpdateDelaySecs()

uint32 World::GetNextWhoListUpdateDelaySecs ( )
overridevirtual

Implements IWorld.

1917{
1918 if (_timers[WUPDATE_5_SECS].Passed())
1919 return 1;
1920
1922 t = std::min(t, (uint32)_timers[WUPDATE_5_SECS].GetInterval());
1923
1924 return uint32(std::ceil(t / 1000.0f));
1925}
@ WUPDATE_5_SECS
Definition World.h:67
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.

◆ GetPlayerSecurityLimit()

AccountTypes World::GetPlayerSecurityLimit ( ) const
inlineoverridevirtual

Security level limitations.

Implements IWorld.

151{ return _allowedSecurityLevel; }

References _allowedSecurityLevel.

◆ getRate()

float World::getRate ( ServerConfigs  index) const
overridevirtual

Implements IWorld.

1379{
1380 return getFloatConfig(index);
1381}
float getFloatConfig(ServerConfigs index) const override
Definition World.cpp:1398

References getFloatConfig().

Referenced by LoadConfigSettings().

◆ GetRealmName()

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

Implements IWorld.

240{ return _realmName; } // pussywizard
std::string _realmName
Definition World.h:289

References _realmName.

◆ GetShutDownTimeLeft()

uint32 World::GetShutDownTimeLeft ( ) const
inlineoverridevirtual

Implements IWorld.

183{ return _shutdownTimer; }

References _shutdownTimer.

◆ getStringConfig()

std::string_view World::getStringConfig ( ServerConfigs  index) const
overridevirtual

Implements IWorld.

1419{
1420 return _worldConfig.GetConfigValue(index);
1421}

References _worldConfig, and ConfigValueCache< ConfigEnum >::GetConfigValue().

◆ InitCalendarOldEventsDeletionTime()

void World::InitCalendarOldEventsDeletionTime ( )
protected
1726{
1728 Seconds nextDeletionTime = currentDeletionTime > 0s ? currentDeletionTime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, getIntConfig(CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR)));
1729
1730 if (currentDeletionTime == 0s)
1731 {
1732 sWorldState->setWorldState(WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME, nextDeletionTime.count());
1733 }
1734}

References CONFIG_CALENDAR_DELETE_OLD_EVENTS_HOUR, getIntConfig(), Acore::Time::GetNextTimeWithDayAndHour(), sWorldState, and WORLD_STATE_CUSTOM_DAILY_CALENDAR_DELETION_OLD_EVENTS_TIME.

Referenced by SetInitialWorldSettings().

◆ InitDailyQuestResetTime()

void World::InitDailyQuestResetTime ( )
protected
1693{
1696
1697 if (wstime == 0s)
1698 {
1700 }
1701}
@ WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME
Definition WorldStateDefines.h:610

References _nextDailyQuestReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorldState, and WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitGuildResetTime()

void World::InitGuildResetTime ( )
protected
1737{
1739 _nextGuildReset = wstime > 0s ? wstime : Seconds(Acore::Time::GetNextTimeWithDayAndHour(-1, 6));
1740
1741 if (wstime == 0s)
1742 {
1744 }
1745}
@ WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME
Definition WorldStateDefines.h:611

References _nextGuildReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorldState, and WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitMonthlyQuestResetTime()

void World::InitMonthlyQuestResetTime ( )
protected
1704{
1707
1708 if (wstime == 0s)
1709 {
1711 }
1712}
@ WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME
Definition WorldStateDefines.h:612

References _nextMonthlyQuestReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorldState, and WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitRandomBGResetTime()

void World::InitRandomBGResetTime ( )
protected
1715{
1718
1719 if (wstime == 0s)
1720 {
1722 }
1723}
@ CONFIG_RANDOM_BG_RESET_HOUR
Definition WorldConfig.h:318
@ WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME
Definition WorldStateDefines.h:608

References _nextRandomBGReset, CONFIG_RANDOM_BG_RESET_HOUR, getIntConfig(), Acore::Time::GetNextTimeWithDayAndHour(), sWorldState, and WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ InitWeeklyQuestResetTime()

void World::InitWeeklyQuestResetTime ( )
protected
1682{
1685
1686 if (wstime == 0s)
1687 {
1689 }
1690}
@ WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME
Definition WorldStateDefines.h:607

References _nextWeeklyQuestReset, Acore::Time::GetNextTimeWithDayAndHour(), sWorldState, and WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME.

Referenced by SetInitialWorldSettings().

◆ instance()

static World * World::instance ( )
static

◆ IsClosed()

bool World::IsClosed ( ) const
overridevirtual

Deny clients?

Implements IWorld.

154{
155 return _isClosed;
156}

References _isClosed.

◆ IsFFAPvPRealm()

bool World::IsFFAPvPRealm ( ) const
overridevirtual

Implements IWorld.

1912{
1914}
@ REALM_TYPE_FFA_PVP
Definition Realm.h:62
@ CONFIG_GAME_TYPE
Definition WorldConfig.h:177

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.

1907{
1909}
@ REALM_TYPE_RPPVP
Definition Realm.h:58
@ REALM_TYPE_PVP
Definition Realm.h:55

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.

182{ return _shutdownTimer > 0; }

References _shutdownTimer.

◆ IsStopped()

static bool World::IsStopped ( )
inlinestatic

◆ 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 the "Data" directory from the config file

Implements IWorld.

168{
169 if (reload)
170 {
171 if (!sConfigMgr->Reload())
172 {
173 LOG_ERROR("server.loading", "World settings reload fail: can't read settings.");
174 return;
175 }
176
177 sLog->LoadFromConfig();
178 sMetric->LoadFromConfigs();
179 }
180
181 // Set realm id and enable db logging
182 sLog->SetRealmId(realm.Id.Realm);
183
184 sScriptMgr->OnBeforeConfigLoad(reload);
185
186 // load update time related configs
188
190 if (!reload)
191 sWorldSessionMgr->SetPlayerAmountLimit(sConfigMgr->GetOption<int32>("PlayerLimit", 1000));
192
193 _worldConfig.Initialize(reload);
194
195 for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
197
198 for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
200
201 if (reload)
202 {
203 sMapMgr->SetMapUpdateInterval(getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
204
207
210
213 }
214
216 {
218 LOG_INFO("server.loading", "Client cache version set to: {}", _dbClientCacheVersion);
219 }
220
221 //visibility on continents
222 _maxVisibleDistanceOnContinents = sConfigMgr->GetOption<float>("Visibility.Distance.Continents", DEFAULT_VISIBILITY_DISTANCE);
224 {
225 LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be less max aggro radius {}", 45 * getRate(RATE_CREATURE_AGGRO));
227 }
229 {
230 LOG_ERROR("server.loading", "Visibility.Distance.Continents can't be greater {}", MAX_VISIBILITY_DISTANCE);
232 }
233
234 //visibility in instances
235 _maxVisibleDistanceInInstances = sConfigMgr->GetOption<float>("Visibility.Distance.Instances", DEFAULT_VISIBILITY_INSTANCE);
237 {
238 LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be less max aggro radius {}", 45 * getRate(RATE_CREATURE_AGGRO));
240 }
242 {
243 LOG_ERROR("server.loading", "Visibility.Distance.Instances can't be greater {}", MAX_VISIBILITY_DISTANCE);
245 }
246
247 //visibility in BG/Arenas
248 _maxVisibleDistanceInBGArenas = sConfigMgr->GetOption<float>("Visibility.Distance.BGArenas", DEFAULT_VISIBILITY_BGARENAS);
250 {
251 LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be less max aggro radius {}", 45 * getRate(RATE_CREATURE_AGGRO));
253 }
255 {
256 LOG_ERROR("server.loading", "Visibility.Distance.BGArenas can't be greater {}", MAX_VISIBILITY_DISTANCE);
258 }
259
260 LOG_INFO("server.loading", "Will clear `logs` table of entries older than {} seconds every {} minutes.",
262
264 std::string dataPath = sConfigMgr->GetOption<std::string>("DataDir", "./");
265 if (dataPath.empty() || (dataPath.at(dataPath.length() - 1) != '/' && dataPath.at(dataPath.length() - 1) != '\\'))
266 dataPath.push_back('/');
267
268#if AC_PLATFORM == AC_PLATFORM_UNIX || AC_PLATFORM == AC_PLATFORM_APPLE
269 if (dataPath[0] == '~')
270 {
271 char const* home = getenv("HOME");
272 if (home)
273 dataPath.replace(0, 1, home);
274 }
275#endif
276
277 if (reload)
278 {
279 if (dataPath != _dataPath)
280 LOG_ERROR("server.loading", "DataDir option can't be changed at worldserver.conf reload, using current value ({}).", _dataPath);
281 }
282 else
283 {
284 _dataPath = dataPath;
285 LOG_INFO("server.loading", "Using DataDir {}", _dataPath);
286 }
287
288 bool const enableIndoor = getBoolConfig(CONFIG_VMAP_INDOOR_CHECK);
289 bool const enableLOS = getBoolConfig(CONFIG_VMAP_ENABLE_LOS);
290 bool const enablePetLOS = getBoolConfig(CONFIG_PET_LOS);
291 bool const enableHeight = getBoolConfig(CONFIG_VMAP_ENABLE_HEIGHT);
292 if (!enableHeight)
293 LOG_ERROR("server.loading", "VMap height checking disabled! Creatures movements and other various things WILL be broken! Expect no support.");
294
297 LOG_INFO("server.loading", "WORLD: VMap support included. LineOfSight:{}, getHeight:{}, indoorCheck:{} PetLOS:{}", enableLOS, enableHeight, enableIndoor, enablePetLOS);
298
299 // call ScriptMgr if we're reloading the configuration
300 sScriptMgr->OnAfterConfigLoad(reload);
301}
constexpr auto IN_MILLISECONDS
Definition Common.h:53
constexpr auto MINUTE
Definition Common.h:47
#define sLog
Definition Log.h:127
#define sMapMgr
Definition MapMgr.h:220
#define sMetric
Definition Metric.h:134
#define MAX_VISIBILITY_DISTANCE
Definition ObjectDefines.h:30
#define DEFAULT_VISIBILITY_DISTANCE
Definition ObjectDefines.h:39
#define DEFAULT_VISIBILITY_BGARENAS
Definition ObjectDefines.h:42
#define DEFAULT_VISIBILITY_INSTANCE
Definition ObjectDefines.h:40
#define sScriptMgr
Definition ScriptMgr.h:743
#define MAX_MOVE_TYPE
Definition UnitDefines.h:367
float baseMoveSpeed[MAX_MOVE_TYPE]
Definition Unit.cpp:80
float playerBaseMoveSpeed[MAX_MOVE_TYPE]
Definition Unit.cpp:93
WorldUpdateTime sWorldUpdateTime
Definition UpdateTime.cpp:27
@ CONFIG_VMAP_ENABLE_LOS
Definition WorldConfig.h:81
@ CONFIG_CLIENTCACHE_VERSION
Definition WorldConfig.h:314
@ RATE_CREATURE_AGGRO
Definition WorldConfig.h:479
@ CONFIG_VMAP_ENABLE_HEIGHT
Definition WorldConfig.h:82
@ CONFIG_LOGDB_CLEARTIME
Definition WorldConfig.h:312
@ CONFIG_AUTOBROADCAST_INTERVAL
Definition WorldConfig.h:325
@ RATE_MOVESPEED_PLAYER
Definition WorldConfig.h:502
@ RATE_MOVESPEED_NPC
Definition WorldConfig.h:503
@ CONFIG_VMAP_INDOOR_CHECK
Definition WorldConfig.h:80
@ CONFIG_LOGDB_CLEARINTERVAL
Definition WorldConfig.h:311
@ CONFIG_UPTIME_UPDATE
Definition WorldConfig.h:222
@ CONFIG_INTERVAL_MAPUPDATE
Definition WorldConfig.h:170
@ CONFIG_PET_LOS
Definition WorldConfig.h:83
void Initialize(bool reload)
Definition ConfigValueCache.h:45
void OverwriteConfigValue(ConfigEnum const config, T const &value)
Definition ConfigValueCache.h:86
void setEnableHeightCalc(bool pVal)
Definition IVMapMgr.h:109
void setEnableLineOfSightCalc(bool pVal)
Definition IVMapMgr.h:104
static VMapMgr2 * createOrGetVMapMgr()
Definition VMapFactory.cpp:27
void LoadFromConfig()
Definition UpdateTime.cpp:152
bool getBoolConfig(ServerConfigs index) const override
Definition World.cpp:1388
float getRate(ServerConfigs index) const override
Definition World.cpp:1378
@ WUPDATE_CLEANDB
Definition World.h:63
@ WUPDATE_AUTOBROADCAST
Definition World.h:64
@ WUPDATE_UPTIME
Definition World.h:61

References _dataPath, _dbClientCacheVersion, _maxVisibleDistanceInBGArenas, _maxVisibleDistanceInInstances, _maxVisibleDistanceOnContinents, _timers, _worldConfig, baseMoveSpeed, CONFIG_AUTOBROADCAST_INTERVAL, CONFIG_CLIENTCACHE_VERSION, CONFIG_INTERVAL_MAPUPDATE, CONFIG_LOGDB_CLEARINTERVAL, CONFIG_LOGDB_CLEARTIME, CONFIG_PET_LOS, CONFIG_UPTIME_UPDATE, CONFIG_VMAP_ENABLE_HEIGHT, CONFIG_VMAP_ENABLE_LOS, CONFIG_VMAP_INDOOR_CHECK, VMAP::VMapFactory::createOrGetVMapMgr(), DEFAULT_VISIBILITY_BGARENAS, DEFAULT_VISIBILITY_DISTANCE, DEFAULT_VISIBILITY_INSTANCE, getBoolConfig(), getIntConfig(), getRate(), Realm::Id, IN_MILLISECONDS, ConfigValueCache< ConfigEnum >::Initialize(), WorldUpdateTime::LoadFromConfig(), LOG_ERROR, LOG_INFO, MAX_MOVE_TYPE, MAX_VISIBILITY_DISTANCE, MINUTE, ConfigValueCache< ConfigEnum >::OverwriteConfigValue(), playerBaseMoveSpeed, RATE_CREATURE_AGGRO, RATE_MOVESPEED_NPC, RATE_MOVESPEED_PLAYER, realm, RealmHandle::Realm, IntervalTimer::Reset(), sConfigMgr, VMAP::IVMapMgr::setEnableHeightCalc(), VMAP::IVMapMgr::setEnableLineOfSightCalc(), IntervalTimer::SetInterval(), sLog, sMapMgr, sMetric, sScriptMgr, sWorldSessionMgr, sWorldUpdateTime, WUPDATE_AUTOBROADCAST, WUPDATE_CLEANDB, and WUPDATE_UPTIME.

Referenced by SetInitialWorldSettings().

◆ LoadDBAllowedSecurityLevel()

void World::LoadDBAllowedSecurityLevel ( )
overridevirtual

Implements IWorld.

1765{
1767 stmt->SetData(0, int32(realm.Id.Realm));
1768 PreparedQueryResult result = LoginDatabase.Query(stmt);
1769
1770 if (result)
1771 SetPlayerSecurityLimit(AccountTypes(result->Fetch()->Get<uint8>()));
1772}
AccountTypes
Definition Common.h:56
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition DatabaseEnvFwd.h:45
@ LOGIN_SEL_REALMLIST_SECURITY_LEVEL
Definition LoginDatabase.h:100
void SetPlayerSecurityLimit(AccountTypes sec) override
Definition World.cpp:1774

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.

1874{
1875 QueryResult result = WorldDatabase.Query("SELECT db_version, cache_id FROM version LIMIT 1");
1876 if (result)
1877 {
1878 Field* fields = result->Fetch();
1879
1880 _dbVersion = fields[0].Get<std::string>();
1881
1882 // will be overwrite by config values if different and non-0
1883 _dbClientCacheVersion = fields[1].Get<uint32>();
1884 }
1885
1886 if (_dbVersion.empty())
1887 _dbVersion = "Unknown world database.";
1888}
std::shared_ptr< ResultSet > QueryResult
Definition DatabaseEnvFwd.h:27
DatabaseWorkerPool< WorldDatabaseConnection > WorldDatabase
Accessor to the world database.
Definition DatabaseEnv.cpp:20
std::enable_if_t< std::is_arithmetic_v< T >, T > Get() const
Definition Field.h:112

References _dbClientCacheVersion, _dbVersion, Field::Get(), and WorldDatabase.

◆ ProcessCliCommands()

void World::ProcessCliCommands ( )
overridevirtual

Implements IWorld.

1637{
1638 CliCommandHolder::Print zprint = nullptr;
1639 void* callbackArg = nullptr;
1640 CliCommandHolder* command = nullptr;
1641 while (_cliCmdQueue.next(command))
1642 {
1643 LOG_DEBUG("server.worldserver", "CLI command under processing...");
1644 zprint = command->m_print;
1645 callbackArg = command->m_callbackArg;
1646 CliHandler handler(callbackArg, zprint);
1647 handler.ParseCommands(command->m_command);
1648 if (command->m_commandFinished)
1649 command->m_commandFinished(callbackArg, !handler.HasSentErrorMessage());
1650 delete command;
1651 }
1652}
#define LOG_DEBUG(filterType__,...)
Definition Log.h:157
Definition Chat.h:256
CommandFinished m_commandFinished
Definition IWorld.h:42
void * m_callbackArg
Definition IWorld.h:39
Print m_print
Definition IWorld.h:41
void(*)(void *, std::string_view) Print
Definition IWorld.h:36
char * m_command
Definition IWorld.h:40

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
1902{
1904}
void ProcessReadyCallbacks()
Definition AsyncCallbackProcessor.h:40
QueryCallbackProcessor _queryProcessor
Definition World.h:307

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

Referenced by Update().

◆ QueueCliCommand()

void World::QueueCliCommand ( CliCommandHolder commandHolder)
inlineoverridevirtual

Implements IWorld.

221{ _cliCmdQueue.add(commandHolder); }
void add(T const &item)
Adds an item to the back of the queue.
Definition LockedQueue.h:52

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

◆ ReloadRBAC()

void World::ReloadRBAC ( )
overridevirtual

Implements IWorld.

1829{
1830 // Passive reload, we mark the data as invalidated and next time a permission is checked it will be reloaded
1831 LOG_INFO("rbac", "World::ReloadRBAC()");
1832 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1833 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1834 if (WorldSession* session = itr->second)
1835 session->InvalidateRBACData();
1836}
std::unordered_map< uint32, WorldSession * > SessionMap
Definition WorldSessionMgr.h:64
Player session in the World.
Definition WorldSession.h:409

References LOG_INFO, and sWorldSessionMgr.

◆ RescheduleShutdownForWintergrasp()

bool World::RescheduleShutdownForWintergrasp ( )
protected

Defer a pending shutdown/restart if a Wintergrasp battle is currently running. Returns true when the shutdown timer was extended (world should keep running).

1514{
1516 if (!bufferMinutes)
1517 return false;
1518
1519 // Idle shutdowns wait for an empty server anyway; don't interfere with them
1521 return false;
1522
1523 Battlefield* wg = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
1524 if (!wg || !wg->IsEnabled() || !wg->IsWarTime())
1525 return false;
1526
1527 // GetTimer() is the battle time remaining in milliseconds
1528 _shutdownTimer = wg->GetTimer() / IN_MILLISECONDS + bufferMinutes * MINUTE;
1529
1530 LOG_INFO("server.worldserver", "Server {} deferred: Wintergrasp battle in progress, rescheduled in {}",
1532
1533 sWorldSessionMgr->DoForAllOnlinePlayers([](Player* player)
1534 {
1535 LocaleConstant locale = player->GetSession()->GetSessionDbLocaleIndex();
1536 sWorldSessionMgr->SendServerMessage(SERVER_MSG_STRING, sObjectMgr->GetAcoreString(LANG_WG_SHUTDOWN_DEFERRED, locale), player);
1537 });
1538
1539 ShutdownMsg(true);
1540 return true;
1541}
#define sBattlefieldMgr
Definition BattlefieldMgr.h:79
@ BATTLEFIELD_BATTLEID_WG
Definition Battlefield.h:36
@ SERVER_MSG_STRING
Definition IWorld.h:57
@ LANG_WG_SHUTDOWN_DEFERRED
Definition Language.h:1527
#define sObjectMgr
Definition ObjectMgr.h:1730
std::string secsToTimeString(uint64 timeInSecs, bool shortText)
Definition Util.cpp:73
@ CONFIG_WINTERGRASP_DEFER_SHUTDOWN
Definition WorldConfig.h:343
Definition Battlefield.h:196
bool IsWarTime() const
Return true if battle is started, false if battle is not started.
Definition Battlefield.h:239
uint32 GetTimer() const
Definition Battlefield.h:348
bool IsEnabled() const
Return if battlefield is enabled.
Definition Battlefield.h:244
Definition Player.h:1086
WorldSession * GetSession() const
Definition Player.h:2030
@ SHUTDOWN_MASK_RESTART
Definition World.h:47

References _shutdownMask, _shutdownTimer, BATTLEFIELD_BATTLEID_WG, CONFIG_WINTERGRASP_DEFER_SHUTDOWN, getIntConfig(), Player::GetSession(), WorldSession::GetSessionDbLocaleIndex(), Battlefield::GetTimer(), IN_MILLISECONDS, Battlefield::IsEnabled(), Battlefield::IsWarTime(), LANG_WG_SHUTDOWN_DEFERRED, LOG_INFO, MINUTE, sBattlefieldMgr, secsToTimeString(), SERVER_MSG_STRING, SHUTDOWN_MASK_IDLE, SHUTDOWN_MASK_RESTART, ShutdownMsg(), sObjectMgr, and sWorldSessionMgr.

Referenced by _UpdateGameTime().

◆ ResetDailyQuests()

void World::ResetDailyQuests ( )
protected
1748{
1750 CharacterDatabase.Execute(stmt);
1751
1752 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1753 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1754 if (itr->second->GetPlayer())
1755 itr->second->GetPlayer()->ResetDailyQuestStatus();
1756
1759
1760 // change available dailies
1761 sPoolMgr->ChangeDailyQuests();
1762}
@ CHAR_DEL_QUEST_STATUS_DAILY
Definition CharacterDatabase.h:55
DatabaseWorkerPool< CharacterDatabaseConnection > CharacterDatabase
Accessor to the character database.
Definition DatabaseEnv.cpp:21
#define sPoolMgr
Definition PoolMgr.h:177

References _nextDailyQuestReset, CHAR_DEL_QUEST_STATUS_DAILY, CharacterDatabase, Acore::Time::GetNextTimeWithDayAndHour(), sPoolMgr, sWorldSessionMgr, sWorldState, and WORLD_STATE_CUSTOM_DAILY_QUEST_RESET_TIME.

Referenced by Update().

◆ ResetEventSeasonalQuests()

void World::ResetEventSeasonalQuests ( uint16  event_id)
overridevirtual

Implements IWorld.

1817{
1819 stmt->SetData(0, event_id);
1820 CharacterDatabase.Execute(stmt);
1821
1822 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1823 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1824 if (itr->second->GetPlayer())
1825 itr->second->GetPlayer()->ResetSeasonalQuestStatus(event_id);
1826}
@ CHAR_DEL_QUEST_STATUS_SEASONAL
Definition CharacterDatabase.h:58

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

◆ ResetGuildCap()

void World::ResetGuildCap ( )
protected
1864{
1865 LOG_INFO("server.worldserver", "Guild Daily Cap reset.");
1866
1869
1870 sGuildMgr->ResetTimes();
1871}
#define sGuildMgr
Definition GuildMgr.h:51

References _nextGuildReset, Acore::Time::GetNextTimeWithDayAndHour(), LOG_INFO, sGuildMgr, sWorldState, and WORLD_STATE_CUSTOM_GUILD_DAILY_RESET_TIME.

Referenced by Update().

◆ ResetMonthlyQuests()

void World::ResetMonthlyQuests ( )
protected
1801{
1802 LOG_INFO("server.worldserver", "Monthly quests reset for all characters.");
1803
1805 CharacterDatabase.Execute(stmt);
1806
1807 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1808 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1809 if (itr->second->GetPlayer())
1810 itr->second->GetPlayer()->ResetMonthlyQuestStatus();
1811
1814}
@ 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, CHAR_DEL_QUEST_STATUS_MONTHLY, CharacterDatabase, Acore::Time::GetNextTimeWithMonthAndHour(), LOG_INFO, sWorldSessionMgr, sWorldState, and WORLD_STATE_CUSTOM_MONTHLY_QUEST_RESET_TIME.

Referenced by Update().

◆ ResetRandomBG()

void World::ResetRandomBG ( )
protected
1839{
1840 LOG_DEBUG("server.worldserver", "Random BG status reset for all characters.");
1841
1843 CharacterDatabase.Execute(stmt);
1844
1845 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1846 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1847 if (itr->second->GetPlayer())
1848 itr->second->GetPlayer()->SetRandomWinner(false);
1849
1852}
@ CHAR_DEL_BATTLEGROUND_RANDOM
Definition CharacterDatabase.h:63

References _nextRandomBGReset, CHAR_DEL_BATTLEGROUND_RANDOM, CharacterDatabase, CONFIG_RANDOM_BG_RESET_HOUR, getIntConfig(), Acore::Time::GetNextTimeWithDayAndHour(), LOG_DEBUG, sWorldSessionMgr, sWorldState, and WORLD_STATE_CUSTOM_BG_DAILY_RESET_TIME.

Referenced by Update().

◆ ResetWeeklyQuests()

void World::ResetWeeklyQuests ( )
protected
1784{
1786 CharacterDatabase.Execute(stmt);
1787
1788 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1789 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1790 if (itr->second->GetPlayer())
1791 itr->second->GetPlayer()->ResetWeeklyQuestStatus();
1792
1795
1796 // change available weeklies
1797 sPoolMgr->ChangeWeeklyQuests();
1798}
@ CHAR_DEL_QUEST_STATUS_WEEKLY
Definition CharacterDatabase.h:56

References _nextWeeklyQuestReset, CHAR_DEL_QUEST_STATUS_WEEKLY, CharacterDatabase, Acore::Time::GetNextTimeWithDayAndHour(), sPoolMgr, sWorldSessionMgr, sWorldState, and WORLD_STATE_CUSTOM_WEEKLY_QUEST_RESET_TIME.

Referenced by Update().

◆ SetAllowMovement()

void World::SetAllowMovement ( bool  allow)
inlineoverridevirtual

Allow/Disallow object movements.

Implements IWorld.

159{ _allowMovement = allow; }

References _allowMovement.

◆ setBoolConfig()

void World::setBoolConfig ( ServerConfigs  index,
bool  value 
)
overridevirtual

Implements IWorld.

1384{
1385 _worldConfig.OverwriteConfigValue<bool>(index, value);
1386}

References _worldConfig, and ConfigValueCache< ConfigEnum >::OverwriteConfigValue().

◆ SetCleaningFlags()

void World::SetCleaningFlags ( uint32  flags)
inlineoverridevirtual

Implements IWorld.

236{ _cleaningFlags = flags; }

References _cleaningFlags.

◆ SetClosed()

void World::SetClosed ( bool  val)
overridevirtual

Close world.

Implements IWorld.

159{
160 _isClosed = val;
161
162 // Invert the value, for simplicity for scripters.
163 sScriptMgr->OnOpenStateChange(!val);
164}

References _isClosed, and sScriptMgr.

◆ setFloatConfig()

void World::setFloatConfig ( ServerConfigs  index,
float  value 
)
overridevirtual

Implements IWorld.

1394{
1395 _worldConfig.OverwriteConfigValue<float>(index, value);
1396}

References _worldConfig, and ConfigValueCache< ConfigEnum >::OverwriteConfigValue().

Referenced by setRate().

◆ 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 Battlegrounds
  • Initialize outdoor pvp

Implements IWorld.

305{
307 uint32 startupBegin = getMSTime();
308
310 srand((unsigned int)GameTime::GetGameTime().count());
311
313 dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
314
319
322
325
327 sObjectMgr->SetHighestGuids();
328
329 if (!sConfigMgr->isDryRun())
330 {
332 if (!MapMgr::ExistMapAndVMap(MAP_EASTERN_KINGDOMS, -6240.32f, 331.033f)
333 || !MapMgr::ExistMapAndVMap(MAP_EASTERN_KINGDOMS, -8949.95f, -132.493f)
334 || !MapMgr::ExistMapAndVMap(MAP_KALIMDOR, -618.518f, -4251.67f)
335 || !MapMgr::ExistMapAndVMap(MAP_EASTERN_KINGDOMS, 1676.35f, 1677.45f)
336 || !MapMgr::ExistMapAndVMap(MAP_KALIMDOR, 10311.3f, 832.463f)
337 || !MapMgr::ExistMapAndVMap(MAP_KALIMDOR, -2917.58f, -257.98f)
339 !MapMgr::ExistMapAndVMap(MAP_OUTLAND, 10349.6f, -6357.29f) ||
340 !MapMgr::ExistMapAndVMap(MAP_OUTLAND, -3961.64f, -13931.2f))))
341 {
342 LOG_ERROR("server.loading", "Failed to find map files for starting areas");
343 exit(1);
344 }
345 }
346
348 sPoolMgr->Initialize();
349
351 sGameEventMgr->Initialize();
352
354 LOG_INFO("server.loading", " ");
355 LOG_INFO("server.loading", "Loading Acore Strings...");
356 if (!sObjectMgr->LoadAcoreStrings())
357 exit(1); // Error message displayed in function already
358
359 LOG_INFO("server.loading", "Loading Module Strings...");
360 sObjectMgr->LoadModuleStrings();
361 LOG_INFO("server.loading", "Loading Module Strings Locale...");
362 sObjectMgr->LoadModuleStringsLocale();
363
365 //No SQL injection as values are treated as integers
366
367 // not send custom type REALM_FFA_PVP to realm list
368 uint32 server_type;
369 if (IsFFAPvPRealm())
370 server_type = REALM_TYPE_PVP;
371 else
372 server_type = getIntConfig(CONFIG_GAME_TYPE);
373
375
376 LoginDatabase.Execute("UPDATE realmlist SET icon = {}, timezone = {} WHERE id = '{}'", server_type, realm_zone, realm.Id.Realm); // One-time query
377
379 sScriptMgr->OnLoadCustomDatabaseTable();
380
382 LOG_INFO("server.loading", "Initialize Data Stores...");
385
386 // Load cinematic cameras
388
389 LOG_INFO("server.loading", "Loading Player race data...");
390 sRaceMgr->LoadRaces();
391
392 // Load IP Location Database
393 sIPLocation->Load();
394
395 LOG_INFO("server.loading", "Loading Game Graveyard...");
396 sGraveyard->LoadGraveyardFromDB();
397
398 LOG_INFO("server.loading", "Initializing PlayerDump Tables...");
400
403
404 LOG_INFO("server.loading", "Loading SpellInfo Store...");
405 sSpellMgr->LoadSpellInfoStore();
406
407 LOG_INFO("server.loading", "Loading Spell Cooldown Overrides...");
408 sSpellMgr->LoadSpellCooldownOverrides();
409
410 LOG_INFO("server.loading", "Loading SpellInfo Data Corrections...");
411 sSpellMgr->LoadSpellInfoCorrections();
412
413 LOG_INFO("server.loading", "Loading Spell Rank Data...");
414 sSpellMgr->LoadSpellRanks();
415
416 LOG_INFO("server.loading", "Loading Spell Specific And Aura State...");
417 sSpellMgr->LoadSpellSpecificAndAuraState();
418
419 LOG_INFO("server.loading", "Loading SkillLineAbilityMultiMap Data...");
420 sSpellMgr->LoadSkillLineAbilityMap();
421
422 LOG_INFO("server.loading", "Loading SpellInfo Custom Attributes...");
423 sSpellMgr->LoadSpellInfoCustomAttributes();
424
425 LOG_INFO("server.loading", "Loading Spell Jump Distances...");
426 sSpellMgr->LoadSpellJumpDistances();
427
428 LOG_INFO("server.loading", "Loading SpellInfo Immunity infos...");
429 sSpellMgr->LoadSpellInfoImmunities();
430
431 LOG_INFO("server.loading", "Loading Player Totem models...");
432 sObjectMgr->LoadPlayerTotemModels();
433
434 LOG_INFO("server.loading", "Loading Player Shapeshift models...");
435 sObjectMgr->LoadPlayerShapeshiftModels();
436
437 LOG_INFO("server.loading", "Loading GameObject Models...");
439
440 LOG_INFO("server.loading", "Loading Script Names...");
441 sObjectMgr->LoadScriptNames();
442
443 LOG_INFO("server.loading", "Loading Instance Template...");
444 sObjectMgr->LoadInstanceTemplate();
445
446 LOG_INFO("server.loading", "Loading Character Cache...");
447 sCharacterCache->LoadCharacterCacheStorage();
448
449 // Must be called before `creature_respawn`/`gameobject_respawn` tables
450 LOG_INFO("server.loading", "Loading Instances...");
451 sInstanceSaveMgr->LoadInstances();
452
453 LOG_INFO("server.loading", "Loading Broadcast Texts...");
454 sObjectMgr->LoadBroadcastTexts();
455 sObjectMgr->LoadBroadcastTextLocales();
456
457 LOG_INFO("server.loading", "Loading Localization Strings...");
458 uint32 oldMSTime = getMSTime();
459 sObjectMgr->LoadCreatureLocales();
460 sObjectMgr->LoadGameObjectLocales();
461 sObjectMgr->LoadItemLocales();
462 sObjectMgr->LoadItemSetNameLocales();
463 sObjectMgr->LoadQuestLocales();
464 sObjectMgr->LoadQuestOfferRewardLocale();
465 sObjectMgr->LoadQuestRequestItemsLocale();
466 sObjectMgr->LoadNpcTextLocales();
467 sObjectMgr->LoadPageTextLocales();
468 sObjectMgr->LoadGossipMenuItemsLocales();
469 sObjectMgr->LoadPointOfInterestLocales();
470 sObjectMgr->LoadPetNamesLocales();
471
472 sObjectMgr->SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts)
473 LOG_INFO("server.loading", ">> Localization Strings loaded in {} ms", GetMSTimeDiffToNow(oldMSTime));
474 LOG_INFO("server.loading", " ");
475
476 LOG_INFO("server.loading", "Loading Account Roles and Permissions...");
477 sAccountMgr->LoadRBAC();
478
479 LOG_INFO("server.loading", "Loading Page Texts...");
480 sObjectMgr->LoadPageTexts();
481
482 LOG_INFO("server.loading", "Loading Game Object Templates..."); // must be after LoadPageTexts
483 sObjectMgr->LoadGameObjectTemplate();
484
485 LOG_INFO("server.loading", "Loading Game Object Template Addons...");
486 sObjectMgr->LoadGameObjectTemplateAddons();
487
488 LOG_INFO("server.loading", "Loading Transport Templates...");
489 sTransportMgr->LoadTransportTemplates();
490
491 LOG_INFO("server.loading", "Loading Spell Required Data...");
492 sSpellMgr->LoadSpellRequired();
493
494 LOG_INFO("server.loading", "Loading Spell Group Types...");
495 sSpellMgr->LoadSpellGroups();
496
497 LOG_INFO("server.loading", "Loading Spell Learn Skills...");
498 sSpellMgr->LoadSpellLearnSkills(); // must be after LoadSpellRanks
499
500 LOG_INFO("server.loading", "Loading Spell Proc Conditions and Data...");
501 sSpellMgr->LoadSpellProcs();
502
503 LOG_INFO("server.loading", "Loading Spell Bonus Data...");
504 sSpellMgr->LoadSpellBonuses();
505
506 LOG_INFO("server.loading", "Loading Aggro Spells Definitions...");
507 sSpellMgr->LoadSpellThreats();
508
509 LOG_INFO("server.loading", "Loading Mixology Bonuses...");
510 sSpellMgr->LoadSpellMixology();
511
512 LOG_INFO("server.loading", "Loading Spell Group Stack Rules...");
513 sSpellMgr->LoadSpellGroupStackRules();
514
515 LOG_INFO("server.loading", "Loading NPC Texts...");
516 sObjectMgr->LoadGossipText();
517
518 LOG_INFO("server.loading", "Loading Enchant Spells Proc Datas...");
519 sSpellMgr->LoadSpellEnchantProcData();
520
521 LOG_INFO("server.loading", "Loading Item Random Enchantments Table...");
523
524 LOG_INFO("server.loading", "Loading Disables");
525 sDisableMgr->LoadDisables(); // must be before loading quests and items
526
527 LOG_INFO("server.loading", "Loading Items..."); // must be after LoadRandomEnchantmentsTable and LoadPageTexts
528 sObjectMgr->LoadItemTemplates();
529
530 LOG_INFO("server.loading", "Loading Item Set Names..."); // must be after LoadItemPrototypes
531 sObjectMgr->LoadItemSetNames();
532
533 LOG_INFO("server.loading", "Loading Creature Model Based Info Data...");
534 sObjectMgr->LoadCreatureModelInfo();
535
536 LOG_INFO("server.loading", "Loading Creature Custom IDs Config...");
537 sObjectMgr->LoadCreatureCustomIDs();
538
539 LOG_INFO("server.loading", "Loading Creature Templates...");
540 sObjectMgr->LoadCreatureTemplates();
541
542 LOG_INFO("server.loading", "Loading Equipment Templates..."); // must be after LoadCreatureTemplates
543 sObjectMgr->LoadEquipmentTemplates();
544
545 LOG_INFO("server.loading", "Loading Creature Template Addons...");
546 sObjectMgr->LoadCreatureTemplateAddons();
547
548 LOG_INFO("server.loading", "Loading Reputation Reward Rates...");
549 sObjectMgr->LoadReputationRewardRate();
550
551 LOG_INFO("server.loading", "Loading Creature Reputation OnKill Data...");
552 sObjectMgr->LoadReputationOnKill();
553
554 LOG_INFO("server.loading", "Loading Reputation Spillover Data..." );
555 sObjectMgr->LoadReputationSpilloverTemplate();
556
557 LOG_INFO("server.loading", "Loading Points Of Interest Data...");
558 sObjectMgr->LoadPointsOfInterest();
559
560 LOG_INFO("server.loading", "Loading Creature Base Stats...");
561 sObjectMgr->LoadCreatureClassLevelStats();
562
563 LOG_INFO("server.loading", "Loading Spawn Group Templates...");
564 sObjectMgr->LoadSpawnGroupTemplates();
565
566 LOG_INFO("server.loading", "Loading Creature Data...");
567 sObjectMgr->LoadCreatures();
568
569 LOG_INFO("server.loading", "Loading Creature sparring...");
570 sObjectMgr->LoadCreatureSparring();
571
572 LOG_INFO("server.loading", "Loading Temporary Summon Data...");
573 sObjectMgr->LoadTempSummons(); // must be after LoadCreatureTemplates() and LoadGameObjectTemplates()
574
575 LOG_INFO("server.loading", "Loading Gameobject Summon Data...");
576 sObjectMgr->LoadGameObjectSummons(); // must be after LoadCreatureTemplates() and LoadGameObjectTemplates()
577
578 LOG_INFO("server.loading", "Loading Pet Levelup Spells...");
579 sSpellMgr->LoadPetLevelupSpellMap();
580
581 LOG_INFO("server.loading", "Loading Pet default Spells additional to Levelup Spells...");
582 sSpellMgr->LoadPetDefaultSpells();
583
584 LOG_INFO("server.loading", "Loading Creature Addon Data...");
585 sObjectMgr->LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures()
586
587 LOG_INFO("server.loading", "Loading Creature Movement Overrides...");
588 sObjectMgr->LoadCreatureMovementOverrides(); // must be after LoadCreatures()
589
590 LOG_INFO("server.loading", "Loading Gameobject Data...");
591 sObjectMgr->LoadGameobjects();
592
593 LOG_INFO("server.loading", "Loading Spawn Group Data...");
594 sObjectMgr->LoadSpawnGroups(); // must be after LoadCreatures() and LoadGameobjects()
595
596 LOG_INFO("server.loading", "Loading GameObject Addon Data...");
597 sObjectMgr->LoadGameObjectAddons(); // must be after LoadGameObjectTemplate() and LoadGameobjects()
598
599 LOG_INFO("server.loading", "Loading GameObject Quest Items...");
600 sObjectMgr->LoadGameObjectQuestItems();
601
602 LOG_INFO("server.loading", "Loading Creature Quest Items...");
603 sObjectMgr->LoadCreatureQuestItems();
604
605 LOG_INFO("server.loading", "Loading Creature Linked Respawn...");
606 sObjectMgr->LoadLinkedRespawn(); // must be after LoadCreatures(), LoadGameObjects()
607
608 LOG_INFO("server.loading", "Loading Weather Data...");
610
611 LOG_INFO("server.loading", "Loading Quests...");
612 sObjectMgr->LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables
613
614 LOG_INFO("server.loading", "Checking Quest Disables");
615 sDisableMgr->CheckQuestDisables(); // must be after loading quests
616
617 LOG_INFO("server.loading", "Loading Quest POI");
618 sObjectMgr->LoadQuestPOI();
619
620 LOG_INFO("server.loading", "Loading Quests Starters and Enders...");
621 sObjectMgr->LoadQuestStartersAndEnders(); // must be after quest load
622
623 LOG_INFO("server.loading", "Loading Quest Greetings...");
624 sObjectMgr->LoadQuestGreetings(); // must be loaded after creature_template, gameobject_template tables
625 LOG_INFO("server.loading", "Loading Quest Greeting Locales...");
626 sObjectMgr->LoadQuestGreetingsLocales(); // must be loaded after creature_template, gameobject_template tables, quest_greeting
627
628 LOG_INFO("server.loading", "Loading Quest Money Rewards...");
629 sObjectMgr->LoadQuestMoneyRewards();
630
631 LOG_INFO("server.loading", "Loading Objects Pooling Data...");
632 sPoolMgr->LoadFromDB();
633
634 LOG_INFO("server.loading", "Loading Game Event Data..."); // must be after loading pools fully
635 sGameEventMgr->LoadHolidayDates(); // Must be after loading DBC
636 sGameEventMgr->LoadFromDB(); // Must be after loading holiday dates
637
638 LOG_INFO("server.loading", "Loading UNIT_NPC_FLAG_SPELLCLICK Data..."); // must be after LoadQuests
639 sObjectMgr->LoadNPCSpellClickSpells();
640
641 LOG_INFO("server.loading", "Loading Vehicle Template Accessories...");
642 sObjectMgr->LoadVehicleTemplateAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
643
644 LOG_INFO("server.loading", "Loading Vehicle Accessories...");
645 sObjectMgr->LoadVehicleAccessories(); // must be after LoadCreatureTemplates() and LoadNPCSpellClickSpells()
646
647 LOG_INFO("server.loading", "Loading Vehicle Seat Addon Data...");
648 sObjectMgr->LoadVehicleSeatAddon(); // must be after loading DBC
649
650 LOG_INFO("server.loading", "Loading SpellArea Data..."); // must be after quest load
651 sSpellMgr->LoadSpellAreas();
652
653 LOG_INFO("server.loading", "Loading Area Trigger Definitions");
654 sObjectMgr->LoadAreaTriggers();
655
656 LOG_INFO("server.loading", "Loading Area Trigger Teleport Definitions...");
657 sObjectMgr->LoadAreaTriggerTeleports();
658
659 LOG_INFO("server.loading", "Loading Access Requirements...");
660 sObjectMgr->LoadAccessRequirements(); // must be after item template load
661
662 LOG_INFO("server.loading", "Loading Quest Area Triggers...");
663 sObjectMgr->LoadQuestAreaTriggers(); // must be after LoadQuests
664
665 LOG_INFO("server.loading", "Loading Tavern Area Triggers...");
666 sObjectMgr->LoadTavernAreaTriggers();
667
668 LOG_INFO("server.loading", "Loading AreaTrigger Script Names...");
669 sObjectMgr->LoadAreaTriggerScripts();
670
671 LOG_INFO("server.loading", "Loading LFG Entrance Positions..."); // Must be after areatriggers
672 sLFGMgr->LoadLFGDungeons();
673
674 LOG_INFO("server.loading", "Loading Dungeon Boss Data...");
675 sObjectMgr->LoadInstanceEncounters();
676
677 LOG_INFO("server.loading", "Loading LFG Rewards...");
678 sLFGMgr->LoadRewards();
679
680 LOG_INFO("server.loading", "Loading Graveyard-Zone Links...");
681 sGraveyard->LoadGraveyardZones();
682
683 LOG_INFO("server.loading", "Loading Spell Pet Auras...");
684 sSpellMgr->LoadSpellPetAuras();
685
686 LOG_INFO("server.loading", "Loading Spell Target Coordinates...");
687 sSpellMgr->LoadSpellTargetPositions();
688
689 LOG_INFO("server.loading", "Loading Spell Cone definitions...");
690 sSpellMgr->LoadSpellCones();
691
692 LOG_INFO("server.loading", "Loading Enchant Custom Attributes...");
693 sSpellMgr->LoadEnchantCustomAttr();
694
695 LOG_INFO("server.loading", "Loading linked Spells...");
696 sSpellMgr->LoadSpellLinked();
697
698 LOG_INFO("server.loading", "Loading Player Create Data...");
699 sObjectMgr->LoadPlayerInfo();
700
701 LOG_INFO("server.loading", "Loading Exploration BaseXP Data...");
702 sObjectMgr->LoadExplorationBaseXP();
703
704 LOG_INFO("server.loading", "Loading Pet Name Parts...");
705 sObjectMgr->LoadPetNames();
706
708
709 LOG_INFO("server.loading", "Loading The Max Pet Number...");
710 sObjectMgr->LoadPetNumber();
711
712 LOG_INFO("server.loading", "Loading Pet Level Stats...");
713 sObjectMgr->LoadPetLevelInfo();
714
715 LOG_INFO("server.loading", "Loading Player Level Dependent Mail Rewards...");
716 sObjectMgr->LoadMailLevelRewards();
717
718 LOG_INFO("server.loading", "Load Mail Server definitions...");
719 sServerMailMgr->LoadMailServerTemplates();
720
721 // Loot tables
723
724 LOG_INFO("server.loading", "Loading Skill Discovery Table...");
726
727 LOG_INFO("server.loading", "Loading Skill Extra Item Table...");
729
730 LOG_INFO("server.loading", "Loading Skill Perfection Data Table...");
732
733 LOG_INFO("server.loading", "Loading Skill Fishing Base Level Requirements...");
734 sObjectMgr->LoadFishingBaseSkillLevel();
735
736 LOG_INFO("server.loading", "Loading Achievements...");
737 sAchievementMgr->LoadAchievementReferenceList();
738 LOG_INFO("server.loading", "Loading Achievement Criteria Lists...");
739 sAchievementMgr->LoadAchievementCriteriaList();
740 LOG_INFO("server.loading", "Loading Achievement Criteria Data...");
741 sAchievementMgr->LoadAchievementCriteriaData();
742 LOG_INFO("server.loading", "Loading Achievement Rewards...");
743 sAchievementMgr->LoadRewards();
744 LOG_INFO("server.loading", "Loading Achievement Reward Locales...");
745 sAchievementMgr->LoadRewardLocales();
746 LOG_INFO("server.loading", "Loading Completed Achievements...");
747 sAchievementMgr->LoadCompletedAchievements();
748
750 LOG_INFO("server.loading", "Loading Item Auctions...");
751 sAuctionMgr->LoadAuctionItems();
752 LOG_INFO("server.loading", "Loading Auctions...");
753 sAuctionMgr->LoadAuctions();
754
755 sGuildMgr->LoadGuilds();
756
757 LOG_INFO("server.loading", "Loading ArenaTeams...");
758 sArenaTeamMgr->LoadArenaTeams();
759
760 LOG_INFO("server.loading", "Loading Groups...");
761 sGroupMgr->LoadGroups();
762
763 LOG_INFO("server.loading", "Loading Reserved Names...");
764 sObjectMgr->LoadReservedPlayerNamesDB();
765 sObjectMgr->LoadReservedPlayerNamesDBC(); // Needs to be after LoadReservedPlayerNamesDB()
766
767 LOG_INFO("server.loading", "Loading Profanity Names...");
768 sObjectMgr->LoadProfanityNamesFromDB();
769 sObjectMgr->LoadProfanityNamesFromDBC(); // Needs to be after LoadProfanityNamesFromDB()
770
771 LOG_INFO("server.loading", "Loading Chat Filter...");
772 sObjectMgr->LoadChatFilter();
773
774 LOG_INFO("server.loading", "Loading GameObjects for Quests...");
775 sObjectMgr->LoadGameObjectForQuests();
776
777 LOG_INFO("server.loading", "Loading BattleMasters...");
778 sBattlegroundMgr->LoadBattleMastersEntry();
779
780 LOG_INFO("server.loading", "Loading GameTeleports...");
781 sObjectMgr->LoadGameTele();
782
783 LOG_INFO("server.loading", "Loading Trainers..."); // must be after LoadCreatureTemplates
784 sObjectMgr->LoadTrainers();
785
786 LOG_INFO("server.loading", "Loading Creature default trainers...");
787 sObjectMgr->LoadCreatureDefaultTrainers();
788
789 LOG_INFO("server.loading", "Loading Gossip Menu...");
790 sObjectMgr->LoadGossipMenu();
791
792 LOG_INFO("server.loading", "Loading Gossip Menu Options...");
793 sObjectMgr->LoadGossipMenuItems();
794
795 LOG_INFO("server.loading", "Loading Vendors...");
796 sObjectMgr->LoadVendors(); // must be after load CreatureTemplate and ItemTemplate
797
798 LOG_INFO("server.loading", "Loading Waypoints...");
799 sWaypointMgr->Load();
800
801 LOG_INFO("server.loading", "Loading Waypoint Addons...");
802 sWaypointMgr->LoadWaypointAddons();
803
804 LOG_INFO("server.loading", "Loading SmartAI Waypoints...");
805 sSmartWaypointMgr->LoadFromDB();
806
807 LOG_INFO("server.loading", "Loading Creature Formations...");
808 sFormationMgr->LoadCreatureFormations();
809
810 LOG_INFO("server.loading", "Loading WorldStates..."); // must be loaded before battleground, outdoor PvP and conditions
811 sWorldState->LoadWorldStates();
812
813 LOG_INFO("server.loading", "Loading Conditions...");
814 sConditionMgr->LoadConditions();
815
816 LOG_INFO("server.loading", "Loading Faction Change Achievement Pairs...");
817 sObjectMgr->LoadFactionChangeAchievements();
818
819 LOG_INFO("server.loading", "Loading Faction Change Spell Pairs...");
820 sObjectMgr->LoadFactionChangeSpells();
821
822 LOG_INFO("server.loading", "Loading Faction Change Item Pairs...");
823 sObjectMgr->LoadFactionChangeItems();
824
825 LOG_INFO("server.loading", "Loading Faction Change Reputation Pairs...");
826 sObjectMgr->LoadFactionChangeReputations();
827
828 LOG_INFO("server.loading", "Loading Faction Change Title Pairs...");
829 sObjectMgr->LoadFactionChangeTitles();
830
831 LOG_INFO("server.loading", "Loading Faction Change Quest Pairs...");
832 sObjectMgr->LoadFactionChangeQuests();
833
834 LOG_INFO("server.loading", "Loading GM Tickets...");
835 sTicketMgr->LoadTickets();
836
837 LOG_INFO("server.loading", "Loading GM Surveys...");
838 sTicketMgr->LoadSurveys();
839
840 LOG_INFO("server.loading", "Loading Client Addons...");
842
843 // pussywizard:
844 LOG_INFO("server.loading", "Deleting Invalid Mail Items...");
845 LOG_INFO("server.loading", " ");
846 CharacterDatabase.Execute("DELETE mi FROM mail_items mi LEFT JOIN item_instance ii ON mi.item_guid = ii.guid WHERE ii.guid IS NULL");
847 CharacterDatabase.Execute("DELETE mi FROM mail_items mi LEFT JOIN mail m ON mi.mail_id = m.id WHERE m.id IS NULL");
848 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");
849
851 LOG_INFO("server.loading", "Returning Old Mails...");
852 LOG_INFO("server.loading", " ");
853 sMailMgr->ReturnOrDeleteOldMails(false);
854
856 LOG_INFO("server.loading", "Loading Autobroadcasts...");
857 sAutobroadcastMgr->LoadAutobroadcasts();
858 sAutobroadcastMgr->LoadAutobroadcastsLocalized();
859
861 LOG_INFO("server.loading", "Loading Motd...");
862 sMotdMgr->LoadMotd();
863
865 sObjectMgr->LoadSpellScripts(); // must be after load Creature/Gameobject(Template/Data)
866 sObjectMgr->LoadEventScripts(); // must be after load Creature/Gameobject(Template/Data)
867 sObjectMgr->LoadWaypointScripts();
868
869 LOG_INFO("server.loading", "Loading Spell Script Names...");
870 sObjectMgr->LoadSpellScriptNames();
871
872 LOG_INFO("server.loading", "Loading Creature Texts...");
873 sCreatureTextMgr->LoadCreatureTexts();
874
875 LOG_INFO("server.loading", "Loading Creature Text Options...");
876 sCreatureTextMgr->LoadCreatureTextOptions();
877
878 LOG_INFO("server.loading", "Loading Creature Text Locales...");
879 sCreatureTextMgr->LoadCreatureTextLocales();
880
881 LOG_INFO("server.loading", "Loading Scripts...");
882 sScriptMgr->LoadDatabase();
883
884 LOG_INFO("server.loading", "Validating Spell Scripts...");
885 sObjectMgr->ValidateSpellScripts();
886
887 LOG_INFO("server.loading", "Loading SmartAI Scripts...");
888 sSmartScriptMgr->LoadSmartAIFromDB();
889
890 LOG_INFO("server.loading", "Loading Calendar Data...");
891 sCalendarMgr->LoadFromDB();
892
893 LOG_INFO("server.loading", "Initializing SpellInfo Precomputed Data..."); // must be called after loading items, professions, spells and pretty much anything
894 LOG_INFO("server.loading", " ");
895 sObjectMgr->InitializeSpellInfoPrecomputedData();
896
897 LOG_INFO("server.loading", "Initialize Commands...");
899
901 LOG_INFO("server.loading", "Initialize Game Time and Timers");
902 LOG_INFO("server.loading", " ");
903
905 stmt->SetData(0, realm.Id.Realm);
906 stmt->SetData(1, uint32(GameTime::GetStartTime().count()));
908 LoginDatabase.Execute(stmt);
909
911 //Update "uptime" table based on configuration entry in minutes.
912
914 // clean logs table every 14 days by default
916
918
919 // our speed up
921
922 _timers[WUPDATE_WHO_LIST].SetInterval(5 * IN_MILLISECONDS); // update who list cache every 5 seconds
923
925
927 LOG_INFO("server.loading", "Starting Map System");
928 LOG_INFO("server.loading", " ");
929 sMapMgr->Initialize();
930
931 LOG_INFO("server.loading", "Starting Game Event system...");
932 LOG_INFO("server.loading", " ");
933 uint32 nextGameEvent = sGameEventMgr->StartSystem();
934 _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent); //depend on next event
935
936 LOG_INFO("server.loading", "Loading WorldState...");
937 sWorldState->Load(); // must be called after loading game events
938
939 // Delete all characters which have been deleted X days before
941
942 // Delete all items which have been deleted X days before
944
945 // Delete all custom channels which haven't been used for PreserveCustomChannelDuration days.
947
948 LOG_INFO("server.loading", "Initializing Opcodes...");
950
951 LOG_INFO("server.loading", "Loading Arena Season Rewards...");
952 sArenaSeasonMgr->LoadRewards();
953 LOG_INFO("server.loading", "Loading Active Arena Season...");
954 sArenaSeasonMgr->LoadActiveSeason();
955
956 sTicketMgr->Initialize();
957
959 LOG_INFO("server.loading", "Starting Battleground System");
960 sBattlegroundMgr->LoadBattlegroundTemplates();
961 sBattlegroundMgr->InitAutomaticArenaPointDistribution();
962
964 LOG_INFO("server.loading", "Starting Outdoor PvP System");
965 sOutdoorPvPMgr->InitOutdoorPvP();
966
968 LOG_INFO("server.loading", "Starting Battlefield System");
969 sBattlefieldMgr->InitBattlefield();
970
971 LOG_INFO("server.loading", "Loading Transports...");
972 sTransportMgr->SpawnContinentTransports();
973
975 LOG_INFO("server.loading", "Loading Warden Checks..." );
976 sWardenCheckMgr->LoadWardenChecks();
977
978 LOG_INFO("server.loading", "Loading Warden Action Overrides..." );
979 sWardenCheckMgr->LoadWardenOverrides();
980
981 LOG_INFO("server.loading", "Deleting Expired Bans...");
982 LoginDatabase.Execute("DELETE FROM ip_banned WHERE unbandate <= UNIX_TIMESTAMP() AND unbandate<>bandate"); // One-time query
983
984 LOG_INFO("server.loading", "Calculate Next Daily Quest Reset Time...");
986
987 LOG_INFO("server.loading", "Calculate Next Weekly Quest Reset Time..." );
989
990 LOG_INFO("server.loading", "Calculate Next Monthly Quest Reset Time...");
992
993 LOG_INFO("server.loading", "Calculate Random Battleground Reset Time..." );
995
996 LOG_INFO("server.loading", "Calculate Deletion Of Old Calendar Events Time...");
998
999 LOG_INFO("server.loading", "Calculate Guild Cap Reset Time...");
1000 LOG_INFO("server.loading", " ");
1002
1003 LOG_INFO("server.loading", "Load Petitions...");
1004 sPetitionMgr->LoadPetitions();
1005
1006 LOG_INFO("server.loading", "Load Petition Signs...");
1007 sPetitionMgr->LoadSignatures();
1008
1009 LOG_INFO("server.loading", "Load Stored Loot Items...");
1010 sLootItemStorage->LoadStorageFromDB();
1011
1012 LOG_INFO("server.loading", "Load Channel Rights...");
1014
1015 LOG_INFO("server.loading", "Load Channels...");
1017
1018 LOG_INFO("server.loading", "Loading AntiDos opcode policies");
1019 sWorldGlobals->LoadAntiDosOpcodePolicies();
1020
1021 sScriptMgr->OnBeforeWorldInitialized();
1022
1024 {
1025 LOG_INFO("server.loading", "Loading All Grids For All Non-Instanced Maps...");
1026
1027 for (uint32 i = 0; i < sMapStore.GetNumRows(); ++i)
1028 {
1029 MapEntry const* mapEntry = sMapStore.LookupEntry(i);
1030
1031 if (mapEntry && !mapEntry->Instanceable())
1032 {
1033 if (sMapMgr->GetMapUpdater()->activated())
1034 sMapMgr->GetMapUpdater()->schedule_map_preload(mapEntry->MapID);
1035 else
1036 {
1037 Map* map = sMapMgr->CreateBaseMap(mapEntry->MapID);
1038
1039 if (map)
1040 {
1041 LOG_INFO("server.loading", ">> Loading All Grids For Map {}", map->GetId());
1042 map->LoadAllGrids();
1043 }
1044 }
1045 }
1046 }
1047
1048 if (sMapMgr->GetMapUpdater()->activated())
1049 sMapMgr->GetMapUpdater()->wait();
1050 }
1051
1052 uint32 startupDuration = GetMSTimeDiffToNow(startupBegin);
1053
1054 LOG_INFO("server.loading", " ");
1055 LOG_INFO("server.loading", "WORLD: World Initialized In {} Minutes {} Seconds", (startupDuration / 60000), ((startupDuration % 60000) / 1000)); // outError for red color in console
1056 LOG_INFO("server.loading", " ");
1057
1058 METRIC_EVENT("events", "World initialized", "World Initialized In " + std::to_string(startupDuration / 60000) + " Minutes " + std::to_string((startupDuration % 60000) / 1000) + " Seconds");
1059
1060 if (sConfigMgr->isDryRun())
1061 {
1062 sMapMgr->UnloadAll();
1063
1065 {
1066 LOG_FATAL("server.loading", "AzerothCore Dry Run Completed With {} Failed Database Update(s), Terminating.", failed);
1067 exit(1);
1068 }
1069
1070 LOG_INFO("server.loading", "AzerothCore Dry Run Completed, Terminating.");
1071 exit(0);
1072 }
1073}
#define sAccountMgr
Definition AccountMgr.h:93
#define sAchievementMgr
Definition AchievementMgr.h:451
@ MAP_OUTLAND
Definition AreaDefines.h:217
@ MAP_KALIMDOR
Definition AreaDefines.h:187
@ MAP_EASTERN_KINGDOMS
Definition AreaDefines.h:186
#define sArenaSeasonMgr
Definition ArenaSeasonMgr.h:124
#define sArenaTeamMgr
Definition ArenaTeamMgr.h:69
#define sAuctionMgr
Definition AuctionHouseMgr.h:224
#define sAutobroadcastMgr
Definition AutobroadcastMgr.h:54
#define sBattlegroundMgr
Definition BattlegroundMgr.h:190
#define sCharacterCache
Definition CharacterCache.h:88
#define sConditionMgr
Definition ConditionMgr.h:296
#define sFormationMgr
Definition CreatureGroups.h:130
#define sCreatureTextMgr
Definition CreatureTextMgr.h:123
uint32 GetLiquidFlags(uint32 liquidType)
Definition DBCStores.cpp:834
void LoadDBCStores(std::string const &dataPath)
Definition DBCStores.cpp:261
DBCStorage< MapEntry > sMapStore(MapEntryfmt)
#define sDisableMgr
Definition DisableMgr.h:88
#define sGraveyard
Definition GameGraveyard.h:74
void LoadGameObjectModelList(std::string const &dataPath)
Definition GameObjectModel.cpp:46
#define sGroupMgr
Definition GroupMgr.h:51
#define sIPLocation
Definition IPLocation.h:49
#define sInstanceSaveMgr
Definition InstanceSaveMgr.h:233
void LoadRandomEnchantmentsTable()
Definition ItemEnchantmentMgr.cpp:47
#define sLFGMgr
Definition LFGMgr.h:665
#define LOG_FATAL(filterType__,...)
Definition Log.h:141
@ LOGIN_INS_UPTIME
Definition LoginDatabase.h:136
#define sLootItemStorage
Definition LootItemStorage.h:73
void LoadLootTables()
Definition LootMgr.h:443
void LoadM2Cameras(std::string const &dataPath)
Definition M2Stores.cpp:173
void dtCustomFree(void *ptr)
Definition MMapMgr.h:33
void * dtCustomAlloc(std::size_t size, dtAllocHint)
Definition MMapMgr.h:28
#define sMailMgr
Definition MailMgr.h:85
#define METRIC_EVENT(category, title, description)
Definition Metric.h:189
#define sMotdMgr
Definition MotdMgr.h:52
#define sOutdoorPvPMgr
Definition OutdoorPvPMgr.h:102
#define sPetitionMgr
Definition PetitionMgr.h:104
#define sRaceMgr
Definition RaceMgr.h:52
#define sServerMailMgr
Definition ServerMailMgr.h:233
void LoadSkillDiscoveryTable()
Definition SkillDiscovery.cpp:46
void LoadSkillPerfectItemTable()
Definition SkillExtraItems.cpp:52
void LoadSkillExtraItemTable()
Definition SkillExtraItems.cpp:138
#define sSmartWaypointMgr
Definition SmartScriptMgr.h:2271
#define sSmartScriptMgr
Definition SmartScriptMgr.h:2270
#define sSpellMgr
Definition SpellMgr.h:847
#define sTicketMgr
Definition TicketMgr.h:260
uint32 GetMSTimeDiffToNow(uint32 oldMSTime)
Definition Timer.h:131
uint32 getMSTime()
Definition Timer.h:103
#define sTransportMgr
Definition TransportMgr.h:165
#define sWardenCheckMgr
Definition WardenCheckMgr.h:89
#define sWaypointMgr
Definition WaypointMgr.h:54
@ CONFIG_PRELOAD_ALL_NON_INSTANCED_MAP_GRIDS
Definition WorldConfig.h:119
@ CONFIG_REALM_ZONE
Definition WorldConfig.h:178
@ CONFIG_EXPANSION
Definition WorldConfig.h:234
@ CONFIG_DB_PING_INTERVAL
Definition WorldConfig.h:328
#define sWorldGlobals
Definition WorldGlobals.h:42
static void LoadChannelRights()
Definition ChannelMgr.cpp:166
static void LoadChannels()
Definition ChannelMgr.cpp:50
static void CleanOldChannelsInDB()
Definition Channel.cpp:141
static uint32 GetFailedUpdateCount()
Definition DBUpdater.cpp:78
static bool IsVMAPDisabledFor(uint32 entry, uint8 flags)
Definition DisableMgr.cpp:440
static bool ExistMapAndVMap(uint32 mapid, float x, float y)
Definition MapMgr.cpp:306
Definition Map.h:167
void LoadAllGrids()
Definition Map.cpp:219
uint32 GetId() const
Definition Map.h:233
static void InitializeTables()
Definition PlayerDump.cpp:253
static void DeleteOldCharacters()
Definition Player.cpp:4417
static void DeleteOldRecoveryItems()
Definition Player.cpp:4452
Definition VMapMgr2.h:55
IsVMAPDisabledForFn IsVMAPDisabledForPtr
Definition VMapMgr2.h:81
GetLiquidFlagsFn GetLiquidFlagsPtr
Definition VMapMgr2.h:78
bool IsFFAPvPRealm() const override
Definition World.cpp:1911
void LoadConfigSettings(bool reload=false) override
Initialize config values.
Definition World.cpp:167
void InitCalendarOldEventsDeletionTime()
Definition World.cpp:1725
void InitDailyQuestResetTime()
Definition World.cpp:1692
void LoadDBAllowedSecurityLevel() override
Definition World.cpp:1764
void DetectDBCLang()
Definition World.cpp:1075
void InitGuildResetTime()
Definition World.cpp:1736
void InitRandomBGResetTime()
Definition World.cpp:1714
void InitWeeklyQuestResetTime()
Definition World.cpp:1681
void InitMonthlyQuestResetTime()
Definition World.cpp:1703
OpcodeTable opcodeTable
Definition Opcodes.cpp:51
void Initialize()
Correspondence between opcodes and their names.
Definition Opcodes.cpp:123
void LoadWeatherData()
Definition WeatherMgr.cpp:44
@ WUPDATE_PINGDB
Definition World.h:66
@ WUPDATE_WHO_LIST
Definition World.h:68
void Initialize()
Definition CreatureAIRegistry.cpp:34
AC_GAME_API void LoadCommandMap()
Definition ChatCommand.cpp:535
void LoadFromDB()
Definition AddonMgr.cpp:39
void CleanDatabase()
Definition CharacterDatabaseCleaner.cpp:27
Seconds GetStartTime()
Definition GameTime.cpp:33
AC_COMMON_API char const * GetFullVersion()
Definition GitRevision.cpp:82
Definition DBCStructure.h:1325
uint32 MapID
Definition DBCStructure.h:1326
bool Instanceable() const
Definition DBCStructure.h:1353

References _dataPath, _mail_expire_check_timer, _timers, CharacterDatabase, 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, VMAP::VMapFactory::createOrGetVMapMgr(), Player::DeleteOldCharacters(), Player::DeleteOldRecoveryItems(), DetectDBCLang(), dtCustomAlloc(), dtCustomFree(), MapMgr::ExistMapAndVMap(), getBoolConfig(), GetDefaultDbcLocale(), DBUpdaterUtil::GetFailedUpdateCount(), 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(), InitMonthlyQuestResetTime(), InitRandomBGResetTime(), InitWeeklyQuestResetTime(), MapEntry::Instanceable(), IsFFAPvPRealm(), DisableMgr::IsVMAPDisabledFor(), VMAP::VMapMgr2::IsVMAPDisabledForPtr, Map::LoadAllGrids(), ChannelMgr::LoadChannelRights(), ChannelMgr::LoadChannels(), Acore::ChatCommands::LoadCommandMap(), LoadConfigSettings(), LoadDBAllowedSecurityLevel(), LoadDBCStores(), AddonMgr::LoadFromDB(), LoadGameObjectModelList(), LoadLootTables(), LoadM2Cameras(), LoadRandomEnchantmentsTable(), LoadSkillDiscoveryTable(), LoadSkillExtraItemTable(), LoadSkillPerfectItemTable(), WeatherMgr::LoadWeatherData(), LOG_ERROR, LOG_FATAL, LOG_INFO, LOGIN_INS_UPTIME, LoginDatabase, MAP_EASTERN_KINGDOMS, MAP_KALIMDOR, MAP_OUTLAND, MapEntry::MapID, METRIC_EVENT, MINUTE, opcodeTable, realm, RealmHandle::Realm, REALM_TYPE_PVP, sAccountMgr, sAchievementMgr, sArenaSeasonMgr, sArenaTeamMgr, sAuctionMgr, sAutobroadcastMgr, sBattlefieldMgr, sBattlegroundMgr, sCalendarMgr, sCharacterCache, sConditionMgr, sConfigMgr, sCreatureTextMgr, sDisableMgr, PreparedStatementBase::SetData(), IntervalTimer::SetInterval(), sFormationMgr, sGameEventMgr, sGraveyard, sGroupMgr, sGuildMgr, sInstanceSaveMgr, sIPLocation, sLFGMgr, sLootItemStorage, sMailMgr, sMapMgr, sMapStore, sMotdMgr, sObjectMgr, sOutdoorPvPMgr, sPetitionMgr, sPoolMgr, sRaceMgr, sScriptMgr, sServerMailMgr, sSmartScriptMgr, sSmartWaypointMgr, sSpellMgr, sTicketMgr, sTransportMgr, sWardenCheckMgr, sWaypointMgr, sWorldGlobals, sWorldState, WUPDATE_5_SECS, WUPDATE_AUTOBROADCAST, WUPDATE_CLEANDB, WUPDATE_EVENTS, WUPDATE_PINGDB, WUPDATE_UPTIME, and WUPDATE_WHO_LIST.

◆ setIntConfig()

void World::setIntConfig ( ServerConfigs  index,
uint32  value 
)
overridevirtual

◆ SetPlayerSecurityLimit()

void World::SetPlayerSecurityLimit ( AccountTypes  sec)
overridevirtual

Implements IWorld.

1775{
1776 AccountTypes sec = _sec < SEC_CONSOLE ? _sec : SEC_PLAYER;
1777 bool update = sec > _allowedSecurityLevel;
1779 if (update)
1781}
@ SEC_CONSOLE
Definition Common.h:61

References _allowedSecurityLevel, SEC_CONSOLE, SEC_PLAYER, and sWorldSessionMgr.

Referenced by LoadDBAllowedSecurityLevel().

◆ setRate()

void World::setRate ( ServerConfigs  index,
float  value 
)
overridevirtual

Implements IWorld.

1373{
1374 setFloatConfig(index, value);
1375}
void setFloatConfig(ServerConfigs index, float value) override
Definition World.cpp:1393

References setFloatConfig().

◆ SetRealmName()

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

Implements IWorld.

241{ _realmName = name; } // pussywizard

References _realmName.

◆ setStringConfig()

void World::setStringConfig ( ServerConfigs  index,
std::string const &  value 
)
overridevirtual

Implements IWorld.

1414{
1415 _worldConfig.OverwriteConfigValue<std::string>(index, value);
1416}

References _worldConfig, and ConfigValueCache< ConfigEnum >::OverwriteConfigValue().

◆ ShutdownCancel()

void World::ShutdownCancel ( )
overridevirtual

Cancel a planned server shutdown.

Implements IWorld.

1618{
1619 // nothing cancel or too later
1620 if (!_shutdownTimer || _stopEvent)
1621 return;
1622
1624
1625 _shutdownMask = 0;
1626 _shutdownTimer = 0;
1627 _exitCode = SHUTDOWN_EXIT_CODE; // to default value
1628 sWorldSessionMgr->SendServerMessage(msgid);
1629
1630 LOG_DEBUG("server.worldserver", "Server {} cancelled.", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restart" : "shuttingdown"));
1631
1632 sScriptMgr->OnShutdownCancel();
1633}
ServerMessageType
Definition IWorld.h:54
@ SERVER_MSG_SHUTDOWN_CANCELLED
Definition IWorld.h:58
@ SERVER_MSG_RESTART_CANCELLED
Definition IWorld.h:59
@ SHUTDOWN_EXIT_CODE
Definition World.h:53

References _exitCode, _shutdownMask, _shutdownTimer, _stopEvent, LOG_DEBUG, SERVER_MSG_RESTART_CANCELLED, SERVER_MSG_SHUTDOWN_CANCELLED, SHUTDOWN_EXIT_CODE, SHUTDOWN_MASK_RESTART, sScriptMgr, and sWorldSessionMgr.

◆ ShutdownMsg()

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

Displays a shutdown message at specific intervals or immediately if required.

Show the time remaining for a server shutdown/restart with a reason appended if one is provided. Messages are displayed at regular intervals such as every 12 hours, 1 hour, 5 minutes, 1 minute, 30 seconds, 10 seconds, and every second in the last 10 seconds.

Parameters
showForces the message to be displayed immediately.
playerThe player who should recieve the message (can be nullptr for global messages).
reasonThe reason for the shutdown, appended to the message if provided.
  • Display a message every 12 hours, hour, 5 minutes, minute, 30 seconds, 10 seconds and finally seconds

Implements IWorld.

1587{
1588 // Do not show a message for idle shutdown
1590 return;
1591
1592 bool twelveHours = (_shutdownTimer > 12 * HOUR && (_shutdownTimer % (12 * HOUR)) == 0); // > 12 h ; every 12 h
1593 bool oneHour = (_shutdownTimer < 12 * HOUR && (_shutdownTimer % HOUR) == 0); // < 12 h ; every 1 h
1594 bool fiveMin = (_shutdownTimer < 30 * MINUTE && (_shutdownTimer % (5 * MINUTE)) == 0); // < 30 min ; every 5 min
1595 bool oneMin = (_shutdownTimer < 15 * MINUTE && (_shutdownTimer % MINUTE) == 0); // < 15 min ; every 1 min
1596 bool thirtySec = (_shutdownTimer < 5 * MINUTE && (_shutdownTimer % 30) == 0); // < 5 min; every 30 sec
1597 bool tenSec = (_shutdownTimer < 1 * MINUTE && (_shutdownTimer % 10) == 0); // < 1 min; every 10 sec
1598 bool oneSec = (_shutdownTimer < 10 * SECOND && (_shutdownTimer % 1) == 0); // < 10 sec; every 1 sec
1599
1601 if (show || twelveHours || oneHour || fiveMin || oneMin || thirtySec || tenSec || oneSec)
1602 {
1603 std::string str = secsToTimeString(_shutdownTimer).append(".");
1604 if (!reason.empty())
1605 str += " - " + reason;
1606 // Display the reason every 12 hours, hour, 5 minutes, minute. At 60 seconds and at 10 seconds
1607 else if (!_shutdownReason.empty() && (twelveHours || oneHour || fiveMin || oneMin || _shutdownTimer == 60 || _shutdownTimer == 10))
1608 str += " - " + _shutdownReason;
1609
1611 sWorldSessionMgr->SendServerMessage(msgid, str, player);
1612 LOG_WARN("server.worldserver", "Server {} in {}", (_shutdownMask & SHUTDOWN_MASK_RESTART ? "restarting" : "shutdown"), str);
1613 }
1614}
constexpr auto SECOND
Definition Common.h:46
constexpr auto HOUR
Definition Common.h:48
@ SERVER_MSG_SHUTDOWN_TIME
Definition IWorld.h:55
@ SERVER_MSG_RESTART_TIME
Definition IWorld.h:56
#define LOG_WARN(filterType__,...)
Definition Log.h:149
std::string _shutdownReason
Definition World.h:268

References _shutdownMask, _shutdownReason, _shutdownTimer, HOUR, LOG_WARN, MINUTE, SECOND, secsToTimeString(), SERVER_MSG_RESTART_TIME, SERVER_MSG_SHUTDOWN_TIME, SHUTDOWN_MASK_IDLE, SHUTDOWN_MASK_RESTART, and sWorldSessionMgr.

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

◆ ShutdownServ()

void World::ShutdownServ ( uint32  time,
uint32  options,
uint8  exitcode,
std::string const &  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.

1545{
1546 // ignore if server shutdown at next tick
1547 if (IsStopped())
1548 return;
1549
1550 _shutdownMask = options;
1551 _exitCode = exitcode;
1552 _shutdownReason = reason;
1553
1554 LOG_DEBUG("server.worldserver", "Server shutdown called with ShutdownMask {}, ExitCode {}, Time {}, Reason {}", ShutdownMask(options), ShutdownExitCode(exitcode), secsToTimeString(time), reason);
1555
1557 if (time == 0)
1558 {
1559 if (!(options & SHUTDOWN_MASK_IDLE) || sWorldSessionMgr->GetActiveAndQueuedSessionCount() == 0)
1560 _stopEvent = true; // exist code already set
1561 else
1562 _shutdownTimer = 1; //So that the session count is re-evaluated at next world tick
1563 }
1565 else
1566 {
1567 _shutdownTimer = time;
1568 ShutdownMsg(true, nullptr, reason);
1569 }
1570
1571 sScriptMgr->OnShutdownInitiate(ShutdownExitCode(exitcode), ShutdownMask(options));
1572}
ShutdownExitCode
Definition World.h:52
ShutdownMask
Definition World.h:46

References _exitCode, _shutdownMask, _shutdownReason, _shutdownTimer, _stopEvent, IsStopped(), LOG_DEBUG, secsToTimeString(), SHUTDOWN_MASK_IDLE, ShutdownMsg(), sScriptMgr, and sWorldSessionMgr.

◆ 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

Clean logs table

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

Update uptime table

  • Process Game events when necessary
  • Ping to keep MySQL connections alive

Implements IWorld.

1120{
1121 METRIC_TIMER("world_update_time_total");
1122
1125 Seconds currentGameTime = GameTime::GetGameTime();
1126
1128
1129 // Record update if recording set in log and diff is greater then minimum set in log
1131
1132 DynamicVisibilityMgr::Update(sWorldSessionMgr->GetActiveSessionCount());
1133
1135 for (int i = 0; i < WUPDATE_COUNT; ++i)
1136 {
1137 if (_timers[i].GetCurrent() >= 0)
1138 _timers[i].Update(diff);
1139 else
1140 _timers[i].SetCurrent(0);
1141 }
1142
1143 // pussywizard: our speed up and functionality
1144 if (_timers[WUPDATE_5_SECS].Passed())
1145 {
1147
1148 // moved here from HandleCharEnumOpcode
1150 CharacterDatabase.Execute(stmt);
1151 }
1152
1154 if (_timers[WUPDATE_WHO_LIST].Passed())
1155 {
1156 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update who list"));
1158 sWhoListCacheMgr->Update();
1159 }
1160
1161 {
1162 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Check quest reset times"));
1163
1165 if (currentGameTime > _nextDailyQuestReset)
1166 {
1168 }
1169
1171 if (currentGameTime > _nextWeeklyQuestReset)
1172 {
1174 }
1175
1177 if (currentGameTime > _nextMonthlyQuestReset)
1178 {
1180 }
1181 }
1182
1183 if (currentGameTime > _nextRandomBGReset)
1184 {
1185 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Reset random BG"));
1186 ResetRandomBG();
1187 }
1188
1189 if (currentGameTime > _nextCalendarOldEventsDeletionTime)
1190 {
1191 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Delete old calendar events"));
1193 }
1194
1195 if (currentGameTime > _nextGuildReset)
1196 {
1197 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Reset guild cap"));
1198 ResetGuildCap();
1199 }
1200
1201 {
1202 // 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)
1203 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update expired auctions"));
1204 sAuctionMgr->Update(diff);
1205 }
1206
1207 if (currentGameTime > _mail_expire_check_timer)
1208 {
1209 sMailMgr->ReturnOrDeleteOldMails(true);
1210 _mail_expire_check_timer = currentGameTime + 6h;
1211 }
1212
1213 {
1214 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update sessions"));
1215 sWorldSessionMgr->UpdateSessions(diff);
1216 }
1217
1219 if (getIntConfig(CONFIG_LOGDB_CLEARTIME) > 0) // if not enabled, ignore the timer
1220 {
1221 if (_timers[WUPDATE_CLEANDB].Passed())
1222 {
1223 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Clean logs table"));
1224
1226
1229 stmt->SetData(1, uint32(currentGameTime.count()));
1230 LoginDatabase.Execute(stmt);
1231 }
1232 }
1233
1234 {
1235 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update LFG 0"));
1236 sLFGMgr->Update(diff, 0); // pussywizard: remove obsolete stuff before finding compatibility during map update
1237 }
1238
1239 {
1241 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update maps"));
1242 sMapMgr->Update(diff);
1243 }
1244
1246 {
1247 if (_timers[WUPDATE_AUTOBROADCAST].Passed())
1248 {
1249 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Send autobroadcast"));
1251 sAutobroadcastMgr->SendAutobroadcasts();
1252 }
1253 }
1254
1255 {
1256 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update battlegrounds"));
1257 sBattlegroundMgr->Update(diff);
1258 }
1259
1260 {
1261 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update outdoor pvp"));
1262 sOutdoorPvPMgr->Update(diff);
1263 }
1264
1265 {
1266 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update worldstate"));
1267 sWorldState->Update(diff);
1268 }
1269
1270 {
1271 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update battlefields"));
1272 sBattlefieldMgr->Update(diff);
1273 }
1274
1275 {
1276 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update LFG 2"));
1277 sLFGMgr->Update(diff, 2); // pussywizard: handle created proposals
1278 }
1279
1280 {
1281 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process query callbacks"));
1282 // execute callbacks from sql queries that were queued recently
1284 }
1285
1287 if (_timers[WUPDATE_UPTIME].Passed())
1288 {
1289 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update uptime"));
1290
1292
1294 stmt->SetData(0, uint32(GameTime::GetUptime().count()));
1295 stmt->SetData(1, uint16(sWorldSessionMgr->GetMaxPlayerCount()));
1296 stmt->SetData(2, realm.Id.Realm);
1297 stmt->SetData(3, uint32(GameTime::GetStartTime().count()));
1298 LoginDatabase.Execute(stmt);
1299
1300 // Re-assert this realm as online in case the offline flag was set externally (e.g. an authserver restart).
1301 LoginDatabasePreparedStatement* onlineStmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_REALM_ONLINE);
1302 onlineStmt->SetData(0, uint8(REALM_FLAG_OFFLINE));
1303 onlineStmt->SetData(1, realm.Id.Realm);
1304 LoginDatabase.Execute(onlineStmt);
1305 }
1306
1308 if (_timers[WUPDATE_EVENTS].Passed())
1309 {
1310 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update game events"));
1311 _timers[WUPDATE_EVENTS].Reset(); // to give time for Update() to be processed
1312 uint32 nextGameEvent = sGameEventMgr->Update();
1313 _timers[WUPDATE_EVENTS].SetInterval(nextGameEvent);
1315 }
1316
1318 if (_timers[WUPDATE_PINGDB].Passed())
1319 {
1320 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Ping MySQL"));
1322 LOG_DEBUG("sql.driver", "Ping MySQL to keep connection alive");
1323 CharacterDatabase.KeepAlive();
1324 LoginDatabase.KeepAlive();
1325 WorldDatabase.KeepAlive();
1326 }
1327
1328 {
1329 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update instance reset times"));
1330 // update the instance reset times
1331 sInstanceSaveMgr->Update();
1332 }
1333
1334 {
1335 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process cli commands"));
1336 // And last, but not least handle the issued cli commands
1338 }
1339
1340 {
1341 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update world scripts"));
1342 sScriptMgr->OnWorldUpdate(diff);
1343 }
1344
1345 if (sToCloud9Sidecar->ClusterModeEnabled())
1346 {
1347 {
1348 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process TC9 async tasks"));
1349 sToCloud9Sidecar->ProcessAsyncTasks();
1350 }
1351
1352 {
1353 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process TC9 hooks"));
1354 sToCloud9Sidecar->ProcessHooks();
1355 }
1356
1357 {
1358 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Process TC9 gRPC and HTTP requests"));
1359 sToCloud9Sidecar->ProcessGrpcOrHttpRequests();
1360 }
1361 }
1362
1363 {
1364 METRIC_TIMER("world_update_time", METRIC_TAG("type", "Update metrics"));
1365 // Stats logger update
1366 sMetric->Update();
1367 METRIC_VALUE("update_time_diff", diff);
1368 }
1369}
@ CHAR_DEL_EXPIRED_BANS
Definition CharacterDatabase.h:34
@ LOGIN_UPD_UPTIME_PLAYERS
Definition LoginDatabase.h:77
@ LOGIN_UPD_REALM_ONLINE
Definition LoginDatabase.h:78
@ LOGIN_DEL_OLD_LOGS
Definition LoginDatabase.h:79
#define METRIC_VALUE(category, value,...)
Definition Metric.h:197
#define METRIC_TAG(name, value)
Definition Metric.h:163
#define METRIC_TIMER(category,...)
Definition Metric.h:206
@ REALM_FLAG_OFFLINE
Definition Realm.h:29
#define sToCloud9Sidecar
Definition TC9Sidecar.h:76
#define sWhoListCacheMgr
Definition WhoListCacheMgr.h:96
@ CONFIG_AUTOBROADCAST
Definition WorldConfig.h:93
static void Update(uint32 sessionCount)
Definition DynamicVisibility.cpp:22
void UpdateWithDiff(uint32 diff)
Definition UpdateTime.cpp:102
void RecordUpdateTime(Milliseconds gameTimeMs, uint32 diff, uint32 sessionCount)
Definition UpdateTime.cpp:163
void ProcessCliCommands() override
Definition World.cpp:1636
void _UpdateGameTime()
Update the game time.
Definition World.cpp:1477
void ResetMonthlyQuests()
Definition World.cpp:1800
void ResetGuildCap()
Definition World.cpp:1863
void ResetWeeklyQuests()
Definition World.cpp:1783
void ResetRandomBG()
Definition World.cpp:1838
void ResetDailyQuests()
Definition World.cpp:1747
void CalendarDeleteOldEvents()
Definition World.cpp:1854
void ProcessQueryCallbacks()
Definition World.cpp:1901
@ WUPDATE_COUNT
Definition World.h:69
Milliseconds GetGameTimeMS()
Definition GameTime.cpp:43
Seconds GetUptime()
Uptime.
Definition GameTime.cpp:58
void Update(time_t diff)
Definition Timer.h:152
void SetCurrent(time_t current)
Definition Timer.h:174

References _mail_expire_check_timer, _nextCalendarOldEventsDeletionTime, _nextDailyQuestReset, _nextGuildReset, _nextMonthlyQuestReset, _nextRandomBGReset, _nextWeeklyQuestReset, _timers, _UpdateGameTime(), CalendarDeleteOldEvents(), CHAR_DEL_EXPIRED_BANS, CharacterDatabase, CONFIG_AUTOBROADCAST, CONFIG_LOGDB_CLEARTIME, getBoolConfig(), GameTime::GetGameTime(), GameTime::GetGameTimeMS(), getIntConfig(), GameTime::GetStartTime(), GameTime::GetUptime(), Realm::Id, LOG_DEBUG, LOGIN_DEL_OLD_LOGS, LOGIN_UPD_REALM_ONLINE, LOGIN_UPD_UPTIME_PLAYERS, LoginDatabase, METRIC_TAG, METRIC_TIMER, METRIC_VALUE, ProcessCliCommands(), ProcessQueryCallbacks(), realm, RealmHandle::Realm, REALM_FLAG_OFFLINE, WorldUpdateTime::RecordUpdateTime(), IntervalTimer::Reset(), ResetDailyQuests(), ResetGuildCap(), ResetMonthlyQuests(), ResetRandomBG(), ResetWeeklyQuests(), sAuctionMgr, sAutobroadcastMgr, sBattlefieldMgr, sBattlegroundMgr, IntervalTimer::SetCurrent(), PreparedStatementBase::SetData(), IntervalTimer::SetInterval(), sGameEventMgr, sInstanceSaveMgr, sLFGMgr, sMailMgr, sMapMgr, sMetric, sOutdoorPvPMgr, sScriptMgr, sToCloud9Sidecar, sWhoListCacheMgr, sWorldSessionMgr, sWorldState, sWorldUpdateTime, IntervalTimer::Update(), DynamicVisibilityMgr::Update(), UpdateTime::UpdateWithDiff(), WorldDatabase, WUPDATE_5_SECS, WUPDATE_AUTOBROADCAST, WUPDATE_CLEANDB, WUPDATE_COUNT, WUPDATE_EVENTS, WUPDATE_PINGDB, WUPDATE_UPTIME, and WUPDATE_WHO_LIST.

◆ UpdateAreaDependentAuras()

void World::UpdateAreaDependentAuras ( )
overridevirtual

Implements IWorld.

1891{
1892 WorldSessionMgr::SessionMap const& sessionMap = sWorldSessionMgr->GetAllSessions();
1893 for (WorldSessionMgr::SessionMap::const_iterator itr = sessionMap.begin(); itr != sessionMap.end(); ++itr)
1894 if (itr->second && itr->second->GetPlayer() && itr->second->GetPlayer()->IsInWorld())
1895 {
1896 itr->second->GetPlayer()->UpdateAreaDependentAuras(itr->second->GetPlayer()->GetAreaId());
1897 itr->second->GetPlayer()->UpdateZoneDependentAuras(itr->second->GetPlayer()->GetZoneId());
1898 }
1899}

References sWorldSessionMgr.

◆ UpdateRealmCharCount()

void World::UpdateRealmCharCount ( uint32  accid)
overridevirtual

Implements IWorld.

1655{
1657 stmt->SetData(0, accountId);
1658 _queryProcessor.AddCallback(CharacterDatabase.AsyncQuery(stmt).WithPreparedCallback(std::bind(&World::_UpdateRealmCharCount, this, std::placeholders::_1,accountId)));
1659}
@ CHAR_SEL_CHARACTER_COUNT
Definition CharacterDatabase.h:136
T & AddCallback(T &&query)
Definition AsyncCallbackProcessor.h:34
void _UpdateRealmCharCount(PreparedQueryResult resultCharCount, uint32 accountId)
Definition World.cpp:1661

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

Member Data Documentation

◆ _allowedSecurityLevel

AccountTypes World::_allowedSecurityLevel
private

◆ _allowMovement

bool World::_allowMovement
private

◆ _availableDbcLocaleMask

uint32 World::_availableDbcLocaleMask
private

◆ _cleaningFlags

uint32 World::_cleaningFlags
private

◆ _cliCmdQueue

LockedQueue<CliCommandHolder*> World::_cliCmdQueue
private

◆ _dataPath

std::string World::_dataPath
private

◆ _dbClientCacheVersion

uint32 World::_dbClientCacheVersion
private

◆ _dbVersion

std::string World::_dbVersion
private

Referenced by GetDBVersion(), and LoadDBVersion().

◆ _defaultDbcLocale

LocaleConstant World::_defaultDbcLocale
private

◆ _exitCode

uint8 World::_exitCode = SHUTDOWN_EXIT_CODE
staticprivate

◆ _isClosed

bool World::_isClosed
private

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

◆ _mail_expire_check_timer

Seconds World::_mail_expire_check_timer
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

◆ _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

◆ _queryProcessor

QueryCallbackProcessor World::_queryProcessor
private

◆ _realmName

std::string World::_realmName
private

Referenced by GetRealmName(), and SetRealmName().

◆ _shutdownMask

◆ _shutdownReason

std::string World::_shutdownReason
private

Referenced by ShutdownMsg(), and ShutdownServ().

◆ _shutdownTimer

◆ _stopEvent

std::atomic_long World::_stopEvent = false
staticprivate

◆ _timers

◆ _worldConfig

◆ m_worldLoopCounter

uint32 World::m_worldLoopCounter = 0
static

The documentation for this class was generated from the following files: