aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/World
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2017-05-18 23:52:58 +0200
committerShauren <shauren.trinity@gmail.com>2017-05-18 23:53:25 +0200
commitc5d3dd90bea3889ef5fcd33c9ef0d59d7c544f8a (patch)
treeaa7fde6f924fc39da54908bd6eeeb0be422e5fc3 /src/server/game/World
parent74456703146194de72424ec98c4ea76402077be6 (diff)
Core/Game: Include cleanup
* Mostly aimed at removing Log/DatabaseEnv includes from other headers * Fix most packet headers including other packet headers - moved common structures such as ItemInstance to their own files * Moved SAI function definitions to source files (massive or requiring many different dependencies)
Diffstat (limited to 'src/server/game/World')
-rw-r--r--src/server/game/World/World.cpp43
-rw-r--r--src/server/game/World/World.h48
2 files changed, 54 insertions, 37 deletions
diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp
index c6c2ddba890..207cad78266 100644
--- a/src/server/game/World/World.cpp
+++ b/src/server/game/World/World.cpp
@@ -21,6 +21,7 @@
*/
#include "World.h"
+#include "AccountMgr.h"
#include "AchievementMgr.h"
#include "AreaTriggerDataStore.h"
#include "ArenaTeamMgr.h"
@@ -36,6 +37,7 @@
#include "CharacterDatabaseCleaner.h"
#include "CharacterTemplateDataStore.h"
#include "Chat.h"
+#include "ChatPackets.h"
#include "Config.h"
#include "ConversationDataStore.h"
#include "CreatureAIRegistry.h"
@@ -44,44 +46,47 @@
#include "DatabaseEnv.h"
#include "DisableMgr.h"
#include "GameEventMgr.h"
+#include "GameObjectModel.h"
#include "GameTables.h"
#include "GarrisonMgr.h"
#include "GitRevision.h"
#include "GridNotifiersImpl.h"
#include "GroupMgr.h"
#include "GuildFinderMgr.h"
-#include "GameObjectModel.h"
+#include "GuildMgr.h"
#include "InstanceSaveMgr.h"
#include "Language.h"
#include "LFGMgr.h"
+#include "LootMgr.h"
+#include "M2Stores.h"
#include "MapManager.h"
#include "Memory.h"
+#include "Metric.h"
#include "MiscPackets.h"
#include "MMapFactory.h"
+#include "Object.h"
#include "ObjectMgr.h"
#include "OutdoorPvPMgr.h"
#include "Player.h"
#include "PoolMgr.h"
-#include "QueryCallback.h"
+#include "Realm.h"
#include "ScenarioMgr.h"
#include "ScriptMgr.h"
#include "ScriptReloadMgr.h"
#include "SkillDiscovery.h"
#include "SkillExtraItems.h"
-#include "SmartAI.h"
-#include "Metric.h"
+#include "SmartScriptMgr.h"
#include "SupportMgr.h"
#include "TaxiPathGraph.h"
#include "TransportMgr.h"
#include "Unit.h"
#include "VMapFactory.h"
+#include "VMapManager2.h"
#include "WardenCheckMgr.h"
#include "WaypointMovementGenerator.h"
#include "WeatherMgr.h"
#include "WorldSession.h"
-#include "ChatPackets.h"
#include "WorldSocket.h"
-#include "M2Stores.h"
#include <boost/algorithm/string.hpp>
@@ -3025,9 +3030,9 @@ void World::UpdateSessions(uint32 diff)
// This handles the issued and queued CLI commands
void World::ProcessCliCommands()
{
- CliCommandHolder::Print* zprint = NULL;
- void* callbackArg = NULL;
- CliCommandHolder* command = NULL;
+ CliCommandHolder::Print zprint = nullptr;
+ void* callbackArg = nullptr;
+ CliCommandHolder* command = nullptr;
while (cliCmdQueue.next(command))
{
TC_LOG_INFO("misc", "CLI command under processing...");
@@ -3445,6 +3450,16 @@ void World::LoadWorldStates()
}
+bool World::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);
+}
+
+bool World::IsFFAPvPRealm() const
+{
+ return getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP;
+}
+
// Setting a worldstate will save it to DB
void World::setWorldState(uint32 index, uint32 value)
{
@@ -3610,3 +3625,13 @@ uint32 GetVirtualRealmAddress()
{
return realm.Id.GetAddress();
}
+
+CliCommandHolder::CliCommandHolder(void* callbackArg, char const* command, Print zprint, CommandFinished commandFinished)
+ : m_callbackArg(callbackArg), m_command(strdup(command)), m_print(zprint), m_commandFinished(commandFinished)
+{
+}
+
+CliCommandHolder::~CliCommandHolder()
+{
+ free(m_command);
+}
diff --git a/src/server/game/World/World.h b/src/server/game/World/World.h
index 501e6798b1f..e48df5d3e82 100644
--- a/src/server/game/World/World.h
+++ b/src/server/game/World/World.h
@@ -24,27 +24,25 @@
#define __WORLD_H
#include "Common.h"
-#include "Realm/Realm.h"
+#include "DatabaseEnvFwd.h"
+#include "LockedQueue.h"
#include "ObjectGuid.h"
-#include "Timer.h"
-#include "SharedDefines.h"
-#include "QueryResult.h"
#include "QueryCallbackProcessor.h"
-#include "Realm/Realm.h"
-#include "LockedQueue.h"
+#include "SharedDefines.h"
+#include "Timer.h"
#include <atomic>
-#include <map>
-#include <set>
#include <list>
+#include <map>
+#include <memory>
#include <unordered_map>
+#include <vector>
-class Object;
+class Player;
class WorldPacket;
class WorldSession;
-class Player;
class WorldSocket;
-class SystemMgr;
+struct Realm;
// ServerMessages.dbc
enum ServerMessageType
@@ -64,14 +62,14 @@ enum ServerMessageType
SERVER_MSG_TICKET_WAIT_TIME = 13,
};
-enum ShutdownMask
+enum ShutdownMask : uint32
{
SHUTDOWN_MASK_RESTART = 1,
SHUTDOWN_MASK_IDLE = 2,
SHUTDOWN_MASK_FORCE = 4
};
-enum ShutdownExitCode
+enum ShutdownExitCode : uint32
{
SHUTDOWN_EXIT_CODE = 0,
ERROR_EXIT_CODE = 1,
@@ -546,26 +544,20 @@ enum WorldStates
WS_GUILD_WEEKLY_RESET_TIME = 20050, // Next guild week reset time
};
-#define MAX_CHARACTERS_PER_REALM 12
-
/// Storage class for commands issued for delayed execution
-struct CliCommandHolder
+struct TC_GAME_API CliCommandHolder
{
- typedef void Print(void*, const char*);
- typedef void CommandFinished(void*, bool success);
+ typedef void(*Print)(void*, const char*);
+ typedef void(*CommandFinished)(void*, bool success);
void* m_callbackArg;
char *m_command;
- Print* m_print;
-
- CommandFinished* m_commandFinished;
+ Print m_print;
- CliCommandHolder(void* callbackArg, const char *command, Print* zprint, CommandFinished* commandFinished)
- : m_callbackArg(callbackArg), m_command(strdup(command)), m_print(zprint), m_commandFinished(commandFinished)
- {
- }
+ CommandFinished m_commandFinished;
- ~CliCommandHolder() { free(m_command); }
+ CliCommandHolder(void* callbackArg, char const* command, Print zprint, CommandFinished commandFinished);
+ ~CliCommandHolder();
private:
CliCommandHolder(CliCommandHolder const& right) = delete;
@@ -759,8 +751,8 @@ class TC_GAME_API World
void LoadWorldStates();
/// Are we on a "Player versus Player" server?
- 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); }
- bool IsFFAPvPRealm() const { return getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_FFA_PVP; }
+ bool IsPvPRealm() const;
+ bool IsFFAPvPRealm() const;
void KickAll();
void KickAllLess(AccountTypes sec);