]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into Mario/race_cts_mutators
authorMario <mario.mario@y7mail.com>
Wed, 4 Jun 2014 23:00:11 +0000 (09:00 +1000)
committerMario <mario.mario@y7mail.com>
Wed, 4 Jun 2014 23:00:11 +0000 (09:00 +1000)
1  2 
qcsrc/server/anticheat.qc
qcsrc/server/bot/havocbot/roles.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_physics.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/getreplies.qc
qcsrc/server/g_damage.qc
qcsrc/server/sv_main.qc
qcsrc/server/teamplay.qc

index 11c758ef43f043bf2498fc21ebd6098fe0ac2910,9a1872c89fadfb68d651babe38a85097dd1b9091..fd78214c86840f0f1e6e865eefb73cb50bba7c30
@@@ -92,6 -141,71 +140,25 @@@ void anticheat_physics(
                MEAN_ACCUMULATE(anticheat_speedhack, max(0, f - self.anticheat_speedhack_offset), 1);
                self.anticheat_speedhack_offset += (f - self.anticheat_speedhack_offset) * frametime * 0.1;
        }
 -
 -      // race/CTS: force kbd movement for fairness
 -      if(g_race || g_cts)
 -      {
 -              // if record times matter
 -              // ensure nothing EVIL is being done (i.e. div0_evade)
 -              // this hinders joystick users though
 -              // but it still gives SOME analog control
 -              wishvel_x = fabs(self.movement_x);
 -              wishvel_y = fabs(self.movement_y);
 -              if(wishvel_x != 0 && wishvel_y != 0 && wishvel_x != wishvel_y)
 -              {
 -                      wishvel_z = 0;
 -                      wishspeed = vlen(wishvel);
 -                      if(wishvel_x >= 2 * wishvel_y)
 -                      {
 -                              // pure X motion
 -                              if(self.movement_x > 0)
 -                                      self.movement_x = wishspeed;
 -                              else
 -                                      self.movement_x = -wishspeed;
 -                              self.movement_y = 0;
 -                      }
 -                      else if(wishvel_y >= 2 * wishvel_x)
 -                      {
 -                              // pure Y motion
 -                              self.movement_x = 0;
 -                              if(self.movement_y > 0)
 -                                      self.movement_y = wishspeed;
 -                              else
 -                                      self.movement_y = -wishspeed;
 -                      }
 -                      else
 -                      {
 -                              // diagonal
 -                              if(self.movement_x > 0)
 -                                      self.movement_x = M_SQRT1_2 * wishspeed;
 -                              else
 -                                      self.movement_x = -M_SQRT1_2 * wishspeed;
 -                              if(self.movement_y > 0)
 -                                      self.movement_y = M_SQRT1_2 * wishspeed;
 -                              else
 -                                      self.movement_y = -M_SQRT1_2 * wishspeed;
 -                      }
 -              }
 -      }
+       // new generic speedhack detection
+       if (self.anticheat_speedhack_lasttime > 0) {
+               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 = 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);
+               MEAN_ACCUMULATE(anticheat_speedhack_m4, self.anticheat_speedhack_accu, frametime);
+               MEAN_ACCUMULATE(anticheat_speedhack_m5, self.anticheat_speedhack_accu, frametime);
+       } else {
+               self.anticheat_speedhack_accu = 1;
+               self.anticheat_speedhack_lasttime = servertime;
+       }
  }
  
  void anticheat_spectatecopy(entity spectatee)
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 23f4c1963198f5d54ec67dab4286ed79c6420849,a0c80dbd2132b144f2ce0929249aca17d12050d5..87ea68d7982ca4714084e0ae8b5a0ea6a5b8dcf6
@@@ -243,16 -246,14 +248,10 @@@ void InitGameplayMode(
                else
                        g_race_qualifying = 0;
        }
-       
-       if(g_invasion)
-       {
-               inv_maxrounds = cvar("fraglimit");
-               cvar_set("fraglimit", "0");
-       }
  
        if(g_race || g_cts)
 -      {
 -              if(g_race_qualifying)
 -                      independent_players = 1;
 -
 -              ScoreRules_race();
 -      }
 +      if(g_race_qualifying)
 +              independent_players = 1;
  
        InitializeEntity(world, default_delayedinit, INITPRIO_GAMETYPE_FALLBACK);
  }