From ccf3e74074809e32b1d22c4e377445da78299ef7 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 22 Feb 2017 08:41:12 -0500 Subject: [PATCH] Cleans up new lobby timing (#24250) * Cleans up new lobby timing * Changes --- code/controllers/master.dm | 3 +++ code/controllers/subsystem/ticker.dm | 13 ++++++++----- code/modules/mob/new_player/login.dm | 2 ++ 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/code/controllers/master.dm b/code/controllers/master.dm index 4df9a46c136..ef91d1c1e64 100644 --- a/code/controllers/master.dm +++ b/code/controllers/master.dm @@ -39,6 +39,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING var/make_runtime = 0 + var/initializations_finished_with_no_players_logged_in //I wonder what this could be? // Has round started? (So we know what subsystems to run) var/round_started = 0 @@ -150,7 +151,9 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING // Set world options. world.sleep_offline = 1 world.fps = config.fps + var/initialized_tod = world.timeofday sleep(1) + initializations_finished_with_no_players_logged_in = initialized_tod < world.timeofday - 10 // Loop. Master.StartProcessing(0) diff --git a/code/controllers/subsystem/ticker.dm b/code/controllers/subsystem/ticker.dm index e42845f9612..92244a45f0a 100644 --- a/code/controllers/subsystem/ticker.dm +++ b/code/controllers/subsystem/ticker.dm @@ -71,14 +71,17 @@ var/datum/subsystem/ticker/ticker syndicate_code_response = generate_code_phrase() ..() start_at = world.time + (config.lobby_countdown * 10) - world << "Welcome to [station_name()]!" - world << "Please set up your character and select \"Ready\". The game will start in about [config.lobby_countdown] seconds." - current_state = GAME_STATE_PREGAME - for(var/client/C in clients) - window_flash(C, ignorepref = TRUE) //let them know lobby has opened up. /datum/subsystem/ticker/fire() switch(current_state) + if(GAME_STATE_STARTUP) + if(Master.initializations_finished_with_no_players_logged_in) + start_at = world.time + (config.lobby_countdown * 10) + for(var/client/C in clients) + window_flash(C, ignorepref = TRUE) //let them know lobby has opened up. + world << "Welcome to [station_name()]!" + current_state = GAME_STATE_PREGAME + fire() if(GAME_STATE_PREGAME) //lobby stats for statpanels if(isnull(timeLeft)) diff --git a/code/modules/mob/new_player/login.dm b/code/modules/mob/new_player/login.dm index 0e70d3eea95..826a31c0a30 100644 --- a/code/modules/mob/new_player/login.dm +++ b/code/modules/mob/new_player/login.dm @@ -28,3 +28,5 @@ */ new_player_panel() client.playtitlemusic() + if(ticker.current_state < GAME_STATE_SETTING_UP) + src << "Please set up your character and select \"Ready\". The game will start in about [round(ticker.GetTimeLeft()/10)] seconds." \ No newline at end of file