mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/Game: Add a dynamic script reloader which reloads scripts modules on changes.
* is responsible for registering plain modules. * requires compilation with the `WITH_DYNAMIC_LINKING` flag. * requires further support of the ScriptMgr.
This commit is contained in:
@@ -263,12 +263,18 @@ void ScriptMgr::Initialize()
|
||||
|
||||
FillSpellSummary();
|
||||
|
||||
// Load core script systems
|
||||
// SmartAI
|
||||
BeginScriptContext("core scripts");
|
||||
AddSC_SmartScripts();
|
||||
FinishScriptContext();
|
||||
|
||||
// Load all static linked scripts through the script loader function.
|
||||
BeginScriptContext("static scripts");
|
||||
ASSERT(_script_loader_callback,
|
||||
"Script loader callback wasn't registered!");
|
||||
|
||||
_script_loader_callback();
|
||||
FinishScriptContext();
|
||||
|
||||
#ifdef SCRIPTS
|
||||
for (std::string const& scriptName : UnusedScriptNames)
|
||||
@@ -280,6 +286,21 @@ void ScriptMgr::Initialize()
|
||||
TC_LOG_INFO("server.loading", ">> Loaded %u C++ scripts in %u ms", GetScriptCount(), GetMSTimeDiffToNow(oldMSTime));
|
||||
}
|
||||
|
||||
void ScriptMgr::BeginScriptContext(std::string const& context)
|
||||
{
|
||||
_currentContext = context;
|
||||
}
|
||||
|
||||
void ScriptMgr::FinishScriptContext()
|
||||
{
|
||||
_currentContext.clear();
|
||||
}
|
||||
|
||||
void ScriptMgr::ReleaseScriptContext(std::string const& /*context*/)
|
||||
{
|
||||
// ToDo
|
||||
}
|
||||
|
||||
void ScriptMgr::Unload()
|
||||
{
|
||||
#define SCR_CLEAR(T) \
|
||||
|
||||
Reference in New Issue
Block a user