]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/playerstats.qc
Merge branch 'terencehill/menu_quit_confirmation' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qc
index 3d0ca1ee6d6154f731f4eff2884522d7b5091552..6ffc506170a077d91b309fe7dd86a3afb1d7ba09 100644 (file)
        #include <server/world.qh>
 #endif
 
+
+#ifdef GAMEQC
+REPLICATE(cvar_cl_allow_uid2name, int, "cl_allow_uid2name");
+REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
+REPLICATE(cvar_cl_allow_uidtracking, int, "cl_allow_uidtracking");
+#endif
+
+#ifdef SVQC
+REPLICATE_APPLYCHANGE("cl_allow_uidtracking", { PlayerStats_GameReport_AddPlayer(this); });
+#endif
+
 #ifdef SVQC
 void PlayerStats_Prematch()
 {
@@ -192,7 +203,7 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
        {
                if(CS(p).latency_cnt)
                {
-                       float latency = (CS(p).latency_sum / CS(p).latency_cnt);
+                       float latency = max(0, CS(p).latency_sum / CS(p).latency_cnt);
                        if(latency)
                                PlayerStats_GameReport_Event_Player(p, PLAYERSTATS_AVGLATENCY, latency);
                }
@@ -268,6 +279,10 @@ void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that
                PlayerStats_GameReport_DelayMapVote = true;
 
                serverflags |= SERVERFLAG_PLAYERSTATS;
+               if(autocvar_g_playerstats_gamereport_uri != cvar_defstring("g_playerstats_gamereport_uri"))
+               {
+                       serverflags |= SERVERFLAG_PLAYERSTATS_CUSTOM;
+               }
 
                PlayerStats_GameReport_AddEvent(PLAYERSTATS_ALIVETIME);
                PlayerStats_GameReport_AddEvent(PLAYERSTATS_AVGLATENCY);