mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-10-11 18:08:05 +00:00
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:
@@ -52,6 +52,7 @@ int main(int argc, char** argv) {
|
|||||||
//Create all the objects we need to run our service:
|
//Create all the objects we need to run our service:
|
||||||
Server::SetupLogger("AuthServer");
|
Server::SetupLogger("AuthServer");
|
||||||
if (!Game::logger) return EXIT_FAILURE;
|
if (!Game::logger) return EXIT_FAILURE;
|
||||||
|
Game::config->LogSettings();
|
||||||
|
|
||||||
LOG("Starting Auth server...");
|
LOG("Starting Auth server...");
|
||||||
LOG("Version: %s", PROJECT_VERSION);
|
LOG("Version: %s", PROJECT_VERSION);
|
||||||
|
@@ -59,6 +59,7 @@ int main(int argc, char** argv) {
|
|||||||
//Create all the objects we need to run our service:
|
//Create all the objects we need to run our service:
|
||||||
Server::SetupLogger("ChatServer");
|
Server::SetupLogger("ChatServer");
|
||||||
if (!Game::logger) return EXIT_FAILURE;
|
if (!Game::logger) return EXIT_FAILURE;
|
||||||
|
Game::config->LogSettings();
|
||||||
|
|
||||||
//Read our config:
|
//Read our config:
|
||||||
|
|
||||||
|
@@ -47,6 +47,7 @@ void dConfig::LoadConfig() {
|
|||||||
void dConfig::ReloadConfig() {
|
void dConfig::ReloadConfig() {
|
||||||
this->m_ConfigValues.clear();
|
this->m_ConfigValues.clear();
|
||||||
LoadConfig();
|
LoadConfig();
|
||||||
|
LogSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& dConfig::GetValue(std::string key) {
|
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];
|
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) {
|
void dConfig::ProcessLine(const std::string& line) {
|
||||||
auto splitLoc = line.find('=');
|
auto splitLoc = line.find('=');
|
||||||
auto key = line.substr(0, splitLoc);
|
auto key = line.substr(0, splitLoc);
|
||||||
|
@@ -29,10 +29,12 @@ public:
|
|||||||
* Reloads the config file to reset values
|
* Reloads the config file to reset values
|
||||||
*/
|
*/
|
||||||
void ReloadConfig();
|
void ReloadConfig();
|
||||||
|
|
||||||
|
void LogSettings() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ProcessLine(const std::string& line);
|
void ProcessLine(const std::string& line);
|
||||||
|
|
||||||
private:
|
|
||||||
std::map<std::string, std::string> m_ConfigValues;
|
std::map<std::string, std::string> m_ConfigValues;
|
||||||
std::string m_ConfigFilePath;
|
std::string m_ConfigFilePath;
|
||||||
};
|
};
|
||||||
|
@@ -99,6 +99,7 @@ int main(int argc, char** argv) {
|
|||||||
//Create all the objects we need to run our service:
|
//Create all the objects we need to run our service:
|
||||||
Server::SetupLogger("MasterServer");
|
Server::SetupLogger("MasterServer");
|
||||||
if (!Game::logger) return EXIT_FAILURE;
|
if (!Game::logger) return EXIT_FAILURE;
|
||||||
|
Game::config->LogSettings();
|
||||||
|
|
||||||
auto folders = { "navmeshes", "migrations", "vanity" };
|
auto folders = { "navmeshes", "migrations", "vanity" };
|
||||||
|
|
||||||
|
@@ -159,6 +159,7 @@ int main(int argc, char** argv) {
|
|||||||
//Create all the objects we need to run our service:
|
//Create all the objects we need to run our service:
|
||||||
Server::SetupLogger("WorldServer_" + std::to_string(zoneID) + "_" + std::to_string(g_InstanceID));
|
Server::SetupLogger("WorldServer_" + std::to_string(zoneID) + "_" + std::to_string(g_InstanceID));
|
||||||
if (!Game::logger) return EXIT_FAILURE;
|
if (!Game::logger) return EXIT_FAILURE;
|
||||||
|
Game::config->LogSettings();
|
||||||
|
|
||||||
LOG("Starting World server...");
|
LOG("Starting World server...");
|
||||||
LOG("Version: %s", Game::projectVersion.c_str());
|
LOG("Version: %s", Game::projectVersion.c_str());
|
||||||
|
Reference in New Issue
Block a user