From 2ca258e179ca9ff65d0fc28b16e28b1eb72e5a86 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 30 Jul 2016 18:14:38 +0200 Subject: [CORE] implemented multiple configuration files loading currently it's used to load the default [auth|world]server.conf.dist but you can use sConfigMgr->LoadMore to load your custom config in your modules to add/overwrite properties --- src/server/worldserver/Main.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/server/worldserver/Main.cpp') diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp index 0a00f1d1b7..2ce34822f9 100644 --- a/src/server/worldserver/Main.cpp +++ b/src/server/worldserver/Main.cpp @@ -125,12 +125,21 @@ extern int main(int argc, char** argv) ++c; } - if (!sConfigMgr->LoadInitial(cfg_file)) + std::string cfg_def_file=_TRINITY_CORE_CONFIG; + cfg_def_file += ".dist"; + + if (!sConfigMgr->LoadInitial(cfg_def_file.c_str())) { + printf("Invalid or missing default configuration file : %s\n", cfg_def_file.c_str()); + return 1; + } + + if (!sConfigMgr->LoadMore(cfg_file)) { printf("Invalid or missing configuration file : %s\n", cfg_file); printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!\n"); return 1; } + sLog->outString("Using configuration file %s.", cfg_file); sLog->outString("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); -- cgit v1.2.3