Merge pull request #404 from ArchieBeepBoop/status_tab_patch

Status tab patch
This commit is contained in:
QuoteFox
2020-08-24 04:46:09 +01:00
committed by GitHub
+25 -11
View File
@@ -1,3 +1,5 @@
/var/tickrefresh = 0
/mob/Destroy()//This makes sure that mobs with clients/keys are not just deleted from the game.
GLOB.mob_list -= src
GLOB.dead_mob_list -= src
@@ -529,25 +531,37 @@
/mob/proc/is_muzzled()
return 0
/var/list/sList
/mob/Stat()
..()
if(statpanel("Status"))
//This is where I try and add a temporary solution to the issue of the status tab. This solution is bad and I should feel bad, but it should mitigate some of the client lag.
if(statpanel("Status") && tickrefresh == 0)
sList = list()
if (client)
stat(null, "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)")
stat(null, "Map: [SSmapping.config?.map_name || "Loading..."]")
sList+= "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)"
sList+= "Map: [SSmapping.config?.map_name || "Loading..."]"
var/datum/map_config/cached = SSmapping.next_map_config
if(cached)
stat(null, "Next Map: [cached.map_name]")
stat(null, "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]")
stat(null, "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]")
stat(null, "Round Time: [WORLDTIME2TEXT("hh:mm:ss")]")
stat(null, "Station Time: [STATION_TIME_TIMESTAMP("hh:mm:ss")]")
stat(null, "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)")
sList+= "Next Map: [cached.map_name]"
sList+= "Round ID: [GLOB.round_id ? GLOB.round_id : "NULL"]"
sList+= "Server Time: [time2text(world.timeofday, "YYYY-MM-DD hh:mm:ss")]"
sList+= "Round Time: [WORLDTIME2TEXT("hh:mm:ss")]"
sList+= "Station Time: [STATION_TIME_TIMESTAMP("hh:mm:ss")]"
sList+= "Time Dilation: [round(SStime_track.time_dilation_current,1)]% AVG:([round(SStime_track.time_dilation_avg_fast,1)]%, [round(SStime_track.time_dilation_avg,1)]%, [round(SStime_track.time_dilation_avg_slow,1)]%)"
if(SSshuttle.emergency)
var/ETA = SSshuttle.emergency.getModeStr()
if(ETA)
stat(null, "[ETA] [SSshuttle.emergency.getTimerStr()]")
sList+= "[ETA] [SSshuttle.emergency.getTimerStr()]"
tickrefresh++
stat(null, sList)
else if(statpanel("Status") && tickrefresh != 0)
if(tickrefresh == 5)
tickrefresh = 0
else
tickrefresh++
stat(null, sList)
if(client && client.holder)
if(statpanel("MC"))