From c8b0a25e1856a2e9134eb7bb889020c965bcbd9f Mon Sep 17 00:00:00 2001 From: MrStonedOne Date: Mon, 9 Jan 2017 09:01:54 -0800 Subject: [PATCH] Delays ping tracking upon client connection. --- code/controllers/subsystem/ping.dm | 8 ++++++-- code/modules/client/client_defines.dm | 3 +++ code/modules/client/client_procs.dm | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/code/controllers/subsystem/ping.dm b/code/controllers/subsystem/ping.dm index 80194d5dfc4..fbe2a7ad7d2 100644 --- a/code/controllers/subsystem/ping.dm +++ b/code/controllers/subsystem/ping.dm @@ -1,3 +1,5 @@ +#define PING_BUFFER_TIME 25 + var/datum/subsystem/ping/SSping /datum/subsystem/ping @@ -18,7 +20,7 @@ var/datum/subsystem/ping/SSping while (length(currentrun)) var/client/C = currentrun[currentrun.len] currentrun.len-- - if (!C) + if (!C || world.time - C.connection_time < PING_BUFFER_TIME) if (MC_TICK_CHECK) return continue @@ -26,4 +28,6 @@ var/datum/subsystem/ping/SSping 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 \ No newline at end of file + currentrun = null + +#undef PING_BUFFER_TIME \ No newline at end of file diff --git a/code/modules/client/client_defines.dm b/code/modules/client/client_defines.dm index a058b375090..7c18b69d356 100644 --- a/code/modules/client/client_defines.dm +++ b/code/modules/client/client_defines.dm @@ -57,3 +57,6 @@ var/lastping = 0 var/avgping = 0 + var/connection_time //world.time they connected + var/connection_realtime //world.realtime they connected + var/connection_timeofday //world.timeofday they connected \ No newline at end of file diff --git a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm index 7ce149b4fdf..f23c2c0c063 100644 --- a/code/modules/client/client_procs.dm +++ b/code/modules/client/client_procs.dm @@ -155,6 +155,10 @@ var/next_external_rsc = 0 . = ..() //calls mob.Login() + connection_time = world.time + connection_realtime = world.realtime + connection_timeofday = world.timeofday + if (byond_version < config.client_error_version) //Out of date client. src << "Your version of byond is too old:" src << config.client_error_message