feat(Core/Config): loading modules configs before loading scripts (#9653)
This commit is contained in:
@@ -360,7 +360,7 @@ std::string const ConfigMgr::GetConfigPath()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigMgr::Configure(std::string const& initFileName, std::vector<std::string> args, std::string const& modulesConfigList /*= ""*/)
|
void ConfigMgr::Configure(std::string const& initFileName, std::vector<std::string> args, std::string_view modulesConfigList /*= {}*/)
|
||||||
{
|
{
|
||||||
_filename = initFileName;
|
_filename = initFileName;
|
||||||
_args = std::move(args);
|
_args = std::move(args);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class ConfigMgr
|
|||||||
public:
|
public:
|
||||||
bool LoadAppConfigs(bool isReload = false);
|
bool LoadAppConfigs(bool isReload = false);
|
||||||
bool LoadModulesConfigs(bool isReload = false, bool isNeedPrintInfo = true);
|
bool LoadModulesConfigs(bool isReload = false, bool isNeedPrintInfo = true);
|
||||||
void Configure(std::string const& initFileName, std::vector<std::string> args, std::string const& modulesConfigList = "");
|
void Configure(std::string const& initFileName, std::vector<std::string> args, std::string_view modulesConfigList = {});
|
||||||
|
|
||||||
static ConfigMgr* instance();
|
static ConfigMgr* instance();
|
||||||
|
|
||||||
|
|||||||
@@ -274,6 +274,9 @@ int main(int argc, char** argv)
|
|||||||
// Set process priority according to configuration settings
|
// Set process priority according to configuration settings
|
||||||
SetProcessPriority("server.worldserver", sConfigMgr->GetOption<int32>(CONFIG_PROCESSOR_AFFINITY, 0), sConfigMgr->GetOption<bool>(CONFIG_HIGH_PRIORITY, false));
|
SetProcessPriority("server.worldserver", sConfigMgr->GetOption<int32>(CONFIG_PROCESSOR_AFFINITY, 0), sConfigMgr->GetOption<bool>(CONFIG_HIGH_PRIORITY, false));
|
||||||
|
|
||||||
|
// Loading modules configs before scripts
|
||||||
|
sConfigMgr->LoadModulesConfigs();
|
||||||
|
|
||||||
sScriptMgr->SetScriptLoader(AddScripts);
|
sScriptMgr->SetScriptLoader(AddScripts);
|
||||||
sScriptMgr->SetModulesLoader(AddModulesScripts);
|
sScriptMgr->SetModulesLoader(AddModulesScripts);
|
||||||
|
|
||||||
@@ -315,9 +318,6 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
Acore::Module::SetEnableModulesList(AC_MODULES_LIST);
|
Acore::Module::SetEnableModulesList(AC_MODULES_LIST);
|
||||||
|
|
||||||
// Loading modules configs before scripts
|
|
||||||
sConfigMgr->LoadModulesConfigs();
|
|
||||||
|
|
||||||
///- Initialize the World
|
///- Initialize the World
|
||||||
sSecretMgr->Initialize();
|
sSecretMgr->Initialize();
|
||||||
sWorld->SetInitialWorldSettings();
|
sWorld->SetInitialWorldSettings();
|
||||||
|
|||||||
Reference in New Issue
Block a user