mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Actually hooks up the StonedMC to run its subsystems in Polaris
* Hooks up informing Master the gameticker actually starts and stops the round subsystems will actually fire! What ho! * We should convert the gameticker as an MC subsystem someday, and probably completely rewrite it while we are at it becuase it is crazy. But this should bridge the gap until then.
This commit is contained in:
@@ -34,5 +34,9 @@ var/global/datum/controller/process/ticker/tickerProcess
|
||||
/datum/controller/process/ticker/proc/getLastTickerTimeDuration()
|
||||
return lastTickerTimeDuration
|
||||
|
||||
/world/proc/has_round_started()
|
||||
// Use these preferentially to directly examining ticker.current_state to help prepare for transition to ticker as subsystem!
|
||||
/datum/controller/process/ticker/proc/HasRoundStarted()
|
||||
return (ticker && ticker.current_state >= GAME_STATE_PLAYING)
|
||||
|
||||
/datum/controller/process/ticker/proc/IsRoundInProgress()
|
||||
return (ticker && ticker.current_state == GAME_STATE_PLAYING)
|
||||
|
||||
@@ -62,6 +62,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
vote.process()
|
||||
if(pregame_timeleft <= 0)
|
||||
current_state = GAME_STATE_SETTING_UP
|
||||
Master.SetRunLevel(RUNLEVEL_SETUP)
|
||||
while (!setup())
|
||||
|
||||
|
||||
@@ -74,6 +75,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
if((master_mode=="random") || (master_mode=="secret"))
|
||||
if(!runnable_modes.len)
|
||||
current_state = GAME_STATE_PREGAME
|
||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||
world << "<B>Unable to choose playable game mode.</B> Reverting to pre-game lobby."
|
||||
return 0
|
||||
if(secret_force_mode != "secret")
|
||||
@@ -88,6 +90,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
if(!src.mode)
|
||||
current_state = GAME_STATE_PREGAME
|
||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||
world << "<span class='danger'>Serious error in mode setup!</span> Reverting to pre-game lobby."
|
||||
return 0
|
||||
|
||||
@@ -99,6 +102,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
if(!src.mode.can_start())
|
||||
world << "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players needed. Reverting to pre-game lobby."
|
||||
current_state = GAME_STATE_PREGAME
|
||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||
mode.fail_setup()
|
||||
mode = null
|
||||
job_master.ResetOccupations()
|
||||
@@ -127,6 +131,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
shuttle_controller.setup_shuttle_docks()
|
||||
|
||||
// TODO - Leshana - Dear God Fix This. Fix all of this. Not just this line, this entire proc. This entire file!
|
||||
spawn(0)//Forking here so we dont have to wait for this to finish
|
||||
mode.post_setup()
|
||||
//Cleanup some stuff
|
||||
@@ -155,6 +160,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
*/
|
||||
|
||||
processScheduler.start()
|
||||
Master.SetRunLevel(RUNLEVEL_GAME)
|
||||
|
||||
if(config.sql_enabled)
|
||||
statistic_cycle() // Polls population totals regularly and stores them in an SQL DB -- TLE
|
||||
@@ -319,6 +325,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
|
||||
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))
|
||||
current_state = GAME_STATE_FINISHED
|
||||
Master.SetRunLevel(RUNLEVEL_POSTGAME)
|
||||
|
||||
spawn
|
||||
declare_completion()
|
||||
|
||||
@@ -783,6 +783,7 @@ proc/admin_notice(var/message, var/rights)
|
||||
return
|
||||
if(ticker.current_state == GAME_STATE_PREGAME)
|
||||
ticker.current_state = GAME_STATE_SETTING_UP
|
||||
Master.SetRunLevel(RUNLEVEL_SETUP)
|
||||
log_admin("[usr.key] has started the game.")
|
||||
message_admins("<font color='blue'>[usr.key] has started the game.</font>")
|
||||
feedback_add_details("admin_verb","SN") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
|
||||
|
||||
@@ -45,6 +45,7 @@ var/total_unit_tests = 0
|
||||
sleep(1)
|
||||
|
||||
ticker.current_state = GAME_STATE_SETTING_UP
|
||||
Master.SetRunLevel(RUNLEVEL_SETUP)
|
||||
|
||||
log_unit_test("Round has been started. Waiting 10 seconds to start tests.")
|
||||
sleep(100)
|
||||
|
||||
@@ -433,6 +433,7 @@ var/world_topic_spam_protect_time = world.timeofday
|
||||
*/
|
||||
|
||||
processScheduler.stop()
|
||||
Master.Shutdown() //run SS shutdowns
|
||||
|
||||
for(var/client/C in clients)
|
||||
if(config.server) //if you set a server location in config.txt, it sends you there instead of trying to reconnect to the same world address. -- NeoFite
|
||||
|
||||
Reference in New Issue
Block a user