fix: hardcore mode fixes (#1883)

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 18:12:50 -07:00
committed by GitHub
parent bb05b3ac0d
commit 4a577f233d
6 changed files with 16 additions and 1 deletions

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;
};