mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +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:
@@ -833,8 +833,6 @@ class TC_GAME_API GroupScript : public ScriptObject
|
||||
virtual void OnDisband(Group* /*group*/) { }
|
||||
};
|
||||
|
||||
// Placed here due to ScriptRegistry::AddScript dependency.
|
||||
#define sScriptMgr ScriptMgr::instance()
|
||||
|
||||
// namespace
|
||||
// {
|
||||
@@ -851,12 +849,13 @@ class TC_GAME_API ScriptMgr
|
||||
ScriptMgr();
|
||||
virtual ~ScriptMgr();
|
||||
|
||||
void FillSpellSummary();
|
||||
void LoadDatabase();
|
||||
|
||||
public: /* Initialization */
|
||||
static ScriptMgr* instance();
|
||||
|
||||
void Initialize();
|
||||
void LoadDatabase();
|
||||
void FillSpellSummary();
|
||||
|
||||
const char* ScriptsVersion() const { return "Integrated Trinity Scripts"; }
|
||||
|
||||
@@ -872,6 +871,12 @@ class TC_GAME_API ScriptMgr
|
||||
_script_loader_callback = script_loader_callback;
|
||||
}
|
||||
|
||||
public: /* Script contexts */
|
||||
void BeginScriptContext(std::string const& context);
|
||||
void FinishScriptContext();
|
||||
|
||||
void ReleaseScriptContext(std::string const& context);
|
||||
|
||||
public: /* Unloading */
|
||||
|
||||
void Unload();
|
||||
@@ -1094,10 +1099,13 @@ class TC_GAME_API ScriptMgr
|
||||
void ModifySpellDamageTaken(Unit* target, Unit* attacker, int32& damage);
|
||||
|
||||
private:
|
||||
|
||||
uint32 _scriptCount;
|
||||
|
||||
ScriptLoaderCallbackType _script_loader_callback;
|
||||
|
||||
std::string _currentContext;
|
||||
};
|
||||
|
||||
#define sScriptMgr ScriptMgr::instance()
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user