diff --git a/code/_globalvars/logging.dm b/code/_globalvars/logging.dm index c2f0efba451..00665bdfe22 100644 --- a/code/_globalvars/logging.dm +++ b/code/_globalvars/logging.dm @@ -10,6 +10,8 @@ GLOBAL_VAR(world_href_log) GLOBAL_PROTECT(world_href_log) GLOBAL_VAR(round_id) GLOBAL_PROTECT(round_id) +GLOBAL_VAR(config_error_log) +GLOBAL_PROTECT(config_error_log) GLOBAL_LIST_EMPTY(bombers) GLOBAL_PROTECT(bombers) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index cb4416e2983..730582070ae 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -269,7 +269,7 @@ if(M.config_tag) if(!(M.config_tag in modes)) // ensure each mode is added only once - GLOB.world_game_log << "Adding game mode [M.name] ([M.config_tag]) to configuration." + GLOB.config_error_log << "Adding game mode [M.name] ([M.config_tag]) to configuration." modes += M.config_tag mode_names[M.config_tag] = M.name probabilities[M.config_tag] = M.probability @@ -534,7 +534,7 @@ if("error_msg_delay") error_msg_delay = text2num(value) else - GLOB.world_game_log << "Unknown setting in configuration: '[name]'" + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" else if(type == "game_options") switch(name) @@ -597,13 +597,13 @@ if(mode_name in modes) continuous[mode_name] = 1 else - GLOB.world_game_log << "Unknown continuous configuration definition: [mode_name]." + GLOB.config_error_log << "Unknown continuous configuration definition: [mode_name]." if("midround_antag") var/mode_name = lowertext(value) if(mode_name in modes) midround_antag[mode_name] = 1 else - GLOB.world_game_log << "Unknown midround antagonist configuration definition: [mode_name]." + GLOB.config_error_log << "Unknown midround antagonist configuration definition: [mode_name]." if("midround_antag_time_check") midround_antag_time_check = text2num(value) if("midround_antag_life_check") @@ -619,9 +619,9 @@ if(mode_name in modes) min_pop[mode_name] = text2num(mode_value) else - GLOB.world_game_log << "Unknown minimum population configuration definition: [mode_name]." + GLOB.config_error_log << "Unknown minimum population configuration definition: [mode_name]." else - GLOB.world_game_log << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." + GLOB.config_error_log << "Incorrect minimum population configuration definition: [mode_name] [mode_value]." if("max_pop") var/pop_pos = findtext(value, " ") var/mode_name = null @@ -633,9 +633,9 @@ if(mode_name in modes) max_pop[mode_name] = text2num(mode_value) else - GLOB.world_game_log << "Unknown maximum population configuration definition: [mode_name]." + GLOB.config_error_log << "Unknown maximum population configuration definition: [mode_name]." else - GLOB.world_game_log << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." + GLOB.config_error_log << "Incorrect maximum population configuration definition: [mode_name] [mode_value]." if("shuttle_refuel_delay") shuttle_refuel_delay = text2num(value) if("show_game_type_odds") @@ -663,9 +663,9 @@ if(prob_name in modes) probabilities[prob_name] = text2num(prob_value) else - GLOB.world_game_log << "Unknown game mode probability configuration definition: [prob_name]." + GLOB.config_error_log << "Unknown game mode probability configuration definition: [prob_name]." else - GLOB.world_game_log << "Incorrect probability configuration definition: [prob_name] [prob_value]." + GLOB.config_error_log << "Incorrect probability configuration definition: [prob_name] [prob_value]." if("protect_roles_from_antagonist") protect_roles_from_antagonist = 1 @@ -712,7 +712,7 @@ // Value is in the form "LAWID,NUMBER" var/list/L = splittext(value, ",") if(L.len != 2) - GLOB.world_game_log << "Invalid LAW_WEIGHT: " + t + GLOB.config_error_log << "Invalid LAW_WEIGHT: " + t continue var/lawid = L[1] var/weight = text2num(L[2]) @@ -767,7 +767,7 @@ if("mice_roundstart") mice_roundstart = text2num(value) else - GLOB.world_game_log << "Unknown setting in configuration: '[name]'" + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" fps = round(fps) if(fps <= 0) @@ -821,7 +821,7 @@ maplist[currentmap.map_name] = currentmap currentmap = null else - GLOB.world_game_log << "Unknown command in map vote config: '[command]'" + GLOB.config_error_log << "Unknown command in map vote config: '[command]'" /datum/configuration/proc/loadsql(filename) @@ -865,7 +865,7 @@ if("feedback_tableprefix") global.sqlfdbktableprefix = value else - GLOB.world_game_log << "Unknown setting in configuration: '[name]'" + GLOB.config_error_log << "Unknown setting in configuration: '[name]'" /datum/configuration/proc/pick_mode(mode_name) // I wish I didn't have to instance the game modes in order to look up diff --git a/code/world.dm b/code/world.dm index 03508e64102..c46e3a9fb82 100644 --- a/code/world.dm +++ b/code/world.dm @@ -25,6 +25,8 @@ else external_rsc_urls.Cut(i,i+1) #endif + GLOB.config_error_log = file("data/logs/config_error.log") //temporary file used to record errors with loading config, moved to log directory once logging is set bl + make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) config = new GLOB.log_directory = "data/logs/[time2text(world.realtime, "YYYY/MM/DD")]/round-" if(config.sql_enabled) @@ -49,8 +51,10 @@ GLOB.world_attack_log << "\n\nStarting up round ID [GLOB.round_id]. [time_stamp()]\n---------------------" GLOB.world_runtime_log << "\n\nStarting up round ID [GLOB.round_id]. [time_stamp()]\n---------------------" GLOB.changelog_hash = md5('html/changelog.html') //used for telling if the changelog has changed recently + if(fexists(GLOB.config_error_log)) + fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log") + fdel(GLOB.config_error_log) - make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once) GLOB.revdata.DownloadPRDetails() load_mode() load_motd()