Alarm system overhaul

This commit is contained in:
Markolie
2015-08-02 07:13:03 +02:00
parent 4028c2af12
commit 73e94b5dc4
66 changed files with 1452 additions and 1887 deletions

View File

@@ -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)