From 9cc97f226d79e8e0bbe1fdc386ec9f065c0a2226 Mon Sep 17 00:00:00 2001 From: Naios Date: Fri, 11 Mar 2016 17:09:26 +0100 Subject: Core/Game: Rewrote the ScriptMgr to support script reloading. * Finally this commit enables dynamic script hotswapping and finished the PR #15671. * Split the storage layout to use optimized storages for database bound and unbound scripts. * Add several unload workers to reload scripts correctly -> Requires further investigation. * Fixes memory leaks in ScriptMgr when dropping invalid scripts. * Fixes VehicleScripts * Makes OutdoorPvP scripts reloadable * Makes InstanceMapScripts reloadable * Makes CommandScripts reloadable --- src/server/game/Instances/InstanceScript.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/server/game/Instances/InstanceScript.h') diff --git a/src/server/game/Instances/InstanceScript.h b/src/server/game/Instances/InstanceScript.h index 2bb2f14ca12..1611f3c290f 100644 --- a/src/server/game/Instances/InstanceScript.h +++ b/src/server/game/Instances/InstanceScript.h @@ -37,6 +37,7 @@ class Unit; class Player; class GameObject; class Creature; +class ModuleReference; enum EncounterFrameType { @@ -141,7 +142,7 @@ typedef std::map ObjectInfoMap; class TC_GAME_API InstanceScript : public ZoneScript { public: - explicit InstanceScript(Map* map) : instance(map), completedEncounters(0) { } + explicit InstanceScript(Map* map); virtual ~InstanceScript() { } @@ -296,6 +297,11 @@ class TC_GAME_API InstanceScript : public ZoneScript ObjectInfoMap _gameObjectInfo; ObjectGuidMap _objectGuids; uint32 completedEncounters; // completed encounter mask, bit indexes are DungeonEncounter.dbc boss numbers, used for packets + + #ifdef TRINITY_API_USE_DYNAMIC_LINKING + // Strong reference to the associated script module + std::shared_ptr module_reference; + #endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING }; template -- cgit v1.2.3