mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 04:57:12 +01:00
2-way server heartbeats (plus bonus DMAPI update) (#21101)
* 2-way server heartbeats * Upgrades people, upgrades * DMAPI bump again * How did this compile * BALLS
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
SUBSYSTEM_DEF(heartbeat)
|
||||
name = "Heartbeat"
|
||||
flags = SS_KEEP_TIMING
|
||||
wait = 30 SECONDS
|
||||
runlevels = RUNLEVEL_INIT | RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME // ALL THE THINGS
|
||||
/// Last time we got a heartbeat from TGS
|
||||
var/last_heartbeat = 0
|
||||
/// Has a warning been sent this round?
|
||||
var/warning_tripped = FALSE
|
||||
|
||||
/datum/controller/subsystem/heartbeat/Initialize()
|
||||
// Disable if we arent running on TGS
|
||||
if(!world.TgsAvailable())
|
||||
flags |= SS_NO_FIRE
|
||||
|
||||
/datum/controller/subsystem/heartbeat/fire(resumed)
|
||||
// If the last heartbeat is 0, we never got one this round
|
||||
if(last_heartbeat != 0 && (last_heartbeat + 2 MINUTES < REALTIMEOFDAY) && !warning_tripped)
|
||||
to_chat(GLOB.admins, "<hr><center><span class='userdanger'><big>--- CRITICAL ---</big></span><br>The server hasn't received an uptime check from the server daemon for over 2 minutes. Inform AA ASAP.</center><hr>")
|
||||
warning_tripped = TRUE
|
||||
Reference in New Issue
Block a user