Merge pull request #7920 from Atermonera/ping_verb_fix

Removes ping subsystem that was breaking chat
This commit is contained in:
Schnayy
2021-02-26 08:58:53 -06:00
committed by GitHub
8 changed files with 0 additions and 53 deletions

View File

@@ -57,7 +57,6 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
#define INIT_ORDER_SKYBOX 30 #define INIT_ORDER_SKYBOX 30
#define INIT_ORDER_MAPPING 25 #define INIT_ORDER_MAPPING 25
#define INIT_ORDER_DECALS 20 #define INIT_ORDER_DECALS 20
#define INIT_ORDER_PING 18
#define INIT_ORDER_JOB 17 #define INIT_ORDER_JOB 17
#define INIT_ORDER_ALARM 16 // Must initialize before atoms. #define INIT_ORDER_ALARM 16 // Must initialize before atoms.
#define INIT_ORDER_ATOMS 15 #define INIT_ORDER_ATOMS 15
@@ -90,7 +89,6 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
#define FIRE_PRIORITY_NIGHTSHIFT 5 #define FIRE_PRIORITY_NIGHTSHIFT 5
#define FIRE_PRIORITY_ORBIT 8 #define FIRE_PRIORITY_ORBIT 8
#define FIRE_PRIORITY_VOTE 9 #define FIRE_PRIORITY_VOTE 9
#define FIRE_PRIORITY_PING 9
#define FIRE_PRIORITY_AI 10 #define FIRE_PRIORITY_AI 10
#define FIRE_PRIORITY_GARBAGE 15 #define FIRE_PRIORITY_GARBAGE 15
#define FIRE_PRIORITY_ALARM 20 #define FIRE_PRIORITY_ALARM 20

View File

@@ -1,30 +0,0 @@
#define PING_BUFFER_TIME 25
SUBSYSTEM_DEF(ping)
name = "Ping"
wait = 6
flags = SS_NO_INIT|SS_POST_FIRE_TIMING
priority = FIRE_PRIORITY_PING
init_order = INIT_ORDER_PING
runlevels = RUNLEVEL_LOBBY|RUNLEVEL_SETUP|RUNLEVEL_GAME|RUNLEVEL_POSTGAME
var/list/currentrun
/datum/controller/subsystem/ping/fire(resumed = FALSE)
if (!resumed)
src.currentrun = GLOB.clients.Copy()
var/list/currentrun = src.currentrun
while (length(currentrun))
var/client/C = currentrun[currentrun.len]
currentrun.len--
if (!C || world.time - C.connection_time < PING_BUFFER_TIME)
if (MC_TICK_CHECK)
return
continue
winset(C, null, "command=.update_ping+[world.time+world.tick_lag*world.tick_usage/100]")
if (MC_TICK_CHECK) //one day, when ss13 has 1000 people per server, you guys are gonna be glad I added this tick check
return
currentrun = null
#undef PING_BUFFER_TIME

View File

@@ -74,6 +74,3 @@
var/connection_realtime var/connection_realtime
///world.timeofday they connected ///world.timeofday they connected
var/connection_timeofday var/connection_timeofday
var/lastping = 0
var/avgping = 0

View File

@@ -66,8 +66,6 @@
entry += "[round(seconds / 60)] minutes, " entry += "[round(seconds / 60)] minutes, "
entry += "[seconds % 60] seconds)" entry += "[seconds % 60] seconds)"
entry += "</td><td>"
entry += " ([round(C.avgping, 1)]ms)"
entry += "</td><td>" entry += "</td><td>"
entry += " (<A HREF='?_src_=holder;adminmoreinfo=\ref[C.mob]'>?</A>)" entry += " (<A HREF='?_src_=holder;adminmoreinfo=\ref[C.mob]'>?</A>)"
entry += "</td></tr>" entry += "</td></tr>"
@@ -88,7 +86,6 @@
else else
entry += " - <span class='green'>Playing</span><br>" entry += " - <span class='green'>Playing</span><br>"
entry += " ([round(C.avgping, 1)]ms)"
Lines += entry Lines += entry
msg += "<table>" msg += "<table>"

View File

@@ -1,13 +1,3 @@
/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) /client/proc/pingfromtime(time)
return ((world.time+world.tick_lag*world.tick_usage/100)-time)*100 return ((world.time+world.tick_lag*world.tick_usage/100)-time)*100

View File

@@ -49,7 +49,6 @@
entry += "[seconds % 60] seconds)" entry += "[seconds % 60] seconds)"
entry += " (<A HREF='?_src_=holder;adminmoreinfo=\ref[C.mob]'>?</A>)" entry += " (<A HREF='?_src_=holder;adminmoreinfo=\ref[C.mob]'>?</A>)"
entry += " ([round(C.avgping, 1)]ms)"
Lines += entry Lines += entry
else else
for(var/client/C in GLOB.clients) for(var/client/C in GLOB.clients)
@@ -58,7 +57,6 @@
entry = C.holder.fakekey entry = C.holder.fakekey
else else
entry = C.key entry = C.key
entry += " ([round(C.avgping, 1)]ms)"
Lines += entry Lines += entry
for(var/line in sortList(Lines)) for(var/line in sortList(Lines))

View File

@@ -613,8 +613,6 @@
if(.) if(.)
if(statpanel("Status")) if(statpanel("Status"))
if(client)
stat(null, "Ping: [round(client.lastping, 1)]ms (Average: [round(client.avgping, 1)]ms)")
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)]%)") 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)]%)")
if(ticker && ticker.current_state != GAME_STATE_PREGAME) if(ticker && ticker.current_state != GAME_STATE_PREGAME)
stat("Station Time", stationtime2text()) stat("Station Time", stationtime2text())

View File

@@ -233,7 +233,6 @@
#include "code\controllers\subsystems\orbits.dm" #include "code\controllers\subsystems\orbits.dm"
#include "code\controllers\subsystems\overlays.dm" #include "code\controllers\subsystems\overlays.dm"
#include "code\controllers\subsystems\persistence.dm" #include "code\controllers\subsystems\persistence.dm"
#include "code\controllers\subsystems\ping.dm"
#include "code\controllers\subsystems\planets.dm" #include "code\controllers\subsystems\planets.dm"
#include "code\controllers\subsystems\radiation.dm" #include "code\controllers\subsystems\radiation.dm"
#include "code\controllers\subsystems\shuttles.dm" #include "code\controllers\subsystems\shuttles.dm"