Ports "Better repeated MC crash handling"

* From https://github.com/tgstation/tgstation/pull/25813
* If the MC crashes: The problem subsystem will be rebooted on its 2nd strike and disabled on its third.
This commit is contained in:
Leshana
2017-06-07 16:42:06 -04:00
parent b996d5c6b2
commit 82e90a206c
2 changed files with 21 additions and 0 deletions

View File

@@ -107,7 +107,26 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
else
msg += "\t [varname] = [varval]\n"
log_world(msg)
var/datum/controller/subsystem/BadBoy = Master.last_type_processed
var/FireHim = FALSE
if(istype(BadBoy))
msg = null
switch(++BadBoy.failure_strikes)
if(2)
msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again."
FireHim = TRUE
if(3)
msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined."
BadBoy.flags |= SS_NO_FIRE
if(msg)
log_game(msg)
message_admins("<span class='boldannounce'>[msg]</span>")
log_world(msg)
if (istype(Master.subsystems))
if(FireHim)
Master.subsystems += new BadBoy.type //NEW_SS_GLOBAL will remove the old one
subsystems = Master.subsystems
StartProcessing(10)
else