From 81138b8b6605c5f2ce337e69f4dda9d4e6e5e1d9 Mon Sep 17 00:00:00 2001 From: SabreML <57483089+SabreML@users.noreply.github.com> Date: Wed, 27 Jan 2021 17:39:21 +0000 Subject: [PATCH] Adds a warning message if the game config files aren't set up properly (#15238) * Config file warning V1 * Better version * More stuff * Log and ingame message * File names Also removed all ' from the `log_world()` since they ended up encrypted in the actual log. --- code/game/world.dm | 9 +++++---- code/modules/mob/login.dm | 4 ++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/code/game/world.dm b/code/game/world.dm index eeca8b321ba..48063b2395d 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -24,14 +24,16 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) TgsNew(new /datum/tgs_event_handler/impl, TGS_SECURITY_TRUSTED) // creates a new TGS object log_world("World loaded at [time_stamp()]") - log_world("[GLOB.vars.len - GLOB.gvars_datum_in_built_vars.len] global variables") + log_world("[length(GLOB.vars) - length(GLOB.gvars_datum_in_built_vars)] global variables") GLOB.revision_info.log_info() - load_admins(run_async=FALSE) // This better happen early on. + load_admins(run_async = FALSE) // This better happen early on. #ifdef UNIT_TESTS log_world("Unit Tests Are Enabled!") #endif + if(!fexists("config/config.txt") || !fexists("config/game_options.txt")) + stack_trace("The game config files have not been properly set! Please copy ALL files from '/config/example' into the parent folder, '/config'.") if(byond_version < MIN_COMPILER_VERSION || byond_build < MIN_COMPILER_BUILD) log_world("Your server's byond version does not meet the recommended requirements for this code. Please update BYOND") @@ -44,7 +46,7 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) startup_procs() // Call procs that need to occur on startup (Generate lists, load MOTD, etc) - src.update_status() + update_status() GLOB.space_manager.initialize() //Before the MC starts up @@ -57,7 +59,6 @@ GLOBAL_LIST_INIT(map_transition_config, MAP_TRANSITION_CONFIG) HandleTestRun() #endif - return // This is basically a replacement for hook/startup. Please dont shove random bullshit here // If it doesnt need to happen IMMEDIATELY on world load, make a subsystem for it diff --git a/code/modules/mob/login.dm b/code/modules/mob/login.dm index 639f3da7aaf..81150ac3be5 100644 --- a/code/modules/mob/login.dm +++ b/code/modules/mob/login.dm @@ -68,5 +68,9 @@ for(var/datum/alternate_appearance/AA in viewing_alternate_appearances) AA.display_to(list(src)) + if(!fexists("config/config.txt") || !fexists("config/game_options.txt")) + to_chat(src, "The game config files have not been properly set!\n Please copy ALL files from '/config/example' into the parent folder, '/config'.") + log_world("The game config files have not been properly set! Please copy ALL files from /config/example into the parent folder, /config.") + update_client_colour(0) update_morgue()