Files
Bubberstation/code/modules/client/verbs/ping.dm
Jordan Brown 30573dc6f1 Adds defines for world.tick_usage (#30184)
* Add tick_usage define

* Move tick.dm -> _tick.dm

* Add TICK_USAGE_REAL define

* Add comments

* Replace all instances of tick usage with appropriate define
2017-08-30 10:09:24 +12:00

22 lines
653 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]")