mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
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
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "Spell.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
@@ -50,6 +51,12 @@ void _SpellScript::_Init(std::string const* scriptname, uint32 spellId)
|
||||
m_currentScriptState = SPELL_SCRIPT_STATE_NONE;
|
||||
m_scriptName = scriptname;
|
||||
m_scriptSpellId = spellId;
|
||||
|
||||
#ifdef TRINITY_API_USE_DYNAMIC_LINKING
|
||||
// Acquire a strong reference to the binary code
|
||||
// to keep it loaded until all spells are destroyed.
|
||||
m_moduleReference = sScriptMgr->AcquireModuleReferenceOfScriptName(*scriptname);
|
||||
#endif // #ifndef TRINITY_API_USE_DYNAMIC_LINKING
|
||||
}
|
||||
|
||||
std::string const* _SpellScript::_GetScriptName() const
|
||||
|
||||
Reference in New Issue
Block a user