mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-01-16 04:12:21 +00:00
* SDQL2 update * fix that verb * cl * fix that * toworld * this is pointless * update info * siiiiick.. * vv edit update * fix that * fix editing vars * fix VV * Port the /TG/ globals controller. * part 1 * part 2 * oops * part 3 * Hollow Purple * sadas * bsbsdb * muda na agaki ta * ids 1-15 * 16-31 * 41-75 * bring me back to how things used to be before i lost it all * the strength of mayhem * final touches * cl * protect some vars * update sdql2 to use glob * stuff? * forgot that is not defined there * whoops * observ * but it never gets better * a --------- Co-authored-by: Matt Atlas <liermattia@gmail.com>
38 lines
1.0 KiB
Plaintext
38 lines
1.0 KiB
Plaintext
SUBSYSTEM_DEF(ping)
|
|
name = "Ping"
|
|
priority = SS_PRIORITY_PING
|
|
init_order = SS_INIT_PING
|
|
wait = 4 SECONDS
|
|
flags = SS_NO_INIT
|
|
runlevels = RUNLEVEL_INIT | RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
|
init_stage = INITSTAGE_EARLY
|
|
|
|
var/list/currentrun = list()
|
|
|
|
/datum/controller/subsystem/ping/stat_entry(msg)
|
|
msg = "P:[GLOB.clients.len]"
|
|
return ..()
|
|
|
|
/datum/controller/subsystem/ping/fire(resumed = FALSE)
|
|
// Prepare the new batch of clients
|
|
if (!resumed)
|
|
src.currentrun = GLOB.clients.Copy()
|
|
|
|
// De-reference the list for sanic speeds
|
|
var/list/currentrun = src.currentrun
|
|
|
|
while (currentrun.len)
|
|
var/client/client = currentrun[currentrun.len]
|
|
currentrun.len--
|
|
|
|
if (client?.tgui_panel?.is_ready())
|
|
// Send a soft ping
|
|
client.tgui_panel.window.send_message("ping/soft", list(
|
|
// Slightly less than the subsystem timer (somewhat arbitrary)
|
|
// to prevent incoming pings from resetting the afk state
|
|
"afk" = client.is_afk(3.5 SECONDS),
|
|
))
|
|
|
|
if (MC_TICK_CHECK)
|
|
return
|