TrinityCore
|
#include <World.h>
Classes | |
struct | Autobroadcast |
Public Types | |
typedef std::list< WorldSession * > | Queue |
Public Member Functions | |
WorldSession * | FindSession (uint32 id) const |
Find a session by its id. More... | |
void | AddSession (WorldSession *s) |
void | AddInstanceSocket (std::weak_ptr< WorldSocket > sock, uint64 connectToKey) |
void | SendAutoBroadcast () |
bool | RemoveSession (uint32 id) |
Remove a given session. More... | |
void | UpdateMaxSessionCounters () |
Get the number of current active sessions. More... | |
SessionMap const & | GetAllSessions () const |
uint32 | GetActiveAndQueuedSessionCount () const |
uint32 | GetActiveSessionCount () const |
uint32 | GetQueuedSessionCount () const |
uint32 | GetMaxQueuedSessionCount () const |
Get the maximum number of parallel sessions on the server since last reboot. More... | |
uint32 | GetMaxActiveSessionCount () const |
uint32 | GetPlayerCount () const |
Get number of players. More... | |
uint32 | GetMaxPlayerCount () const |
void | IncreasePlayerCount () |
Increase/Decrease number of players. More... | |
void | DecreasePlayerCount () |
Player * | FindPlayerInZone (uint32 zone) |
Find a player in a specified zone. More... | |
bool | IsClosed () const |
Deny clients? More... | |
void | SetClosed (bool val) |
Close world. More... | |
AccountTypes | GetPlayerSecurityLimit () const |
Security level limitations. More... | |
void | SetPlayerSecurityLimit (AccountTypes sec) |
void | LoadDBAllowedSecurityLevel () |
void | SetPlayerAmountLimit (uint32 limit) |
Active session server limit. More... | |
uint32 | GetPlayerAmountLimit () const |
void | AddQueuedPlayer (WorldSession *) |
bool | RemoveQueuedPlayer (WorldSession *session) |
int32 | GetQueuePos (WorldSession *) |
bool | HasRecentlyDisconnected (WorldSession *) |
bool | getAllowMovement () const |
void | SetAllowMovement (bool allow) |
Allow/Disallow object movements. More... | |
void | SetMotd (std::string motd) |
Set a new Message of the Day. More... | |
std::vector< std::string > const & | GetMotd () const |
Get the current Message of the Day. More... | |
void | SetNewCharString (std::string const &str) |
Set the string for new characters (first login) More... | |
std::string const & | GetNewCharString () const |
Get the string for new characters (first login) More... | |
LocaleConstant | GetDefaultDbcLocale () const |
std::string const & | GetDataPath () const |
Get the path where data (dbc, maps) are stored on disk. More... | |
time_t | GetNextDailyQuestsResetTime () const |
Next daily quests and random bg reset time. More... | |
time_t | GetNextWeeklyQuestsResetTime () const |
time_t | GetNextRandomBGResetTime () const |
uint16 | GetConfigMaxSkillValue () const |
Get the maximum skill level a player can reach. More... | |
void | SetInitialWorldSettings () |
Initialize the World. More... | |
void | LoadConfigSettings (bool reload=false) |
Initialize config values. More... | |
void | SendWorldText (uint32 string_id,...) |
Send a System Message to all players (except self if mentioned) More... | |
void | SendGlobalText (char const *text, WorldSession *self) |
DEPRECATED, only for debug purpose. Send a System Message to all players (except self if mentioned) More... | |
void | SendGMText (uint32 string_id,...) |
Send a System Message to all GMs (except self if mentioned) More... | |
void | SendServerMessage (ServerMessageType messageID, std::string_view stringParam={}, Player const *player=nullptr) |
Send a server message to the user(s) More... | |
void | SendGlobalMessage (WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ }) |
Send a packet to all players (except self if mentioned) More... | |
void | SendGlobalGMMessage (WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ }) |
Send a packet to all GMs (except self if mentioned) More... | |
bool | SendZoneMessage (uint32 zone, WorldPacket const *packet, WorldSession *self=nullptr, Optional< Team > team={ }) |
Send a packet to all players (or players selected team) in the zone (except self if mentioned) More... | |
void | SendZoneText (uint32 zone, const char *text, WorldSession *self=nullptr, Optional< Team > team={ }) |
Send a System Message to all players in the zone (except self if mentioned) More... | |
bool | IsShuttingDown () const |
Are we in the middle of a shutdown? More... | |
uint32 | GetShutDownTimeLeft () const |
void | ShutdownServ (uint32 time, uint32 options, uint8 exitcode, const std::string &reason=std::string()) |
Shutdown the server. More... | |
uint32 | ShutdownCancel () |
Cancel a planned server shutdown. More... | |
void | ShutdownMsg (bool show=false, Player *player=nullptr, const std::string &reason=std::string()) |
Display a shutdown message to the user(s) More... | |
void | Update (uint32 diff) |
Update the World ! More... | |
void | UpdateSessions (uint32 diff) |
void | setRate (Rates rate, float value) |
Set a server rate (see Rates) More... | |
float | getRate (Rates rate) const |
Get a server rate (see Rates) More... | |
void | setBoolConfig (WorldBoolConfigs index, bool value) |
Set a server configuration element (see #WorldConfigs) More... | |
bool | getBoolConfig (WorldBoolConfigs index) const |
Get a server configuration element (see #WorldConfigs) More... | |
void | setFloatConfig (WorldFloatConfigs index, float value) |
Set a server configuration element (see #WorldConfigs) More... | |
float | getFloatConfig (WorldFloatConfigs index) const |
Get a server configuration element (see #WorldConfigs) More... | |
void | setIntConfig (WorldIntConfigs index, uint32 value) |
Set a server configuration element (see #WorldConfigs) More... | |
uint32 | getIntConfig (WorldIntConfigs index) const |
Get a server configuration element (see #WorldConfigs) More... | |
uint64 | GetUInt64Config (WorldInt64Configs index) const |
int32 | GetPersistentWorldVariable (PersistentWorldVariable const &var) const |
void | SetPersistentWorldVariable (PersistentWorldVariable const &var, int32 value) |
void | LoadPersistentWorldVariables () |
bool | IsPvPRealm () const |
Are we on a "Player versus Player" server? More... | |
bool | IsFFAPvPRealm () const |
void | KickAll () |
Kick (and save) all players. More... | |
void | KickAllLess (AccountTypes sec) |
Kick (and save) all players with security level less sec More... | |
BanReturn | BanAccount (BanMode mode, std::string const &nameOrIP, std::string const &duration, std::string const &reason, std::string const &author) |
Ban an account or ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban. More... | |
BanReturn | BanAccount (BanMode mode, std::string const &nameOrIP, uint32 duration_secs, std::string const &reason, std::string const &author) |
Ban an account or ban an IP address, duration is in seconds if positive, otherwise permban. More... | |
bool | RemoveBanAccount (BanMode mode, std::string const &nameOrIP) |
Remove a ban from an account or IP address. More... | |
BanReturn | BanCharacter (std::string const &name, std::string const &duration, std::string const &reason, std::string const &author) |
Ban an account or ban an IP address, duration will be parsed using TimeStringToSecs if it is positive, otherwise permban. More... | |
bool | RemoveBanCharacter (std::string const &name) |
Remove a ban from a character. More... | |
void | ProcessCliCommands () |
void | QueueCliCommand (CliCommandHolder *commandHolder) |
void | ForceGameEventUpdate () |
void | UpdateRealmCharCount (uint32 accountId) |
LocaleConstant | GetAvailableDbcLocale (LocaleConstant locale) const |
void | LoadDBVersion () |
char const * | GetDBVersion () const |
void | LoadAutobroadcasts () |
void | UpdateAreaDependentAuras () |
bool | IsBattlePetJournalLockAcquired (ObjectGuid battlenetAccountGuid) |
uint32 | GetCleaningFlags () const |
void | SetCleaningFlags (uint32 flags) |
void | ResetEventSeasonalQuests (uint16 event_id, time_t eventStartTime) |
void | ReloadRBAC () |
void | RemoveOldCorpses () |
void | TriggerGuidWarning () |
void | TriggerGuidAlert () |
bool | IsGuidWarning () |
bool | IsGuidAlert () |
void | SetForcedWarModeFactionBalanceState (TeamId team, int32 reward=0) |
void | DisableForcedWarModeFactionBalanceState () |
Static Public Member Functions | |
static World * | instance () |
static uint8 | GetExitCode () |
static void | StopNow (uint8 exitcode) |
static bool | IsStopped () |
static float | GetMaxVisibleDistanceOnContinents () |
static float | GetMaxVisibleDistanceInInstances () |
static float | GetMaxVisibleDistanceInBG () |
static float | GetMaxVisibleDistanceInArenas () |
static int32 | GetVisibilityNotifyPeriodOnContinents () |
static int32 | GetVisibilityNotifyPeriodInInstances () |
static int32 | GetVisibilityNotifyPeriodInBG () |
static int32 | GetVisibilityNotifyPeriodInArenas () |
Static Public Attributes | |
static std::atomic< uint32 > | m_worldLoopCounter |
static PersistentWorldVariable const | NextCurrencyResetTimeVarId { "NextCurrencyResetTime" } |
static PersistentWorldVariable const | NextWeeklyQuestResetTimeVarId { "NextWeeklyQuestResetTime" } |
static PersistentWorldVariable const | NextBGRandomDailyResetTimeVarId { "NextBGRandomDailyResetTime" } |
static PersistentWorldVariable const | CharacterDatabaseCleaningFlagsVarId { "PersistentCharacterCleanFlags" } |
static PersistentWorldVariable const | NextGuildDailyResetTimeVarId { "NextGuildDailyResetTime" } |
static PersistentWorldVariable const | NextMonthlyQuestResetTimeVarId { "NextMonthlyQuestResetTime" } |
static PersistentWorldVariable const | NextDailyQuestResetTimeVarId { "NextDailyQuestResetTime" } |
static PersistentWorldVariable const | NextOldCalendarEventDeletionTimeVarId { "NextOldCalendarEventDeletionTime" } |
static PersistentWorldVariable const | NextGuildWeeklyResetTimeVarId { "NextGuildWeeklyResetTime" } |
Protected Member Functions | |
void | _UpdateGameTime () |
Update the game time. More... | |
void | _UpdateRealmCharCount (PreparedQueryResult resultCharCount) |
void | InitQuestResetTimes () |
void | CheckScheduledResetTimes () |
void | InitCurrencyResetTime () |
void | DailyReset () |
void | ResetWeeklyQuests () |
void | ResetMonthlyQuests () |
void | InitRandomBGResetTime () |
void | InitCalendarOldEventsDeletionTime () |
void | InitGuildResetTime () |
void | ResetRandomBG () |
void | CalendarDeleteOldEvents () |
void | ResetGuildCap () |
void | ResetCurrencyWeekCap () |
Private Types | |
typedef std::unordered_map< uint32, time_t > | DisconnectMap |
typedef std::unordered_map< uint8, Autobroadcast > | AutobroadcastContainer |
Private Member Functions | |
World () | |
World constructor. More... | |
~World () | |
World destructor. More... | |
void | AddSession_ (WorldSession *s) |
void | ProcessLinkInstanceSocket (std::pair< std::weak_ptr< WorldSocket >, uint64 > linkInfo) |
void | ProcessQueryCallbacks () |
void | SendGuidWarning () |
void | DoGuidWarningRestart () |
void | DoGuidAlertRestart () |
void | UpdateWarModeRewardValues () |
Static Private Attributes | |
static std::atomic< bool > | m_stopEvent |
static uint8 | m_ExitCode = SHUTDOWN_EXIT_CODE |
static float | m_MaxVisibleDistanceOnContinents = DEFAULT_VISIBILITY_DISTANCE |
static float | m_MaxVisibleDistanceInInstances = DEFAULT_VISIBILITY_INSTANCE |
static float | m_MaxVisibleDistanceInBG = DEFAULT_VISIBILITY_BGARENAS |
static float | m_MaxVisibleDistanceInArenas = DEFAULT_VISIBILITY_BGARENAS |
static int32 | m_visibility_notify_periodOnContinents = DEFAULT_VISIBILITY_NOTIFY_PERIOD |
static int32 | m_visibility_notify_periodInInstances = DEFAULT_VISIBILITY_NOTIFY_PERIOD |
static int32 | m_visibility_notify_periodInBG = DEFAULT_VISIBILITY_NOTIFY_PERIOD |
static int32 | m_visibility_notify_periodInArenas = DEFAULT_VISIBILITY_NOTIFY_PERIOD |
Friends | |
class | debug_commandscript |
|
private |
|
private |
typedef std::list<WorldSession*> World::Queue |
|
private |
|
private |
|
protected |
Update the game time.
Definition at line 3283 of file World.cpp.
|
protected |
void World::AddInstanceSocket | ( | std::weak_ptr< WorldSocket > | sock, |
uint64 | connectToKey | ||
) |
void World::AddQueuedPlayer | ( | WorldSession * | sess | ) |
void World::AddSession | ( | WorldSession * | s | ) |
|
private |
BanReturn World::BanCharacter | ( | std::string const & | name, |
std::string const & | duration, | ||
std::string const & | reason, | ||
std::string const & | author | ||
) |
|
protected |
|
protected |
|
protected |
void World::DisableForcedWarModeFactionBalanceState | ( | ) |
|
private |
|
private |
WorldSession * World::FindSession | ( | uint32 | id | ) | const |
void World::ForceGameEventUpdate | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
std::vector< std::string > const & World::GetMotd | ( | ) | const |
|
inline |
|
inline |
int32 World::GetPersistentWorldVariable | ( | PersistentWorldVariable const & | var | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
int32 World::GetQueuePos | ( | WorldSession * | sess | ) |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
bool World::HasRecentlyDisconnected | ( | WorldSession * | session | ) |
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
bool World::IsBattlePetJournalLockAcquired | ( | ObjectGuid | battlenetAccountGuid | ) |
bool World::IsFFAPvPRealm | ( | ) | const |
bool World::IsPvPRealm | ( | ) | const |
|
inline |
|
inlinestatic |
void World::KickAllLess | ( | AccountTypes | sec | ) |
void World::LoadAutobroadcasts | ( | ) |
void World::LoadConfigSettings | ( | bool | reload = false | ) |
Initialize config values.
Read other configuration items from the config file
Definition at line 555 of file World.cpp.
void World::LoadDBAllowedSecurityLevel | ( | ) |
void World::LoadDBVersion | ( | ) |
void World::LoadPersistentWorldVariables | ( | ) |
void World::ProcessCliCommands | ( | ) |
|
private |
|
private |
|
inline |
bool World::RemoveBanAccount | ( | BanMode | mode, |
std::string const & | nameOrIP | ||
) |
bool World::RemoveBanCharacter | ( | std::string const & | name | ) |
void World::RemoveOldCorpses | ( | ) |
bool World::RemoveQueuedPlayer | ( | WorldSession * | session | ) |
bool World::RemoveSession | ( | uint32 | id | ) |
|
protected |
void World::ResetEventSeasonalQuests | ( | uint16 | event_id, |
time_t | eventStartTime | ||
) |
|
protected |
|
protected |
|
protected |
|
protected |
void World::SendAutoBroadcast | ( | ) |
void World::SendGlobalGMMessage | ( | WorldPacket const * | packet, |
WorldSession * | self = nullptr , |
||
Optional< Team > | team = { } |
||
) |
void World::SendGlobalMessage | ( | WorldPacket const * | packet, |
WorldSession * | self = nullptr , |
||
Optional< Team > | team = { } |
||
) |
void World::SendGlobalText | ( | char const * | text, |
WorldSession * | self | ||
) |
void World::SendGMText | ( | uint32 | string_id, |
... | |||
) |
|
private |
void World::SendServerMessage | ( | ServerMessageType | messageID, |
std::string_view | stringParam = {} , |
||
Player const * | player = nullptr |
||
) |
void World::SendWorldText | ( | uint32 | string_id, |
... | |||
) |
bool World::SendZoneMessage | ( | uint32 | zone, |
WorldPacket const * | packet, | ||
WorldSession * | self = nullptr , |
||
Optional< Team > | team = { } |
||
) |
void World::SendZoneText | ( | uint32 | zone, |
const char * | text, | ||
WorldSession * | self = nullptr , |
||
Optional< Team > | team = { } |
||
) |
|
inline |
|
inline |
|
inline |
void World::SetInitialWorldSettings | ( | ) |
Initialize the World.
Initialize game time and timers
Definition at line 1733 of file World.cpp.
|
inline |
void World::SetMotd | ( | std::string | motd | ) |
|
inline |
void World::SetPersistentWorldVariable | ( | PersistentWorldVariable const & | var, |
int32 | value | ||
) |
|
inline |
void World::SetPlayerSecurityLimit | ( | AccountTypes | sec | ) |
|
inline |
uint32 World::ShutdownCancel | ( | ) |
void World::ShutdownMsg | ( | bool | show = false , |
Player * | player = nullptr , |
||
const std::string & | reason = std::string() |
||
) |
|
inlinestatic |
void World::TriggerGuidAlert | ( | ) |
void World::TriggerGuidWarning | ( | ) |
void World::Update | ( | uint32 | diff | ) |
Update the World !
Handle auctions when the timer has passed
Handle AHBot operations
Synchronize all scripts with their ids before updating the sScriptReloadMgr
Handle file changes
Handle session updates when the timer has passed
Update uptime table
Clean logs table
Handle all other objects
Definition at line 2572 of file World.cpp.
void World::UpdateMaxSessionCounters | ( | ) |
void World::UpdateRealmCharCount | ( | uint32 | accountId | ) |
void World::UpdateSessions | ( | uint32 | diff | ) |
|
private |
|
friend |
|
private |
|
private |
|
private |
|
static |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticprivate |
|
private |
|
private |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
private |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
static |
|
private |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |