mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
feat(Core/ScriptMgr): add new hook OnAfterUnloadAllMaps (#10279)
* feat(Core/ScriptMgr): add new hook * add desc * Update src/server/game/Scripting/ScriptDefines/WorldScript.cpp
This commit is contained in:
@@ -113,3 +113,11 @@ void ScriptMgr::OnBeforeWorldInitialized()
|
|||||||
script->OnBeforeWorldInitialized();
|
script->OnBeforeWorldInitialized();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ScriptMgr::OnAfterUnloadAllMaps()
|
||||||
|
{
|
||||||
|
ExecuteScript<WorldScript>([](WorldScript* script)
|
||||||
|
{
|
||||||
|
script->OnAfterUnloadAllMaps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -225,6 +225,11 @@ public:
|
|||||||
// Called when the world is actually shut down.
|
// Called when the world is actually shut down.
|
||||||
virtual void OnShutdown() { }
|
virtual void OnShutdown() { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Called after all maps are unloaded from core
|
||||||
|
*/
|
||||||
|
virtual void OnAfterUnloadAllMaps() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This hook runs before finalizing the player world session. Can be also used to mutate the cache version of the Client.
|
* @brief This hook runs before finalizing the player world session. Can be also used to mutate the cache version of the Client.
|
||||||
*
|
*
|
||||||
@@ -2025,6 +2030,7 @@ public: /* WorldScript */
|
|||||||
void OnStartup();
|
void OnStartup();
|
||||||
void OnShutdown();
|
void OnShutdown();
|
||||||
void OnBeforeWorldInitialized();
|
void OnBeforeWorldInitialized();
|
||||||
|
void OnAfterUnloadAllMaps();
|
||||||
|
|
||||||
public: /* FormulaScript */
|
public: /* FormulaScript */
|
||||||
void OnHonorCalculation(float& honor, uint8 level, float multiplier);
|
void OnHonorCalculation(float& honor, uint8 level, float multiplier);
|
||||||
|
|||||||
@@ -329,6 +329,8 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
sOutdoorPvPMgr->Die(); // unload it before MapMgr
|
sOutdoorPvPMgr->Die(); // unload it before MapMgr
|
||||||
sMapMgr->UnloadAll(); // unload all grids (including locked in memory)
|
sMapMgr->UnloadAll(); // unload all grids (including locked in memory)
|
||||||
|
|
||||||
|
sScriptMgr->OnAfterUnloadAllMaps();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Start the Remote Access port (acceptor) if enabled
|
// Start the Remote Access port (acceptor) if enabled
|
||||||
|
|||||||
Reference in New Issue
Block a user