Files
Bubberstation/code/modules/client/verbs/ping.dm
spookydonut 2591ce17a6 Travis EOF newline detection v3 (#47539)
* scream

* aaa

* aaa

* new one
2019-11-04 19:16:50 -08:00

23 lines
654 B
Plaintext

/client/verb/update_ping(time as num)
set instant = TRUE
set name = ".update_ping"
var/ping = pingfromtime(time)
lastping = ping
if (!avgping)
avgping = ping
else
avgping = MC_AVERAGE_SLOW(avgping, ping)
/client/proc/pingfromtime(time)
return ((world.time+world.tick_lag*TICK_USAGE_REAL/100)-time)*100
/client/verb/display_ping(time as num)
set instant = TRUE
set name = ".display_ping"
to_chat(src, "<span class='notice'>Round trip ping took [round(pingfromtime(time),1)]ms</span>")
/client/verb/ping()
set name = "Ping"
set category = "OOC"
winset(src, null, "command=.display_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]")