diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 476815ad0de..e315fbf5dee 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -245,6 +245,7 @@ var/list/gamemode_cache = list() // Master Controller settings. var/mc_init_tick_limit = TICK_LIMIT_MC_INIT_DEFAULT + var/fastboot = FALSE // If true, take some shortcuts during boot to speed it up for testing. Probably should not be used on production servers. //UDP GELF Logging var/log_gelf_enabled = 0 @@ -285,6 +286,11 @@ var/list/gamemode_cache = list() src.votable_modes += M.config_tag src.votable_modes += "secret" +#ifdef UNIT_TEST + fastboot = TRUE + world.log << "UNIT_TEST present. Forcing fastboot on." +#endif + /datum/configuration/proc/load(filename, type = "config") //the type can also be game_options, in which case it uses a different switch. not making it separate to not copypaste code - Urist var/list/Lines = file2list(filename) @@ -819,6 +825,9 @@ var/list/gamemode_cache = list() if("access_warn_vms") access_warn_vms = text2num(value) + if("fastboot") + fastboot = TRUE + else log_misc("Unknown setting in configuration: '[name]'") diff --git a/code/controllers/subsystems/icon_smooth.dm b/code/controllers/subsystems/icon_smooth.dm index fcd81994bd5..6f8ded3b96c 100644 --- a/code/controllers/subsystems/icon_smooth.dm +++ b/code/controllers/subsystems/icon_smooth.dm @@ -40,6 +40,11 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth for (var/zlevel = 1 to world.maxz) smooth_zlevel(zlevel, FALSE) + if (config.fastboot) + log_debug("icon_smoothing: Skipping prebake, fastboot enabled.") + ..() + return + var/queue = smooth_queue smooth_queue = list() for(var/V in queue) diff --git a/code/controllers/subsystems/sunlight.dm b/code/controllers/subsystems/sunlight.dm index ce678f64fbf..be49e45cf13 100644 --- a/code/controllers/subsystems/sunlight.dm +++ b/code/controllers/subsystems/sunlight.dm @@ -17,10 +17,16 @@ ..("A:[config.sun_accuracy] LP:[light_points.len] Z:[config.sun_target_z]") /datum/controller/subsystem/sunlight/Initialize() + presets = list() for (var/thing in subtypesof(/datum/sun_state)) presets += new thing + if (config.fastboot) + log_debug("sunlight: fastboot detected, skipping setup.") + ..() + return + var/thing var/turf/T for (thing in block(locate(1, 1, config.sun_target_z), locate(world.maxx, world.maxy, config.sun_target_z))) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index b7064504f13..9f949451f73 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -751,6 +751,8 @@ stat("CPU:", world.cpu) stat("Tick Usage:", world.tick_usage) stat("Instances:", world.contents.len) + if (config.fastboot) + stat(null, "FASTBOOT ENABLED") if(Master) Master.stat_entry() else diff --git a/config/example/config.txt b/config/example/config.txt index 4f66a31f001..b5685e0338d 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -464,3 +464,7 @@ LOG_GELF_PORT 12201 ## This determines how many VM identifiers must be spotted on a user before admins are warned about them joining. ## Leave at 0 or commented out to disable. # ACCESS_WARN_VMS 2 + + +# Enables fastboot - some features not essential to testing (like sunlight) will be disabled to speed up server boot. Should not be used on production servers. +# FASTBOOT