diff --git a/share/gamedir/cfg/dedicated_config.py b/share/gamedir/cfg/dedicated_config.py index 1b17f5702..7882b2ca1 100644 --- a/share/gamedir/cfg/dedicated_config.py +++ b/share/gamedir/cfg/dedicated_config.py @@ -8,6 +8,7 @@ SERVER_PORT = 23400 # What port to start server on, 23400 is the default # Where to log what is happening +#NOTE: Do not specify path here, only file name. Path will be searched automatically based on Openlierox settings LOG_FILE = "dedicated_control.log" MIN_PLAYERS = 1 diff --git a/share/gamedir/cfg/dedicated_config_lx56.py b/share/gamedir/cfg/dedicated_config_lx56.py index 6664c3d89..5a543624b 100644 --- a/share/gamedir/cfg/dedicated_config_lx56.py +++ b/share/gamedir/cfg/dedicated_config_lx56.py @@ -8,6 +8,7 @@ SERVER_PORT = 23402 # What port to start server on, 23400 is the default # Where to log what is happening +#NOTE: Do not specify path here, only file name. Path will be searched automatically based on Openlierox settings LOG_FILE = "dedicated_control.log" MIN_PLAYERS = 1 diff --git a/share/gamedir/scripts/dedicated_control_io.py b/share/gamedir/scripts/dedicated_control_io.py index 5b015d50d..81fdc8691 100644 --- a/share/gamedir/scripts/dedicated_control_io.py +++ b/share/gamedir/scripts/dedicated_control_io.py @@ -230,14 +230,16 @@ def messageLog(message,severity = LOG_INFO): outline += " -- " outline += str(message) #incase we get anything other than string + try: - f = open(cfg.LOG_FILE,"a") + log_filename = getWriteFullFileName(cfg.LOG_FILE) + f = open(log_filename,"a") f.write((outline + "\n")) f.close() except IOError: msg("ERROR: Unable to open logfile.") except NameError: # can happen if cfg is not defined - we accept that - pass + msg("WARN: Name error when attempting to log - cfg probably not loaded yet") #It's possible that we get a broken pipe here, but we can't exit clearly and also display it, # so let python send out the ugly warning.