From 1bbe10dc331034fbbf7d5dec636899f6607822d0 Mon Sep 17 00:00:00 2001 From: Barbz Date: Fri, 24 Jan 2020 09:39:29 +0100 Subject: [PATCH] fix(Core): Improve logging msg when missing .conf file (#2560) - Fixed typos - Changed outError to outString when it's not an actual error but just a warning - Display "load hardcoded default settings" only when .conf.dist AND .conf are missing --- src/server/game/World/World.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/server/game/World/World.cpp b/src/server/game/World/World.cpp index 53ce3fc1d..7b0f464fa 100644 --- a/src/server/game/World/World.cpp +++ b/src/server/game/World/World.cpp @@ -432,9 +432,14 @@ void World::LoadModuleConfigSettings() if (!sConfigMgr->LoadMore(cfg_def_file.c_str())) { sLog->outString(); - sLog->outError("Module config: Invalid or missing configuration dist file : %s", cfg_def_file.c_str()); - sLog->outError("Module config: Verify that the file exists and has \'[worldserver]' written in the top of the file!"); - sLog->outError("Module config: Use default settings!"); + sLog->outError("Module config: Invalid or missing configuration (*.conf.dist) file : %s", cfg_def_file.c_str()); + sLog->outError("Module config: Verify that this file exists and has \'[worldserver]' written at the top of the file!"); + + // If .conf exists, it will load it so it will NOT use the default hardcoded settings + if (!sConfigMgr->LoadMore(cfg_file.c_str())) + { + sLog->outError("Module config: Using default hardcoded settings."); + } sLog->outString(); } @@ -442,9 +447,7 @@ void World::LoadModuleConfigSettings() if (!sConfigMgr->LoadMore(cfg_file.c_str())) { sLog->outString(); - sLog->outError("Module config: Invalid or missing configuration file : %s", cfg_file.c_str()); - sLog->outError("Module config: Verify that the file exists and has \'[worldserver]' written in the top of the file!"); - sLog->outError("Module config: Use default settings!"); + sLog->outString("Module config: %s not found (or invalid), using default settings from %s", cfg_file.c_str(), cfg_def_file.c_str()); sLog->outString(); } }