some very WIP race code, won't compile yet, but already contains most stuff from...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / cl_physics.qc
index b005dd5f3f20c575914e76107a7891ffd4198d07..376e54f24eac3a1ce9682e23b2c5e60c767db204 100644 (file)
@@ -673,6 +673,7 @@ void SpecialCommand()
 
 float speedaward_speed;
 string speedaward_holder;
+string speedaward_uid;
 void race_send_speedaward(float msg)
 {
        // send the best speed of the round
@@ -685,6 +686,7 @@ void race_send_speedaward(float msg)
 
 float speedaward_alltimebest;
 string speedaward_alltimebest_holder;
+string speedaward_alltimebest_uid;
 void race_send_speedaward_alltimebest(float msg)
 {
        // send the best speed
@@ -1306,6 +1308,9 @@ void SV_PlayerPhysics()
                if(vlen(self.velocity - self.velocity_z * '0 0 1') > speedaward_speed) {
                        speedaward_speed = vlen(self.velocity - self.velocity_z * '0 0 1');
                        speedaward_holder = self.netname;
+                       if(speedaward_uid)
+                               strunzone(speedaward_uid);
+                       speedaward_uid = strzone(self.crypto_idfp);
                        speedaward_lastupdate = time;
                }
                if(speedaward_speed > speedaward_lastsent && time - speedaward_lastupdate > 1) {
@@ -1321,6 +1326,7 @@ void SV_PlayerPhysics()
                                speedaward_alltimebest_holder = speedaward_holder;
                                db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/speed"), ftos(speedaward_alltimebest));
                                db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/netname"), speedaward_alltimebest_holder);
+                               db_put(ServerProgsDB, strcat(GetMapname(), rr, "speed/crypto_idfp"), speedaward_alltimebest_holder);
                                race_send_speedaward_alltimebest(MSG_ALL);
                        }
                }