]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/miscfunctions.qc
merge some changes from my autocvarizer branch that change nothing but make code...
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / miscfunctions.qc
index 5b8ec7127fd861a81b3dde4d32fa8e25ac5390c4..a5b33acf7d4f526b0a765dbc7ef2f1f02ee44a33 100644 (file)
@@ -468,28 +468,6 @@ string formatmessage(string msg)
                        replacement = ftos(vlen(self.velocity - self.velocity_z * '0 0 1'));
                else if (escape == "S")
                        replacement = ftos(vlen(self.velocity));
-               else if (escape == "v") {
-                       float weapon_number;
-                       local entity stats;
-
-                       if(self.classname == "spectator")
-                               stats = self.enemy;
-                       else
-                               stats = self;
-
-                       weapon_number = stats.weapon;
-
-                       if (!weapon_number)
-                               weapon_number = stats.switchweapon;
-
-                       if (!weapon_number)
-                               weapon_number = stats.cnt;
-
-                       if(stats.cvar_cl_accuracy_data_share && stats.stats_fired[weapon_number - 1])
-                               replacement = ftos(bound(0, floor(100 * stats.stats_hit[weapon_number - 1] / stats.stats_fired[weapon_number - 1]), 100));
-                       else
-                               replacement = "~"; // or something to indicate NULL, not available
-               }
 
                msg = strcat(substring(msg, 0, p), replacement, substring(msg, p+2, strlen(msg) - (p+2)));
                p = p + strlen(replacement);
@@ -816,6 +794,8 @@ vector randompos(vector m1, vector m2)
     return  v;
 };
 
+//#NO AUTOCVARS START
+
 float g_pickup_shells;
 float g_pickup_shells_max;
 float g_pickup_nails;
@@ -1335,25 +1315,7 @@ void readlevelcvars(void)
        readplayerstartcvars();
 }
 
-/*
-// TODO sound pack system
-string soundpack;
-
-string precache_sound_builtin (string s) = #19;
-void(entity e, float chan, string samp, float vol, float atten) sound_builtin = #8;
-string precache_sound(string s)
-{
-       return precache_sound_builtin(strcat(soundpack, s));
-}
-void play2(entity e, string filename)
-{
-       stuffcmd(e, strcat("play2 ", soundpack, filename, "\n"));
-}
-void sound(entity e, float chan, string samp, float vol, float atten)
-{
-       sound_builtin(e, chan, strcat(soundpack, samp), vol, atten);
-}
-*/
+//#NO AUTOCVARS END
 
 // Sound functions
 string precache_sound (string s) = #19;
@@ -2049,11 +2011,12 @@ float WarpZone_Projectile_Touch_ImpactFilter_Callback()
 }
 #define PROJECTILE_TOUCH if(WarpZone_Projectile_Touch()) return
 
-float MAX_IPBAN_URIS = 16;
-
-float URI_GET_DISCARD   = 0;
-float URI_GET_IPBAN     = 1;
-float URI_GET_IPBAN_END = 16;
+float MAX_IPBAN_URIS           = 16;
+                              
+float URI_GET_DISCARD          = 0;
+float URI_GET_IPBAN            = 1;
+float URI_GET_IPBAN_END        = 16;
+float URI_GET_PLAYERSTATS_SENT = 17;
 
 void URI_Get_Callback(float id, float status, string data)
 {
@@ -2070,6 +2033,10 @@ void URI_Get_Callback(float id, float status, string data)
         // online ban list
         OnlineBanList_URI_Get_Callback(id, status, data);
     }
+    else if (id == URI_GET_PLAYERSTATS_SENT)
+    {
+        PlayerStats_Sent_URI_Get_Callback(id, status, data);
+    }
     else
     {
         print("Received HTTP request data for an invalid id ", ftos(id), ".\n");