diff --git a/apps/ci/ci-gen-server-conf-files.sh b/apps/ci/ci-gen-server-conf-files.sh index c6b7b1af7..fb390bbe7 100644 --- a/apps/ci/ci-gen-server-conf-files.sh +++ b/apps/ci/ci-gen-server-conf-files.sh @@ -3,19 +3,13 @@ CONFIG_FOLDER=${2:-"etc"} BIN_FOLDER=${3-"bin"} MYSQL_ROOT_PASSWORD=${4:-""} +# copy dist files to conf files +cp ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf.dist ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf -echo "LoginDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_auth\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf - -# worldserver or dbimport -if [[ $APP_NAME != "authserver" ]]; then - { - echo "WorldDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_world\"" - echo "CharacterDatabaseInfo = \"localhost;3306;root;$MYSQL_ROOT_PASSWORD;acore_characters\"" - } >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf -fi +# replace login info +sed -i "s/127.0.0.1;3306;acore;acore/localhost;3306;root;$MYSQL_ROOT_PASSWORD/" ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf if [[ $APP_NAME == "worldserver" ]]; then - echo "DataDir = \"./data/\"" >> ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf - + sed -i 's/DataDir = \".\"/DataDir = \".\/data"/' ./env/dist/$CONFIG_FOLDER/$APP_NAME.conf git clone --depth=1 --branch=master --single-branch https://github.com/ac-data/ac-data.git ./env/dist/$BIN_FOLDER/data -fi +fi \ No newline at end of file diff --git a/src/common/Configuration/Config.cpp b/src/common/Configuration/Config.cpp index 29eb390f4..d5750120d 100644 --- a/src/common/Configuration/Config.cpp +++ b/src/common/Configuration/Config.cpp @@ -32,7 +32,6 @@ namespace std::vector _args; std::unordered_map _configOptions; std::mutex _configLock; - bool _usingDistConfig = false; // Check system configs like *server.conf* bool IsAppConfig(std::string_view fileName) @@ -255,8 +254,8 @@ T ConfigMgr::GetValueDefault(std::string const& name, T const& def, bool showLog { if (showLogs) { - LOG_ERROR("server.loading", "> Config: Missing property {} in all config files, at least the .dist file must contain: \"{} = {}\"", - name, name, Acore::ToString(def)); + LOG_ERROR("server.loading", "> Config: Missing property {} in config file {}, add \"{} = {}\" to this file.", + name, _filename, name, Acore::ToString(def)); } return def; @@ -285,8 +284,8 @@ std::string ConfigMgr::GetValueDefault(std::string const& name, std { if (showLogs) { - LOG_ERROR("server.loading", "> Config: Missing option {}, add \"{} = {}\"", - name, name, def); + LOG_ERROR("server.loading", "> Config: Missing property {} in config file {}, add \"{} = {}\" to this file.", + name, _filename, name, def); } return def; @@ -341,7 +340,7 @@ std::vector ConfigMgr::GetKeysByString(std::string const& name) std::string const ConfigMgr::GetFilename() { std::lock_guard lock(_configLock); - return _usingDistConfig ? _filename + ".dist" : _filename; + return _filename; } std::vector const& ConfigMgr::GetArguments() const @@ -377,18 +376,12 @@ void ConfigMgr::Configure(std::string const& initFileName, std::vector