diff --git a/src/game/AchievementMgr.cpp b/src/game/AchievementMgr.cpp index b4e882c82..b6db4444c 100644 --- a/src/game/AchievementMgr.cpp +++ b/src/game/AchievementMgr.cpp @@ -36,7 +36,7 @@ #include "CellImpl.h" #include "Language.h" #include "MapManager.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "BattleGroundAB.h" #include "Map.h" #include "InstanceData.h" diff --git a/src/game/BattleGround.cpp b/src/game/BattleGround/BattleGround.cpp similarity index 100% rename from src/game/BattleGround.cpp rename to src/game/BattleGround/BattleGround.cpp diff --git a/src/game/BattleGround.h b/src/game/BattleGround/BattleGround.h similarity index 100% rename from src/game/BattleGround.h rename to src/game/BattleGround/BattleGround.h diff --git a/src/game/BattleGroundAA.cpp b/src/game/BattleGround/BattleGroundAA.cpp similarity index 100% rename from src/game/BattleGroundAA.cpp rename to src/game/BattleGround/BattleGroundAA.cpp diff --git a/src/game/BattleGroundAA.h b/src/game/BattleGround/BattleGroundAA.h similarity index 100% rename from src/game/BattleGroundAA.h rename to src/game/BattleGround/BattleGroundAA.h diff --git a/src/game/BattleGroundAB.cpp b/src/game/BattleGround/BattleGroundAB.cpp similarity index 100% rename from src/game/BattleGroundAB.cpp rename to src/game/BattleGround/BattleGroundAB.cpp diff --git a/src/game/BattleGroundAB.h b/src/game/BattleGround/BattleGroundAB.h similarity index 100% rename from src/game/BattleGroundAB.h rename to src/game/BattleGround/BattleGroundAB.h diff --git a/src/game/BattleGroundAV.cpp b/src/game/BattleGround/BattleGroundAV.cpp similarity index 100% rename from src/game/BattleGroundAV.cpp rename to src/game/BattleGround/BattleGroundAV.cpp diff --git a/src/game/BattleGroundAV.h b/src/game/BattleGround/BattleGroundAV.h similarity index 100% rename from src/game/BattleGroundAV.h rename to src/game/BattleGround/BattleGroundAV.h diff --git a/src/game/BattleGroundBE.cpp b/src/game/BattleGround/BattleGroundBE.cpp similarity index 100% rename from src/game/BattleGroundBE.cpp rename to src/game/BattleGround/BattleGroundBE.cpp diff --git a/src/game/BattleGroundBE.h b/src/game/BattleGround/BattleGroundBE.h similarity index 100% rename from src/game/BattleGroundBE.h rename to src/game/BattleGround/BattleGroundBE.h diff --git a/src/game/BattleGroundDS.cpp b/src/game/BattleGround/BattleGroundDS.cpp similarity index 100% rename from src/game/BattleGroundDS.cpp rename to src/game/BattleGround/BattleGroundDS.cpp diff --git a/src/game/BattleGroundDS.h b/src/game/BattleGround/BattleGroundDS.h similarity index 100% rename from src/game/BattleGroundDS.h rename to src/game/BattleGround/BattleGroundDS.h diff --git a/src/game/BattleGroundEY.cpp b/src/game/BattleGround/BattleGroundEY.cpp similarity index 100% rename from src/game/BattleGroundEY.cpp rename to src/game/BattleGround/BattleGroundEY.cpp diff --git a/src/game/BattleGroundEY.h b/src/game/BattleGround/BattleGroundEY.h similarity index 100% rename from src/game/BattleGroundEY.h rename to src/game/BattleGround/BattleGroundEY.h diff --git a/src/game/BattleGroundHandler.cpp b/src/game/BattleGround/BattleGroundHandler.cpp similarity index 100% rename from src/game/BattleGroundHandler.cpp rename to src/game/BattleGround/BattleGroundHandler.cpp diff --git a/src/game/BattleGroundIC.cpp b/src/game/BattleGround/BattleGroundIC.cpp similarity index 100% rename from src/game/BattleGroundIC.cpp rename to src/game/BattleGround/BattleGroundIC.cpp diff --git a/src/game/BattleGroundIC.h b/src/game/BattleGround/BattleGroundIC.h similarity index 100% rename from src/game/BattleGroundIC.h rename to src/game/BattleGround/BattleGroundIC.h diff --git a/src/game/BattleGroundMgr.cpp b/src/game/BattleGround/BattleGroundMgr.cpp similarity index 100% rename from src/game/BattleGroundMgr.cpp rename to src/game/BattleGround/BattleGroundMgr.cpp diff --git a/src/game/BattleGroundMgr.h b/src/game/BattleGround/BattleGroundMgr.h similarity index 100% rename from src/game/BattleGroundMgr.h rename to src/game/BattleGround/BattleGroundMgr.h diff --git a/src/game/BattleGroundNA.cpp b/src/game/BattleGround/BattleGroundNA.cpp similarity index 100% rename from src/game/BattleGroundNA.cpp rename to src/game/BattleGround/BattleGroundNA.cpp diff --git a/src/game/BattleGroundNA.h b/src/game/BattleGround/BattleGroundNA.h similarity index 100% rename from src/game/BattleGroundNA.h rename to src/game/BattleGround/BattleGroundNA.h diff --git a/src/game/BattleGroundRB.cpp b/src/game/BattleGround/BattleGroundRB.cpp similarity index 100% rename from src/game/BattleGroundRB.cpp rename to src/game/BattleGround/BattleGroundRB.cpp diff --git a/src/game/BattleGroundRB.h b/src/game/BattleGround/BattleGroundRB.h similarity index 100% rename from src/game/BattleGroundRB.h rename to src/game/BattleGround/BattleGroundRB.h diff --git a/src/game/BattleGroundRL.cpp b/src/game/BattleGround/BattleGroundRL.cpp similarity index 100% rename from src/game/BattleGroundRL.cpp rename to src/game/BattleGround/BattleGroundRL.cpp diff --git a/src/game/BattleGroundRL.h b/src/game/BattleGround/BattleGroundRL.h similarity index 100% rename from src/game/BattleGroundRL.h rename to src/game/BattleGround/BattleGroundRL.h diff --git a/src/game/BattleGroundRV.cpp b/src/game/BattleGround/BattleGroundRV.cpp similarity index 100% rename from src/game/BattleGroundRV.cpp rename to src/game/BattleGround/BattleGroundRV.cpp diff --git a/src/game/BattleGroundRV.h b/src/game/BattleGround/BattleGroundRV.h similarity index 100% rename from src/game/BattleGroundRV.h rename to src/game/BattleGround/BattleGroundRV.h diff --git a/src/game/BattleGroundSA.cpp b/src/game/BattleGround/BattleGroundSA.cpp similarity index 100% rename from src/game/BattleGroundSA.cpp rename to src/game/BattleGround/BattleGroundSA.cpp diff --git a/src/game/BattleGroundSA.h b/src/game/BattleGround/BattleGroundSA.h similarity index 100% rename from src/game/BattleGroundSA.h rename to src/game/BattleGround/BattleGroundSA.h diff --git a/src/game/BattleGroundWS.cpp b/src/game/BattleGround/BattleGroundWS.cpp similarity index 100% rename from src/game/BattleGroundWS.cpp rename to src/game/BattleGround/BattleGroundWS.cpp diff --git a/src/game/BattleGroundWS.h b/src/game/BattleGround/BattleGroundWS.h similarity index 100% rename from src/game/BattleGroundWS.h rename to src/game/BattleGround/BattleGroundWS.h diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 3536af37b..8544147fe 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -21,8 +21,9 @@ file(GLOB_RECURSE game_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/vmap - ${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP ${CMAKE_CURRENT_SOURCE_DIR}/AuctionHouseBot + ${CMAKE_CURRENT_SOURCE_DIR}/BattleGround + ${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP ${CMAKE_SOURCE_DIR}/dep/include/g3dlite ${CMAKE_SOURCE_DIR}/dep/recastnavigation/Detour ${CMAKE_SOURCE_DIR}/dep/recastnavigation/ diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index b5f4f81f2..659d31c07 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -39,7 +39,7 @@ #include "WaypointMovementGenerator.h" #include "InstanceData.h" #include "MapPersistentStateMgr.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include "OutdoorPvP/OutdoorPvP.h" #include "Spell.h" #include "Util.h" diff --git a/src/game/GridNotifiers.cpp b/src/game/GridNotifiers.cpp index 9362405a3..1de2e0f62 100644 --- a/src/game/GridNotifiers.cpp +++ b/src/game/GridNotifiers.cpp @@ -24,7 +24,7 @@ #include "Map.h" #include "Transports.h" #include "ObjectAccessor.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include "CreatureAI.h" using namespace MaNGOS; diff --git a/src/game/Group.cpp b/src/game/Group.cpp index b1352a2dd..324ae1976 100644 --- a/src/game/Group.cpp +++ b/src/game/Group.cpp @@ -27,7 +27,7 @@ #include "Group.h" #include "Formulas.h" #include "ObjectAccessor.h" -#include "BattleGround.h" +#include "BattleGound/BattleGround.h" #include "MapManager.h" #include "MapPersistentStateMgr.h" #include "Util.h" diff --git a/src/game/Group.h b/src/game/Group.h index 74e529351..2338ccbc5 100644 --- a/src/game/Group.h +++ b/src/game/Group.h @@ -23,7 +23,7 @@ #include "ObjectGuid.h" #include "GroupReference.h" #include "GroupRefManager.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "LootMgr.h" #include "DBCEnums.h" #include "SharedDefines.h" diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 460991c2d..21dc05a94 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -50,7 +50,7 @@ #include "Mail.h" #include "Util.h" #include "ItemEnchantmentMgr.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include "MapPersistentStateMgr.h" #include "InstanceData.h" #include "CreatureEventAIMgr.h" diff --git a/src/game/Map.cpp b/src/game/Map.cpp index 5c71b0bbb..294872f1e 100644 --- a/src/game/Map.cpp +++ b/src/game/Map.cpp @@ -36,7 +36,7 @@ #include "MapPersistentStateMgr.h" #include "VMapFactory.h" #include "MoveMap.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" Map::~Map() { diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 755067fbf..42328736b 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -37,7 +37,7 @@ #include #include "ObjectAccessor.h" #include "Object.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "OutdoorPvP/OutdoorPvP.h" #include "Pet.h" #include "SocialMgr.h" diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 91efb87b5..76c059541 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -27,7 +27,7 @@ #include "SpellAuras.h" #include "MapManager.h" #include "Transports.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "WaypointMovementGenerator.h" #include "MapPersistentStateMgr.h" #include "ObjectMgr.h" diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 770ba8493..404674e89 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -49,9 +49,9 @@ #include "Util.h" #include "Transports.h" #include "Weather.h" -#include "BattleGround.h" -#include "BattleGroundAV.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGround.h" +#include "BattleGround/BattleGroundMgr.h" +#include "BattleGround/BattleGroundAV.h" #include "OutdoorPvP/OutdoorPvP.h" #include "ArenaTeam.h" #include "Chat.h" diff --git a/src/game/Player.h b/src/game/Player.h index ce0fb39d6..72d7e01ea 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -35,7 +35,7 @@ #include "Util.h" // for Tokens typedef #include "AchievementMgr.h" #include "ReputationMgr.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "SharedDefines.h" #include diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 9beaea7b9..b4a982e45 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -41,7 +41,7 @@ #include "SharedDefines.h" #include "LootMgr.h" #include "VMapFactory.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "Util.h" #include "Chat.h" #include "DB2Stores.h" diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index f78c435d7..73e10bd6b 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -37,7 +37,7 @@ #include "Totem.h" #include "Creature.h" #include "Formulas.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "OutdoorPvP/OutdoorPvP.h" #include "CreatureAI.h" #include "ScriptMgr.h" diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 66a2986a5..d2535d6f3 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -42,10 +42,10 @@ #include "Creature.h" #include "Totem.h" #include "CreatureAI.h" -#include "BattleGroundMgr.h" -#include "BattleGround.h" -#include "BattleGroundEY.h" -#include "BattleGroundWS.h" +#include "BattleGround/attleGroundMgr.h" +#include "BattleGround/BattleGround.h" +#include "BattleGround/BattleGroundEY.h" +#include "BattleGround/BattleGroundWS.h" #include "Language.h" #include "SocialMgr.h" #include "VMapFactory.h" diff --git a/src/game/SpellMgr.cpp b/src/game/SpellMgr.cpp index 94bc30858..da57db58c 100644 --- a/src/game/SpellMgr.cpp +++ b/src/game/SpellMgr.cpp @@ -25,7 +25,7 @@ #include "World.h" #include "Chat.h" #include "Spell.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include "MapManager.h" #include "Unit.h" diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3bd452d55..41f1204d0 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -40,7 +40,7 @@ #include "Util.h" #include "Totem.h" #include "Vehicle.h" -#include "BattleGround.h" +#include "BattleGround/BattleGround.h" #include "InstanceData.h" #include "OutdoorPvP/OutdoorPvP.h" #include "MapPersistentStateMgr.h" diff --git a/src/game/World.cpp b/src/game/World.cpp index 17b742ffc..bbaa3f105 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -49,7 +49,7 @@ #include "ScriptMgr.h" #include "CreatureAIRegistry.h" #include "Policies/SingletonImp.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include "OutdoorPvP/OutdoorPvP.h" #include "TemporarySummon.h" #include "VMapFactory.h" @@ -141,6 +141,14 @@ World::~World() // TODO free addSessQueue } +/// Cleanups before world stop +void World::CleanupsBeforeStop() +{ + KickAll(); // save and kick all players + UpdateSessions(1); // real players unload required UpdateSessions call + sBattleGroundMgr.DeleteAllBattleGrounds(); // unload battleground templates before different singletons destroyed +} + /// Find a player in a specified zone Player* World::FindPlayerInZone(uint32 zone) { diff --git a/src/game/World.h b/src/game/World.h index d83de9010..e212b55de 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -447,6 +447,8 @@ class World World(); ~World(); + void CleanupsBeforeStop(); + WorldSession* FindSession(uint32 id) const; void AddSession(WorldSession* s); bool RemoveSession(uint32 id); diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index d22de5023..9b9217147 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -33,7 +33,7 @@ #include "Guild.h" #include "GuildMgr.h" #include "World.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include "MapManager.h" #include "SocialMgr.h" #include "Auth/AuthCrypt.h" diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 46c457384..dc73ac18c 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -26,7 +26,7 @@ #include "Unit.h" #include "GossipDef.h" #include "Language.h" -#include "BattleGroundMgr.h" +#include "BattleGround/BattleGroundMgr.h" #include #include "ObjectMgr.h" #include "ObjectGuid.h" diff --git a/src/mangosd/WorldRunnable.cpp b/src/mangosd/WorldRunnable.cpp index 8c9aef004..07e668d8f 100644 --- a/src/mangosd/WorldRunnable.cpp +++ b/src/mangosd/WorldRunnable.cpp @@ -26,7 +26,6 @@ #include "WorldRunnable.h" #include "Timer.h" #include "MapManager.h" -#include "BattleGroundMgr.h" #include "Database/DatabaseEnv.h" @@ -78,11 +77,7 @@ void WorldRunnable::run() #endif } - sWorld.KickAll(); // save and kick all players - sWorld.UpdateSessions(1); // real players unload required UpdateSessions call - - // unload battleground templates before different singletons destroyed - sBattleGroundMgr.DeleteAllBattleGrounds(); + sWorld.CleanupsBeforeStop(); sWorldSocketMgr->StopNetwork(); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 3b89e567f..4701f0e43 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "12122" + #define REVISION_NR "12123" #endif // __REVISION_NR_H__ diff --git a/win/VC100/game.vcxproj b/win/VC100/game.vcxproj index b9cd14818..a4c50eb1b 100644 --- a/win/VC100/game.vcxproj +++ b/win/VC100/game.vcxproj @@ -352,22 +352,22 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + @@ -534,21 +534,21 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/win/VC100/game.vcxproj.filters b/win/VC100/game.vcxproj.filters index 676db7b13..e13e0ec01 100644 --- a/win/VC100/game.vcxproj.filters +++ b/win/VC100/game.vcxproj.filters @@ -34,6 +34,9 @@ {c25f76ed-c7d6-495a-a647-1f97b1261fa7} + + {0af4d063-6d01-4546-a429-59bd828ab270} + @@ -48,54 +51,6 @@ World/Handlers - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - World/Handlers @@ -553,6 +508,54 @@ Object + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + @@ -561,51 +564,6 @@ World/Handlers - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - - - World/Handlers - World/Handlers @@ -1054,5 +1012,50 @@ Object + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + + + BattleGround + diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index dc4a617bc..fa115d952 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -542,130 +542,6 @@ RelativePath="..\..\src\game\AuctionHouseHandler.cpp" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1907,6 +1783,134 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +