fix: hardcore mode fixes

fixes hardcore modes uscore drops
adds config option for excluded item drops

f

feat: Add logging for config options on load and reload

feat: Add logging for config options on load and reload
This commit is contained in:
David Markowitz
2025-09-21 14:24:54 -07:00
parent bb05b3ac0d
commit 22eb92e570
6 changed files with 16 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ int main(int argc, char** argv) {
//Create all the objects we need to run our service:
Server::SetupLogger("AuthServer");
if (!Game::logger) return EXIT_FAILURE;
Game::config->LogSettings();
LOG("Starting Auth server...");
LOG("Version: %s", PROJECT_VERSION);

View File

@@ -59,6 +59,7 @@ int main(int argc, char** argv) {
//Create all the objects we need to run our service:
Server::SetupLogger("ChatServer");
if (!Game::logger) return EXIT_FAILURE;
Game::config->LogSettings();
//Read our config:

View File

@@ -47,6 +47,7 @@ void dConfig::LoadConfig() {
void dConfig::ReloadConfig() {
this->m_ConfigValues.clear();
LoadConfig();
LogSettings();
}
const std::string& dConfig::GetValue(std::string key) {
@@ -58,6 +59,14 @@ const std::string& dConfig::GetValue(std::string key) {
return this->m_ConfigValues[key];
}
void dConfig::LogSettings() const {
LOG("Configuration settings:");
for (const auto& [key, value] : m_ConfigValues) {
const auto& valueLog = key.find("password") != std::string::npos ? "<HIDDEN>" : value;
LOG(" %s = %s", key.c_str(), valueLog.c_str());
}
}
void dConfig::ProcessLine(const std::string& line) {
auto splitLoc = line.find('=');
auto key = line.substr(0, splitLoc);

View File

@@ -29,10 +29,12 @@ public:
* Reloads the config file to reset values
*/
void ReloadConfig();
void LogSettings() const;
private:
void ProcessLine(const std::string& line);
private:
std::map<std::string, std::string> m_ConfigValues;
std::string m_ConfigFilePath;
};

View File

@@ -99,6 +99,7 @@ int main(int argc, char** argv) {
//Create all the objects we need to run our service:
Server::SetupLogger("MasterServer");
if (!Game::logger) return EXIT_FAILURE;
Game::config->LogSettings();
auto folders = { "navmeshes", "migrations", "vanity" };

View File

@@ -159,6 +159,7 @@ int main(int argc, char** argv) {
//Create all the objects we need to run our service:
Server::SetupLogger("WorldServer_" + std::to_string(zoneID) + "_" + std::to_string(g_InstanceID));
if (!Game::logger) return EXIT_FAILURE;
Game::config->LogSettings();
LOG("Starting World server...");
LOG("Version: %s", Game::projectVersion.c_str());