From d2214dfcf8029349b7bf43d682c697710599b47b Mon Sep 17 00:00:00 2001 From: Mikhail Dzianishchyts Date: Wed, 3 Apr 2024 21:19:39 +0300 Subject: [PATCH] Move default restart timeout to config (#24827) * Move default restart timeout to config * Edit comments * Protect restart_timeout from VV edit * Update code/controllers/configuration/sections/general_configuration.dm Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> * Protected var no more --------- Co-authored-by: GDN <96800819+GDNgit@users.noreply.github.com> --- .../configuration/sections/general_configuration.dm | 5 ++++- code/controllers/subsystem/SSticker.dm | 4 +--- config/example/config.toml | 2 ++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration/sections/general_configuration.dm b/code/controllers/configuration/sections/general_configuration.dm index 8a705d8c61d..35477712f33 100644 --- a/code/controllers/configuration/sections/general_configuration.dm +++ b/code/controllers/configuration/sections/general_configuration.dm @@ -8,8 +8,10 @@ var/server_features = "Medium RP, varied species/jobs" /// Allow character OOC notes var/allow_character_metadata = TRUE - /// Time in seconds for the pregame lobby + /// Time in seconds for the pregame lobby. Measured in seconds var/lobby_time = 240 + /// Default timeout for world reboot. Measured in seconds + var/restart_timeout = 75 /// Ban all Guest BYOND accounts var/guest_ban = TRUE /// Allow players to use AntagHUD? @@ -118,6 +120,7 @@ // Numbers CONFIG_LOAD_NUM(lobby_time, data["lobby_time"]) + CONFIG_LOAD_NUM(restart_timeout, data["restart_timeout"]) CONFIG_LOAD_NUM(base_loadout_points, data["base_loadout_points"]) CONFIG_LOAD_NUM(cryo_penalty_period, data["cryo_penalty_period"]) CONFIG_LOAD_NUM(roundstart_observer_period, data["roundstart_observer_period"]) diff --git a/code/controllers/subsystem/SSticker.dm b/code/controllers/subsystem/SSticker.dm index e8a614eea74..d82b7a45c0b 100644 --- a/code/controllers/subsystem/SSticker.dm +++ b/code/controllers/subsystem/SSticker.dm @@ -13,8 +13,6 @@ SUBSYSTEM_DEF(ticker) var/round_start_time = 0 /// Time that the round started var/time_game_started = 0 - /// Default timeout for if world.Reboot() doesnt have a time specified - var/const/restart_timeout = 75 SECONDS /// Current status of the game. See code\__DEFINES\game.dm var/current_state = GAME_STATE_STARTUP /// Do we want to force-start as soon as we can @@ -724,7 +722,7 @@ SUBSYSTEM_DEF(ticker) delay = max(0, delay) else // Use default restart timeout - delay = restart_timeout + delay = max(0, GLOB.configuration.general.restart_timeout SECONDS) to_chat(world, "Rebooting world in [delay/10] [delay > 10 ? "seconds" : "second"]. [reason]") diff --git a/config/example/config.toml b/config/example/config.toml index e09198a3e52..0502825cb37 100644 --- a/config/example/config.toml +++ b/config/example/config.toml @@ -275,6 +275,8 @@ server_features = "Medium RP, varied species/jobs" allow_character_metadata = true # Lobby time before roundstart (Seconds) lobby_time = 240 +# Default timeout for world reboot (Seconds) +restart_timeout = 75 # Forbid people without a BYOND account joining the server guest_ban = true # Allow players to use antagHUD?