TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
World.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
22 
23 #ifndef __WORLD_H
24 #define __WORLD_H
25 
26 #include "Common.h"
27 #include "Realm/Realm.h"
28 #include "ObjectGuid.h"
29 #include "Timer.h"
30 #include "SharedDefines.h"
31 #include "QueryResult.h"
32 #include "Callback.h"
33 #include "Realm/Realm.h"
34 
35 #include <atomic>
36 #include <map>
37 #include <set>
38 #include <list>
39 
40 class Object;
41 class WorldPacket;
42 class WorldSession;
43 class Player;
44 class WorldSocket;
45 class SystemMgr;
46 
47 // ServerMessages.dbc
49 {
63 };
64 
66 {
69 };
70 
72 {
76 };
77 
80 {
95 };
96 
99 {
169  CONFIG_UI_QUESTLEVELS_IN_DIALOGS, // Should we add quest levels to the title in the NPC dialogs?
182 };
183 
185 {
205 };
206 
208 {
378 };
379 
381 enum Rates
382 {
449 };
450 
452 {
453  REALM_ZONE_UNKNOWN = 0, // any language
454  REALM_ZONE_DEVELOPMENT = 1, // any language
455  REALM_ZONE_UNITED_STATES = 2, // extended-Latin
456  REALM_ZONE_OCEANIC = 3, // extended-Latin
457  REALM_ZONE_LATIN_AMERICA = 4, // extended-Latin
458  REALM_ZONE_TOURNAMENT_5 = 5, // basic-Latin at create, any at login
459  REALM_ZONE_KOREA = 6, // East-Asian
460  REALM_ZONE_TOURNAMENT_7 = 7, // basic-Latin at create, any at login
461  REALM_ZONE_ENGLISH = 8, // extended-Latin
462  REALM_ZONE_GERMAN = 9, // extended-Latin
463  REALM_ZONE_FRENCH = 10, // extended-Latin
464  REALM_ZONE_SPANISH = 11, // extended-Latin
465  REALM_ZONE_RUSSIAN = 12, // Cyrillic
466  REALM_ZONE_TOURNAMENT_13 = 13, // basic-Latin at create, any at login
467  REALM_ZONE_TAIWAN = 14, // East-Asian
468  REALM_ZONE_TOURNAMENT_15 = 15, // basic-Latin at create, any at login
469  REALM_ZONE_CHINA = 16, // East-Asian
470  REALM_ZONE_CN1 = 17, // basic-Latin at create, any at login
471  REALM_ZONE_CN2 = 18, // basic-Latin at create, any at login
472  REALM_ZONE_CN3 = 19, // basic-Latin at create, any at login
473  REALM_ZONE_CN4 = 20, // basic-Latin at create, any at login
474  REALM_ZONE_CN5 = 21, // basic-Latin at create, any at login
475  REALM_ZONE_CN6 = 22, // basic-Latin at create, any at login
476  REALM_ZONE_CN7 = 23, // basic-Latin at create, any at login
477  REALM_ZONE_CN8 = 24, // basic-Latin at create, any at login
478  REALM_ZONE_TOURNAMENT_25 = 25, // basic-Latin at create, any at login
479  REALM_ZONE_TEST_SERVER = 26, // any language
480  REALM_ZONE_TOURNAMENT_27 = 27, // basic-Latin at create, any at login
481  REALM_ZONE_QA_SERVER = 28, // any language
482  REALM_ZONE_CN9 = 29, // basic-Latin at create, any at login
483  REALM_ZONE_TEST_SERVER_2 = 30, // any language
484  REALM_ZONE_CN10 = 31, // basic-Latin at create, any at login
487  REALM_ZONE_CN1_4 = 34, // basic-Latin at create, any at login
488  REALM_ZONE_CN2_6_9 = 35, // basic-Latin at create, any at login
489  REALM_ZONE_CN3_7 = 36, // basic-Latin at create, any at login
490  REALM_ZONE_CN5_8 = 37 // basic-Latin at create, any at login
491 };
492 
494 {
495  WS_WEEKLY_QUEST_RESET_TIME = 20002, // Next weekly reset time
496  WS_BG_DAILY_RESET_TIME = 20003, // Next daily BG reset time
497  WS_CLEANING_FLAGS = 20004, // Cleaning Flags
498  WS_GUILD_DAILY_RESET_TIME = 20006, // Next guild cap reset time
499  WS_MONTHLY_QUEST_RESET_TIME = 20007, // Next monthly reset time
500  // Cata specific custom worldstates
501  WS_GUILD_WEEKLY_RESET_TIME = 20050, // Next guild week reset time
502 };
503 
504 #define MAX_CHARACTERS_PER_REALM 11
505 
508 {
509  typedef void Print(void*, const char*);
510  typedef void CommandFinished(void*, bool success);
511 
513  char *m_command;
515 
517 
518  CliCommandHolder(void* callbackArg, const char *command, Print* zprint, CommandFinished* commandFinished)
519  : m_callbackArg(callbackArg), m_command(strdup(command)), m_print(zprint), m_commandFinished(commandFinished)
520  {
521  }
522 
523  ~CliCommandHolder() { free(m_command); }
524 
525 private:
526  CliCommandHolder(CliCommandHolder const& right) = delete;
527  CliCommandHolder& operator=(CliCommandHolder const& right) = delete;
528 };
529 
530 typedef std::unordered_map<uint32, WorldSession*> SessionMap;
531 
533 {
534  std::string Name;
540  bool IsDeleted;
541 };
542 
545 {
546  public:
547  static World* instance();
548 
549  static std::atomic<uint32> m_worldLoopCounter;
550 
551  WorldSession* FindSession(uint32 id) const;
552  void AddSession(WorldSession* s);
553  void AddInstanceSocket(std::weak_ptr<WorldSocket> sock, uint64 connectToKey);
554  void SendAutoBroadcast();
555  bool RemoveSession(uint32 id);
557  void UpdateMaxSessionCounters();
558  const SessionMap& GetAllSessions() const { return m_sessions; }
559  uint32 GetActiveAndQueuedSessionCount() const { return uint32(m_sessions.size()); }
560  uint32 GetActiveSessionCount() const { return uint32(m_sessions.size() - m_QueuedPlayer.size()); }
561  uint32 GetQueuedSessionCount() const { return uint32(m_QueuedPlayer.size()); }
563  uint32 GetMaxQueuedSessionCount() const { return m_maxQueuedSessionCount; }
564  uint32 GetMaxActiveSessionCount() const { return m_maxActiveSessionCount; }
566  inline uint32 GetPlayerCount() const { return m_PlayerCount; }
567  inline uint32 GetMaxPlayerCount() const { return m_MaxPlayerCount; }
569  inline void IncreasePlayerCount()
570  {
571  m_PlayerCount++;
572  m_MaxPlayerCount = std::max(m_MaxPlayerCount, m_PlayerCount);
573  }
574  inline void DecreasePlayerCount() { m_PlayerCount--; }
575 
576  Player* FindPlayerInZone(uint32 zone);
577 
579  bool IsClosed() const;
580 
582  void SetClosed(bool val);
583 
585  AccountTypes GetPlayerSecurityLimit() const { return m_allowedSecurityLevel; }
586  void SetPlayerSecurityLimit(AccountTypes sec);
587  void LoadDBAllowedSecurityLevel();
588 
590  void SetPlayerAmountLimit(uint32 limit) { m_playerLimit = limit; }
591  uint32 GetPlayerAmountLimit() const { return m_playerLimit; }
592 
593  //player Queue
594  typedef std::list<WorldSession*> Queue;
595  void AddQueuedPlayer(WorldSession*);
596  bool RemoveQueuedPlayer(WorldSession* session);
597  int32 GetQueuePos(WorldSession*);
598  bool HasRecentlyDisconnected(WorldSession*);
599 
602  bool getAllowMovement() const { return m_allowMovement; }
604  void SetAllowMovement(bool allow) { m_allowMovement = allow; }
605 
607  void SetMotd(std::string motd);
609  std::vector<std::string> const& GetMotd() const;
610 
612  void SetNewCharString(std::string const& str) { m_newCharString = str; }
614  std::string const& GetNewCharString() const { return m_newCharString; }
615 
616  LocaleConstant GetDefaultDbcLocale() const { return m_defaultDbcLocale; }
617 
619  std::string const& GetDataPath() const { return m_dataPath; }
620 
622  time_t const& GetStartTime() const { return m_startTime; }
624  time_t const& GetGameTime() const { return m_gameTime; }
626  uint32 GetUptime() const { return uint32(m_gameTime - m_startTime); }
628  uint32 GetUpdateTime() const { return m_updateTime; }
629  void SetRecordDiffInterval(int32 t) { if (t >= 0) m_int_configs[CONFIG_INTERVAL_LOG_UPDATE] = (uint32)t; }
630 
632  time_t GetNextDailyQuestsResetTime() const { return m_NextDailyQuestReset; }
633  time_t GetNextWeeklyQuestsResetTime() const { return m_NextWeeklyQuestReset; }
634  time_t GetNextRandomBGResetTime() const { return m_NextRandomBGReset; }
635 
638  {
639  uint8 lvl = uint8(getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
640  return lvl > 60 ? 300 + ((lvl - 60) * 75) / 10 : lvl * 5;
641  }
642 
643  void SetInitialWorldSettings();
644  void LoadConfigSettings(bool reload = false);
645 
646  void SendWorldText(uint32 string_id, ...);
647  void SendGlobalText(const char* text, WorldSession* self);
648  void SendGMText(uint32 string_id, ...);
649  void SendServerMessage(ServerMessageType messageID, std::string stringParam = "", Player* player = NULL);
650  void SendGlobalMessage(WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
651  void SendGlobalGMMessage(WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
652  bool SendZoneMessage(uint32 zone, WorldPacket const* packet, WorldSession* self = nullptr, uint32 team = 0);
653  void SendZoneText(uint32 zone, const char *text, WorldSession* self = nullptr, uint32 team = 0);
654 
656  bool IsShuttingDown() const { return m_ShutdownTimer > 0; }
657  uint32 GetShutDownTimeLeft() const { return m_ShutdownTimer; }
658  void ShutdownServ(uint32 time, uint32 options, uint8 exitcode, const std::string& reason = std::string());
659  void ShutdownCancel();
660  void ShutdownMsg(bool show = false, Player* player = NULL, const std::string& reason = std::string());
661  static uint8 GetExitCode() { return m_ExitCode; }
662  static void StopNow(uint8 exitcode) { m_stopEvent = true; m_ExitCode = exitcode; }
663  static bool IsStopped() { return m_stopEvent; }
664 
665  void Update(uint32 diff);
666 
667  void UpdateSessions(uint32 diff);
669  void setRate(Rates rate, float value) { rate_values[rate]=value; }
671  float getRate(Rates rate) const { return rate_values[rate]; }
672 
675  {
676  if (index < BOOL_CONFIG_VALUE_COUNT)
677  m_bool_configs[index] = value;
678  }
679 
681  bool getBoolConfig(WorldBoolConfigs index) const
682  {
683  return index < BOOL_CONFIG_VALUE_COUNT ? m_bool_configs[index] : 0;
684  }
685 
688  {
689  if (index < FLOAT_CONFIG_VALUE_COUNT)
690  m_float_configs[index] = value;
691  }
692 
695  {
696  return index < FLOAT_CONFIG_VALUE_COUNT ? m_float_configs[index] : 0;
697  }
698 
701  {
702  if (index < INT_CONFIG_VALUE_COUNT)
703  m_int_configs[index] = value;
704  }
705 
708  {
709  return index < INT_CONFIG_VALUE_COUNT ? m_int_configs[index] : 0;
710  }
711 
712  void setWorldState(uint32 index, uint64 value);
713  uint64 getWorldState(uint32 index) const;
714  void LoadWorldStates();
715 
717  bool IsPvPRealm() const { return (getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP || getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP); }
718  bool IsFFAPvPRealm() const { return getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP; }
719 
720  void KickAll();
721  void KickAllLess(AccountTypes sec);
722  BanReturn BanAccount(BanMode mode, std::string const& nameOrIP, std::string const& duration, std::string const& reason, std::string const& author);
723  BanReturn BanAccount(BanMode mode, std::string const& nameOrIP, uint32 duration_secs, std::string const& reason, std::string const& author);
724  bool RemoveBanAccount(BanMode mode, std::string const& nameOrIP);
725  BanReturn BanCharacter(std::string const& name, std::string const& duration, std::string const& reason, std::string const& author);
726  bool RemoveBanCharacter(std::string const& name);
727 
728  // for max speed access
729  static float GetMaxVisibleDistanceOnContinents() { return m_MaxVisibleDistanceOnContinents; }
730  static float GetMaxVisibleDistanceInInstances() { return m_MaxVisibleDistanceInInstances; }
731  static float GetMaxVisibleDistanceInBGArenas() { return m_MaxVisibleDistanceInBGArenas; }
732 
733  static int32 GetVisibilityNotifyPeriodOnContinents(){ return m_visibility_notify_periodOnContinents; }
734  static int32 GetVisibilityNotifyPeriodInInstances() { return m_visibility_notify_periodInInstances; }
735  static int32 GetVisibilityNotifyPeriodInBGArenas() { return m_visibility_notify_periodInBGArenas; }
736 
737  void ProcessCliCommands();
738  void QueueCliCommand(CliCommandHolder* commandHolder) { cliCmdQueue.add(commandHolder); }
739 
740  void ForceGameEventUpdate();
741 
742  void UpdateRealmCharCount(uint32 accid);
743 
744  LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const { if (m_availableDbcLocaleMask & (1 << locale)) return locale; else return m_defaultDbcLocale; }
745 
746  // used World DB version
747  void LoadDBVersion();
748  char const* GetDBVersion() const { return m_DBVersion.c_str(); }
749 
750  void ResetTimeDiffRecord();
751  void RecordTimeDiff(std::string const& text);
752 
753  void LoadAutobroadcasts();
754 
755  void UpdateAreaDependentAuras();
756 
757  CharacterInfo const* GetCharacterInfo(ObjectGuid const& guid) const;
758  void AddCharacterInfo(ObjectGuid const& guid, uint32 accountId, std::string const& name, uint8 gender, uint8 race, uint8 playerClass, uint8 level, bool isDeleted);
759  void DeleteCharacterInfo(ObjectGuid const& guid) { _characterInfoStore.erase(guid); }
760  bool HasCharacterInfo(ObjectGuid const& guid) { return _characterInfoStore.find(guid) != _characterInfoStore.end(); }
761  void UpdateCharacterInfo(ObjectGuid const& guid, std::string const& name, uint8 gender = GENDER_NONE, uint8 race = RACE_NONE);
762  void UpdateCharacterInfoLevel(ObjectGuid const& guid, uint8 level);
763  void UpdateCharacterInfoDeleted(ObjectGuid const& guid, bool deleted, std::string const* name = nullptr);
764 
765  uint32 GetCleaningFlags() const { return m_CleaningFlags; }
766  void SetCleaningFlags(uint32 flags) { m_CleaningFlags = flags; }
767  void ResetEventSeasonalQuests(uint16 event_id);
768 
769  void ReloadRBAC();
770 
771  void RemoveOldCorpses();
772 
773  protected:
774  void _UpdateGameTime();
775  // callback for UpdateRealmCharacters
776  void _UpdateRealmCharCount(PreparedQueryResult resultCharCount);
777 
778  void InitDailyQuestResetTime();
779  void InitWeeklyQuestResetTime();
780  void InitMonthlyQuestResetTime();
781  void InitRandomBGResetTime();
782  void InitGuildResetTime();
783  void InitCurrencyResetTime();
784  void DailyReset();
785  void ResetWeeklyQuests();
786  void ResetMonthlyQuests();
787  void ResetRandomBG();
788  void ResetGuildCap();
789  void ResetCurrencyWeekCap();
790  private:
791  World();
792  ~World();
793 
794  static std::atomic<bool> m_stopEvent;
798 
800 
802 
803  time_t m_startTime;
804  time_t m_gameTime;
806  time_t mail_timer;
808  uint32 m_updateTime, m_updateTimeSum;
811 
813  typedef std::unordered_map<uint32, time_t> DisconnectMap;
814  DisconnectMap m_disconnects;
819 
820  std::string m_newCharString;
821 
822  float rate_values[MAX_RATES];
824  bool m_bool_configs[BOOL_CONFIG_VALUE_COUNT];
825  float m_float_configs[FLOAT_CONFIG_VALUE_COUNT];
826  typedef std::map<uint32, uint64> WorldStatesMap;
827  WorldStatesMap m_worldstates;
830  LocaleConstant m_defaultDbcLocale; // from config for one from loaded DBC locales
833  std::vector<std::string> _motd;
834  std::string m_dataPath;
835 
836  // for max speed access
840 
844 
845  // CLI command holder to be thread safe
847 
848  // scheduled reset times
855 
856  //Player Queue
858 
859  // sessions that are added async
860  void AddSession_(WorldSession* s);
862 
863  void ProcessLinkInstanceSocket(std::pair<std::weak_ptr<WorldSocket>, uint64> linkInfo);
865 
866  // used versions
867  std::string m_DBVersion;
868 
869  typedef std::map<uint8, std::string> AutobroadcastsMap;
870  AutobroadcastsMap m_Autobroadcasts;
871 
872  typedef std::map<uint8, uint8> AutobroadcastsWeightMap;
873  AutobroadcastsWeightMap m_AutobroadcastsWeights;
874 
875  typedef std::map<ObjectGuid, CharacterInfo> CharacterInfoContainer;
876  CharacterInfoContainer _characterInfoStore;
877  void LoadCharacterInfoStore();
878 
879  void ProcessQueryCallbacks();
880  std::deque<PreparedQueryResultFuture> m_realmCharCallbacks;
881 };
882 
883 TC_GAME_API extern Realm realm;
884 
886 
887 #define sWorld World::instance()
888 
889 #endif
890 
Definition: World.h:440
static std::atomic< bool > m_stopEvent
Definition: World.h:794
Definition: Object.h:95
Definition: World.h:307
Definition: World.h:310
Definition: World.h:122
Definition: World.h:53
Definition: World.h:157
Definition: World.h:392
std::deque< PreparedQueryResultFuture > m_realmCharCallbacks
Definition: World.h:880
void SetAllowMovement(bool allow)
Allow/Disallow object movements.
Definition: World.h:604
Definition: World.h:56
void setBoolConfig(WorldBoolConfigs index, bool value)
Set a server configuration element (see #WorldConfigs)
Definition: World.h:674
Definition: World.h:255
static int32 m_visibility_notify_periodOnContinents
Definition: World.h:841
std::map< ObjectGuid, CharacterInfo > CharacterInfoContainer
Definition: World.h:875
Definition: World.h:111
Definition: World.h:277
Definition: World.h:256
time_t m_NextMonthlyQuestReset
Definition: World.h:851
void SetCleaningFlags(uint32 flags)
Definition: World.h:766
Definition: World.h:117
Definition: World.h:315
Definition: World.h:144
Definition: World.h:499
CommandFinished * m_commandFinished
Definition: World.h:516
WorldStatesMap m_worldstates
Definition: World.h:827
Definition: World.h:296
Definition: World.h:166
Definition: World.h:186
Definition: World.h:234
char * m_command
Definition: World.h:513
Definition: World.h:393
Definition: World.h:275
Definition: World.h:330
uint32 m_CleaningFlags
Definition: World.h:799
Definition: World.h:294
Definition: World.h:416
Definition: World.h:337
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
Definition: World.h:159
Definition: World.h:153
Definition: World.h:51
void DecreasePlayerCount()
Definition: World.h:574
Definition: World.h:143
time_t m_NextDailyQuestReset
Definition: World.h:849
Definition: World.h:133
Definition: World.h:363
std::string Name
Definition: World.h:534
std::list< WorldSession * > Queue
Definition: World.h:594
Definition: World.h:149
Definition: World.h:327
Definition: World.h:138
Definition: World.h:427
Definition: World.h:350
Definition: World.h:254
Definition: World.h:473
Definition: World.h:313
Definition: World.h:155
Definition: World.h:265
Definition: World.h:358
Definition: World.h:368
uint32 m_updateTimeCount
Definition: World.h:809
Definition: World.h:356
uint32 GetActiveAndQueuedSessionCount() const
Definition: World.h:559
Definition: World.h:152
Definition: World.h:162
Definition: World.h:281
Definition: Realm.h:72
Definition: World.h:375
Definition: World.h:332
CharacterInfoContainer _characterInfoStore
Definition: World.h:876
Definition: World.h:349
uint8 Sex
Definition: World.h:538
bool m_isClosed
Definition: World.h:801
AutobroadcastsMap m_Autobroadcasts
Definition: World.h:870
Definition: World.h:412
Definition: World.h:421
Definition: World.h:403
Definition: World.h:482
static float GetMaxVisibleDistanceOnContinents()
Definition: World.h:729
Definition: World.h:216
void QueueCliCommand(CliCommandHolder *commandHolder)
Definition: World.h:738
TC_GAME_API Realm realm
Definition: World.cpp:3485
Definition: World.h:329
Definition: World.h:476
Definition: World.h:415
Definition: SharedDefines.h:101
Definition: World.h:321
Definition: World.h:67
The World.
Definition: World.h:544
uint32 GetUpdateTime() const
Update time.
Definition: World.h:628
Definition: World.h:410
std::string const & GetNewCharString() const
Get the string for new characters (first login)
Definition: World.h:614
Definition: World.h:385
Definition: World.h:441
Rates
Server rates.
Definition: World.h:381
Definition: Realm.h:75
bool getAllowMovement() const
Definition: World.h:602
Definition: World.h:437
Definition: World.h:386
Definition: World.h:57
Definition: World.h:488
Definition: World.h:346
SessionMap m_sessions
Definition: World.h:812
Definition: Realm.h:84
Definition: World.h:180
uint32 GetMaxActiveSessionCount() const
Definition: World.h:564
Definition: World.h:271
Definition: World.h:104
Definition: World.h:453
WorldBoolConfigs
Configuration elements.
Definition: World.h:98
Definition: World.h:224
Definition: World.h:123
Definition: World.h:219
Definition: World.h:102
Definition: World.h:140
time_t m_NextGuildReset
Definition: World.h:853
Definition: World.h:496
Definition: World.h:113
time_t GetNextDailyQuestsResetTime() const
Next daily quests and random bg reset time.
Definition: World.h:632
AccountTypes GetPlayerSecurityLimit() const
Security level limitations.
Definition: World.h:585
Definition: World.h:434
uint32 m_PlayerCount
Definition: World.h:817
Definition: World.h:398
Definition: World.h:190
AccountTypes m_allowedSecurityLevel
Definition: World.h:829
time_t m_gameTime
Definition: World.h:804
arena_t NULL
Definition: jemalloc_internal.h:624
static bool IsStopped()
Definition: World.h:663
Definition: World.h:220
Definition: World.h:318
Definition: World.h:266
uint32 m_maxActiveSessionCount
Definition: World.h:815
Definition: World.h:397
Definition: World.h:83
uint32 m_availableDbcLocaleMask
Definition: World.h:831
BanMode
Ban function modes.
Definition: SharedDefines.h:4533
Definition: World.h:134
Definition: World.h:163
Definition: World.h:55
static uint8 m_ExitCode
Definition: World.h:795
WorldStates
Definition: World.h:493
Definition: World.h:147
Definition: World.h:168
static float GetMaxVisibleDistanceInInstances()
Definition: World.h:730
Definition: World.h:371
Definition: World.h:257
float getFloatConfig(WorldFloatConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition: World.h:694
Definition: World.h:92
Definition: World.h:188
Definition: World.h:124
uint32 GetShutDownTimeLeft() const
Definition: World.h:657
Definition: World.h:285
Definition: World.h:286
Definition: World.h:89
Definition: World.h:197
Definition: World.h:225
Definition: World.h:59
Definition: World.h:364
Definition: World.h:258
Definition: World.h:334
Definition: World.h:262
bool IsDeleted
Definition: World.h:540
Definition: World.h:174
Definition: World.h:284
static float GetMaxVisibleDistanceInBGArenas()
Definition: World.h:731
void setIntConfig(WorldIntConfigs index, uint32 value)
Set a server configuration element (see #WorldConfigs)
Definition: World.h:700
Definition: World.h:478
Definition: World.h:457
Definition: World.h:58
Definition: World.h:413
Definition: World.h:377
static std::atomic< uint32 > m_worldLoopCounter
Definition: World.h:549
Definition: World.h:407
Definition: World.h:112
Storage class for commands issued for delayed execution.
Definition: World.h:507
Definition: World.h:456
Definition: World.h:400
Definition: World.h:93
Definition: World.h:326
time_t GetNextRandomBGResetTime() const
Definition: World.h:634
std::string m_DBVersion
Definition: World.h:867
Definition: World.h:481
Definition: World.h:202
LockedQueue< WorldSession * > addSessQueue
Definition: World.h:861
Definition: World.h:477
T max(const T &x, const T &y)
Definition: g3dmath.h:320
Definition: World.h:394
Definition: World.h:372
Definition: World.h:213
Definition: World.h:401
BanReturn
Ban function return codes.
Definition: SharedDefines.h:4541
LocaleConstant GetDefaultDbcLocale() const
Definition: World.h:616
Definition: World.h:336
Definition: World.h:130
WorldTimers
Timers for different object refresh rates.
Definition: World.h:79
std::map< uint32, uint64 > WorldStatesMap
Definition: World.h:826
CliCommandHolder(void *callbackArg, const char *command, Print *zprint, CommandFinished *commandFinished)
Definition: World.h:518
Definition: World.h:270
Definition: World.h:335
Definition: World.h:458
time_t mail_timer
Definition: World.h:806
Definition: World.h:399
Definition: World.h:165
Definition: World.h:170
Queue m_QueuedPlayer
Definition: World.h:857
Definition: World.h:338
void Print(void *, const char *)
Definition: World.h:509
time_t const & GetStartTime() const
When server started?
Definition: World.h:622
Definition: World.h:446
Definition: World.h:198
Definition: World.h:445
Definition: World.h:297
Definition: World.h:436
Definition: World.h:339
Definition: World.h:443
Definition: World.h:316
Definition: World.h:160
Definition: World.h:226
Definition: World.h:150
Definition: World.h:465
Definition: World.h:105
float getRate(Rates rate) const
Get a server rate (see Rates)
Definition: World.h:671
Definition: World.h:119
Definition: World.h:484
Print * m_print
Definition: World.h:514
Definition: World.h:390
Definition: World.h:250
Definition: World.h:486
uint8 Level
Definition: World.h:539
void SetPlayerAmountLimit(uint32 limit)
Active session server limit.
Definition: World.h:590
Definition: World.h:290
Definition: World.h:490
Definition: World.h:328
Definition: World.h:348
Definition: World.h:376
Definition: World.h:259
Definition: World.h:54
static float m_MaxVisibleDistanceOnContinents
Definition: World.h:837
Definition: World.h:342
~CliCommandHolder()
Definition: World.h:523
Definition: World.h:243
Definition: World.h:115
Definition: World.h:461
Definition: World.h:331
Definition: World.h:317
Definition: World.h:81
uint8 Race
Definition: World.h:537
Definition: World.h:485
Definition: World.h:283
time_t m_startTime
Definition: World.h:803
Definition: World.h:151
Definition: World.h:171
static uint8 GetExitCode()
Definition: World.h:661
Definition: World.h:357
static int32 GetVisibilityNotifyPeriodInInstances()
Definition: World.h:734
bool HasCharacterInfo(ObjectGuid const &guid)
Definition: World.h:760
Definition: World.h:201
Definition: World.h:309
Definition: World.h:244
uint32 GetPlayerCount() const
Get number of players.
Definition: World.h:566
Definition: World.h:311
ServerMessageType
Definition: World.h:48
Definition: World.h:302
Definition: World.h:181
Definition: World.h:279
LocaleConstant
Definition: Common.h:115
static int32 m_visibility_notify_periodInInstances
Definition: World.h:842
Definition: World.h:306
Definition: World.h:463
Definition: World.h:204
Definition: World.h:158
Definition: World.h:103
void * m_callbackArg
Definition: World.h:512
Definition: World.h:435
Definition: World.h:323
Definition: World.h:276
std::map< uint8, std::string > AutobroadcastsMap
Definition: World.h:869
Definition: World.h:91
Definition: World.h:161
ShutdownMask
Definition: World.h:65
Definition: World.h:532
Definition: World.h:274
Definition: World.h:230
Definition: World.h:402
static int32 GetVisibilityNotifyPeriodOnContinents()
Definition: World.h:733
Definition: WorldSocket.h:70
std::unordered_map< uint32, time_t > DisconnectMap
Definition: World.h:813
uint16 GetConfigMaxSkillValue() const
Get the maximum skill level a player can reach.
Definition: World.h:637
Definition: World.h:495
Definition: World.h:480
std::string m_dataPath
Definition: World.h:834
int32_t int32
Definition: Define.h:146
Definition: World.h:74
uint32 GetCleaningFlags() const
Definition: World.h:765
Definition: World.h:114
Definition: World.h:406
bool IsFFAPvPRealm() const
Definition: World.h:718
Definition: World.h:300
bool IsPvPRealm() const
Are we on a "Player versus Player" server?
Definition: World.h:717
uint32_t uint32
Definition: Define.h:150
Definition: World.h:172
AccountTypes
Definition: Common.h:106
uint32 m_ShutdownMask
Definition: World.h:797
Definition: World.h:353
Definition: World.h:73
Definition: World.h:145
uint64_t uint64
Definition: Define.h:149
Definition: World.h:245
uint32 AccountId
Definition: World.h:535
Definition: World.h:267
Definition: World.h:455
Definition: World.h:273
uint16_t uint16
Definition: Define.h:151
uint32 m_MaxPlayerCount
Definition: World.h:818
std::string m_newCharString
Definition: World.h:820
void SetRecordDiffInterval(int32 t)
Definition: World.h:629
LocaleConstant GetAvailableDbcLocale(LocaleConstant locale) const
Definition: World.h:744
Definition: World.h:433
DisconnectMap m_disconnects
Definition: World.h:814
static float m_MaxVisibleDistanceInBGArenas
Definition: World.h:839
Definition: World.h:432
Definition: World.h:261
Definition: World.h:454
Definition: World.h:388
Definition: World.h:325
uint32 GetMaxPlayerCount() const
Definition: World.h:567
Definition: World.h:298
static int32 m_visibility_notify_periodInBGArenas
Definition: World.h:843
Definition: World.h:118
Definition: World.h:75
Definition: World.h:223
Definition: World.h:167
Definition: World.h:479
uint32 m_maxQueuedSessionCount
Definition: World.h:816
Definition: World.h:408
Definition: World.h:498
Definition: World.h:50
Definition: World.h:468
Definition: World.h:125
Definition: World.h:343
Definition: World.h:126
AutobroadcastsWeightMap m_AutobroadcastsWeights
Definition: World.h:873
Definition: World.h:365
Definition: World.h:384
Definition: World.h:195
Definition: World.h:215
Definition: World.h:120
WorldIntConfigs
Definition: World.h:207
Definition: World.h:218
time_t mail_timer_expires
Definition: World.h:807
Definition: World.h:251
uint32 GetPlayerAmountLimit() const
Definition: World.h:591
time_t m_NextRandomBGReset
Definition: World.h:852
time_t const & GetGameTime() const
What time is it?
Definition: World.h:624
Definition: World.h:237
void setFloatConfig(WorldFloatConfigs index, float value)
Set a server configuration element (see #WorldConfigs)
Definition: World.h:687
Definition: World.h:404
Definition: World.h:417
Definition: World.h:148
Definition: World.h:249
Definition: World.h:116
Definition: World.h:227
LockedQueue< std::pair< std::weak_ptr< WorldSocket >, uint64 > > _linkSocketQueue
Definition: World.h:864
Definition: World.h:293
void commandFinished(void *, bool)
Definition: CliRunnable.cpp:111
uint32 m_updateTimeSum
Definition: World.h:808
Definition: World.h:264
time_t m_NextCurrencyReset
Definition: World.h:854
Definition: World.h:278
Definition: World.h:324
Definition: World.h:269
Definition: World.h:173
Definition: World.h:196
Definition: World.h:369
Definition: World.h:345
Definition: World.h:239
Definition: World.h:60
Definition: World.h:501
Definition: World.h:460
Definition: World.h:319
Definition: World.h:387
Definition: World.h:280
uint8_t uint8
Definition: g3dmath.h:164
Definition: World.h:467
Definition: World.h:442
Definition: World.h:333
Definition: World.h:141
Definition: World.h:483
char const * GetDBVersion() const
Definition: World.h:748
Definition: World.h:88
Definition: World.h:487
Definition: World.h:428
Definition: World.h:396
void CommandFinished(void *, bool success)
Definition: World.h:510
static int32 GetVisibilityNotifyPeriodInBGArenas()
Definition: World.h:735
Definition: World.h:414
Definition: World.h:238
Definition: World.h:87
Definition: World.h:373
void SetNewCharString(std::string const &str)
Set the string for new characters (first login)
Definition: World.h:612
Definition: World.h:291
Definition: World.h:497
Definition: World.h:474
RealmZone
Definition: World.h:451
uint32 m_currentTime
Definition: World.h:810
LockedQueue< CliCommandHolder * > cliCmdQueue
Definition: World.h:846
LocaleConstant m_defaultDbcLocale
Definition: World.h:830
Definition: World.h:90
bool m_allowMovement
Definition: World.h:832
Definition: World.h:438
Definition: World.h:395
WorldFloatConfigs
Definition: World.h:184
Definition: World.h:210
uint32 m_ShutdownTimer
Definition: World.h:796
Definition: World.h:221
Definition: World.h:85
Definition: World.h:191
uint32 GetQueuedSessionCount() const
Definition: World.h:561
Definition: World.h:308
#define TC_GAME_API
Definition: Define.h:134
Definition: World.h:472
Definition: World.h:374
Definition: World.h:217
Definition: World.h:383
Definition: World.h:132
Definition: World.h:464
Definition: World.h:405
Definition: World.h:391
Definition: World.h:347
Definition: World.h:94
void setRate(Rates rate, float value)
Set a server rate (see Rates)
Definition: World.h:669
Definition: World.h:101
TC_GAME_API uint32 GetVirtualRealmAddress()
Definition: World.cpp:3487
uint8_t uint8
Definition: Define.h:152
Definition: World.h:192
Definition: World.h:320
Definition: World.h:199
Definition: World.h:447
Definition: World.h:459
Definition: World.h:100
uint8 Class
Definition: World.h:536
Definition: World.h:469
CliCommandHolder & operator=(CliCommandHolder const &right)=delete
Definition: World.h:189
Definition: World.h:179
Definition: World.h:295
Definition: World.h:462
Definition: World.h:62
Definition: World.h:448
const FieldDescriptor value
Definition: descriptor.h:1522
Definition: World.h:222
Definition: World.h:430
Definition: World.h:466
Definition: World.h:268
Player session in the World.
Definition: WorldSession.h:882
Definition: World.h:351
Definition: ObjectGuid.h:189
std::vector< std::string > _motd
Definition: World.h:833
uint8 flags
Definition: DisableMgr.cpp:44
uint32_t uint32
Definition: g3dmath.h:168
Definition: World.h:211
void IncreasePlayerCount()
Increase/Decrease number of players.
Definition: World.h:569
Definition: World.h:409
Definition: World.h:164
Definition: World.h:131
uint32 m_playerLimit
Definition: World.h:828
Definition: World.h:154
Definition: World.h:292
Definition: World.h:61
static float m_MaxVisibleDistanceInInstances
Definition: World.h:838
Definition: World.h:418
Definition: World.h:52
Definition: World.h:489
Definition: World.h:231
Definition: World.h:471
uint32 GetUptime() const
Uptime (in secs)
Definition: World.h:626
Definition: World.h:84
std::unordered_map< uint32, WorldSession * > SessionMap
Definition: World.h:530
Definition: World.h:354
Definition: World.h:389
Definition: World.h:272
Definition: World.h:86
Definition: World.h:82
Definition: World.h:314
Definition: World.h:235
bool IsShuttingDown() const
Are we in the middle of a shutdown?
Definition: World.h:656
Definition: World.h:475
Definition: World.h:169
Definition: World.h:299
Definition: World.h:470
time_t GetNextWeeklyQuestsResetTime() const
Definition: World.h:633
Definition: WorldPacket.h:26
Definition: World.h:422
Definition: World.h:359
const SessionMap & GetAllSessions() const
Definition: World.h:558
void DeleteCharacterInfo(ObjectGuid const &guid)
Definition: World.h:759
std::map< uint8, uint8 > AutobroadcastsWeightMap
Definition: World.h:872
bool getBoolConfig(WorldBoolConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition: World.h:681
Definition: ScriptSystem.h:62
Definition: World.h:263
uint32 getIntConfig(WorldIntConfigs index) const
Get a server configuration element (see #WorldConfigs)
Definition: World.h:707
Definition: World.h:444
std::string const & GetDataPath() const
Get the path where data (dbc, maps) are stored on disk.
Definition: World.h:619
Definition: World.h:360
Definition: World.h:289
uint32 GetActiveSessionCount() const
Definition: World.h:560
Definition: World.h:200
void Update(uint32 diff)
Definition: WeatherMgr.cpp:150
Definition: World.h:209
Definition: World.h:352
Definition: World.h:301
uint32 GetMaxQueuedSessionCount() const
Get the maximum number of parallel sessions on the server since last reboot.
Definition: World.h:563
static void StopNow(uint8 exitcode)
Definition: World.h:662
ShutdownExitCode
Definition: World.h:71
Definition: World.h:68
Definition: Realm.h:79
Definition: World.h:236
Definition: World.h:146
Definition: SharedDefines.h:95
Definition: Timer.h:47
Definition: World.h:212
Definition: World.h:156
Definition: World.h:431
Definition: World.h:322
Definition: World.h:232
Definition: World.h:361
Definition: World.h:260
time_t m_NextWeeklyQuestReset
Definition: World.h:850