mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
[CORE] Rewritten ScriptMgr to be initialized before server load
Now ScriptMgr can be initialized before config allowing to create scripts that can change the behaviour of server before loading anything
This commit is contained in:
@@ -436,6 +436,8 @@ void World::LoadConfigSettings(bool reload)
|
||||
sLog->ReloadConfig(); // Reload log levels and filters
|
||||
}
|
||||
|
||||
sScriptMgr->OnBeforeConfigLoad(reload);
|
||||
|
||||
///- Read the player limit and the Message of the day from the config file
|
||||
if (!reload)
|
||||
SetPlayerAmountLimit(sConfigMgr->GetIntDefault("PlayerLimit", 100));
|
||||
@@ -1236,8 +1238,7 @@ void World::LoadConfigSettings(bool reload)
|
||||
m_int_configs[CONFIG_BIRTHDAY_TIME] = sConfigMgr->GetIntDefault("BirthdayTime", 1222964635);
|
||||
|
||||
// call ScriptMgr if we're reloading the configuration
|
||||
if (reload)
|
||||
sScriptMgr->OnConfigLoad(reload);
|
||||
sScriptMgr->OnAfterConfigLoad(reload);
|
||||
}
|
||||
|
||||
extern void LoadGameObjectModelList();
|
||||
@@ -1253,6 +1254,9 @@ void World::SetInitialWorldSettings()
|
||||
|
||||
///- Initialize detour memory management
|
||||
dtAllocSetCustom(dtCustomAlloc, dtCustomFree);
|
||||
|
||||
sLog->outString("Initializing Scripts...");
|
||||
sScriptMgr->Initialize();
|
||||
|
||||
///- Initialize config settings
|
||||
LoadConfigSettings();
|
||||
@@ -1700,9 +1704,8 @@ void World::SetInitialWorldSettings()
|
||||
sLog->outString("Loading Creature Text Locales...");
|
||||
sCreatureTextMgr->LoadCreatureTextLocales();
|
||||
|
||||
sLog->outString("Initializing Scripts...");
|
||||
sScriptMgr->Initialize();
|
||||
sScriptMgr->OnConfigLoad(false); // must be done after the ScriptMgr has been properly initialized
|
||||
sLog->outString("Loading Scripts...");
|
||||
sScriptMgr->LoadDatabase();
|
||||
|
||||
sLog->outString("Validating spell scripts...");
|
||||
sObjectMgr->ValidateSpellScripts();
|
||||
|
||||
Reference in New Issue
Block a user