From c775b2509085ef2b0d5fa92d0548e3a190a28d42 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Wed, 4 Jun 2014 09:41:29 +0200 Subject: [PATCH] anticheat: use servertime where appropriate (but AFAIK these don't differ any more anyway) --- qcsrc/server/anticheat.qc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qcsrc/server/anticheat.qc b/qcsrc/server/anticheat.qc index e45f9a0a7..9a1872c89 100644 --- a/qcsrc/server/anticheat.qc +++ b/qcsrc/server/anticheat.qc @@ -84,7 +84,7 @@ void anticheat_physics() if(self.anticheat_div0_evade_offset == 0) { f = fabs(anticheat_div0_evade_evasion_delta - floor(anticheat_div0_evade_evasion_delta) - 0.5) * 2; // triangle function - self.anticheat_div0_evade_offset = time + sys_frametime * (3 * f - 1); + self.anticheat_div0_evade_offset = servertime + sys_frametime * (3 * f - 1); self.anticheat_div0_evade_v_angle = self.v_angle; self.anticheat_div0_evade_forward_initial = v_forward; MEAN_ACCUMULATE(anticheat_div0_evade, 0, 1); @@ -144,13 +144,13 @@ void anticheat_physics() // new generic speedhack detection if (self.anticheat_speedhack_lasttime > 0) { - float dt = time - self.anticheat_speedhack_lasttime; + float dt = servertime - self.anticheat_speedhack_lasttime; const float falloff = 0.2; self.anticheat_speedhack_accu *= exp(-dt * falloff); self.anticheat_speedhack_accu += frametime * falloff; // NOTE: at cl_netfps x, this actually averages not to 1, but to 1/x * falloff / (1 - exp(-1/x * falloff)) // For 15 netfps (absolute minimum bearable), and 0.2 falloff, this is: 1.0067 - self.anticheat_speedhack_lasttime = time; + self.anticheat_speedhack_lasttime = servertime; MEAN_ACCUMULATE(anticheat_speedhack_m1, self.anticheat_speedhack_accu, frametime); MEAN_ACCUMULATE(anticheat_speedhack_m2, self.anticheat_speedhack_accu, frametime); MEAN_ACCUMULATE(anticheat_speedhack_m3, self.anticheat_speedhack_accu, frametime); @@ -158,7 +158,7 @@ void anticheat_physics() MEAN_ACCUMULATE(anticheat_speedhack_m5, self.anticheat_speedhack_accu, frametime); } else { self.anticheat_speedhack_accu = 1; - self.anticheat_speedhack_lasttime = time; + self.anticheat_speedhack_lasttime = servertime; } // race/CTS: force kbd movement for fairness -- 2.39.2