Files
Aurora.3/code/controllers/subsystems/ping.dm
Fluffy 91e89a3d73 Attempt fix blackscreen (#18434)
* first reordering, committed in case i fuck up badly next

* from the moment i understood the weakness of my flesh

* sdafa

* you asked for this

* we can't have nice things

* sdafasdf

* sdafasd

* sdfa

* fsa

* worth a shot

* more pain

* sdfasdf
2024-02-20 11:37:52 +00:00

36 lines
956 B
Plaintext

SUBSYSTEM_DEF(ping)
name = "Ping"
priority = FIRE_PRIORITY_PING
init_stage = INITSTAGE_EARLY
wait = 4 SECONDS
flags = SS_NO_INIT
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
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