mirror of
				https://github.com/DarkflameUniverse/DarkflameServer.git
				synced 2025-11-04 14:42:02 +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:
 | 
			
		||||
	Server::SetupLogger("AuthServer");
 | 
			
		||||
	if (!Game::logger) return EXIT_FAILURE;
 | 
			
		||||
	Game::config->LogSettings();
 | 
			
		||||
 | 
			
		||||
	LOG("Starting Auth server...");
 | 
			
		||||
	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:
 | 
			
		||||
	Server::SetupLogger("ChatServer");
 | 
			
		||||
	if (!Game::logger) return EXIT_FAILURE;
 | 
			
		||||
	Game::config->LogSettings();
 | 
			
		||||
 | 
			
		||||
	//Read our config:
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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);
 | 
			
		||||
 
 | 
			
		||||
@@ -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;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -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" };
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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());
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user