mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-01-05 23:21:53 +00:00
Alarm system overhaul
This commit is contained in:
@@ -25,7 +25,7 @@ var/global/datum/controller/failsafe/failsafe
|
||||
|
||||
failsafe = src
|
||||
|
||||
failsafe.process()
|
||||
//failsafe.process()
|
||||
|
||||
/datum/controller/failsafe/proc/process()
|
||||
processing = 1
|
||||
@@ -36,22 +36,4 @@ var/global/datum/controller/failsafe/failsafe
|
||||
while(1) // More efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop.
|
||||
iteration++
|
||||
|
||||
if(processing)
|
||||
if(master_controller.processing) // Only poke if these overrides aren't in effect
|
||||
if(masterControllerIteration == master_controller.iteration) // Master controller hasn't finished processing in the defined interval.
|
||||
switch(masterControllerAlertLevel)
|
||||
if(0 to 3)
|
||||
masterControllerAlertLevel++
|
||||
if(4)
|
||||
admins << "<font color='red' size='2'><b>Warning. The master Controller has not fired in the last [masterControllerAlertLevel * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
|
||||
masterControllerAlertLevel = 5
|
||||
if(5)
|
||||
admins << "<font color='red' size='2'><b>Warning. The master Controller has still not fired within the last [masterControllerAlertLevel * processing_interval] ticks. Killing and restarting...</b></font>"
|
||||
new /datum/controller/game_controller() // Replace the old master controller (hence killing the old one's process).
|
||||
master_controller.process() // Start it rolling again.
|
||||
masterControllerAlertLevel = 0
|
||||
else
|
||||
masterControllerAlertLevel = 0
|
||||
masterControllerIteration = master_controller.iteration
|
||||
|
||||
sleep(processing_interval)
|
||||
|
||||
Reference in New Issue
Block a user