mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-17 13:12:37 +00:00
* Refactors most spans into span procs * AA * a * AAAAAAAAAAAAAAAAAAAAAA * Update species.dm Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
23 lines
639 B
Plaintext
23 lines
639 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_notice("Round trip ping took [round(pingfromtime(time),1)]ms"))
|
|
|
|
/client/verb/ping()
|
|
set name = "Ping"
|
|
set category = "OOC"
|
|
winset(src, null, "command=.display_ping+[world.time+world.tick_lag*TICK_USAGE_REAL/100]")
|