]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/playerstats.qc
Merge branch 'master' into Mario/stats_eloranking
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qc
index cde6a519028093268ef95fc568e91184a40d3368..cf272e5635a1eb66e72ec90810b864b10eff9f27 100644 (file)
@@ -55,7 +55,7 @@ void PlayerStats_GameReport_AddPlayer(entity e)
        }
 }
 
-void PlayerStats_GameReport_AddTeam(float t)
+void PlayerStats_GameReport_AddTeam(int t)
 {
        if(PS_GR_OUT_DB < 0) { return; }
 
@@ -152,12 +152,14 @@ void PlayerStats_GameReport_FinalizePlayer(entity p)
                        if(latency)
                                PlayerStats_GameReport_Event_Player(p, PLAYERSTATS_AVGLATENCY, latency);
                }
+
+               db_put(PS_GR_OUT_DB, sprintf("%s:_ranked", p.playerstats_id), ftos(CS(p).cvar_cl_allow_uidranking));
        }
 
        strfree(p.playerstats_id);
 }
 
-void PlayerStats_GameReport(float finished)
+void PlayerStats_GameReport(bool finished)
 {
        if(PS_GR_OUT_DB < 0) { return; }
 
@@ -258,6 +260,7 @@ void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that
 }
 
 // this... is a hack, a temporary one until we get a proper duel gametype
+// TODO: remove duel hack after servers have migrated to the proper duel gametype!
 string PlayerStats_GetGametype()
 {
        if(IS_GAMETYPE(DEATHMATCH) && autocvar_g_maxplayers == 2)
@@ -375,6 +378,10 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                                        url_fputs(fh, sprintf("t %s\n", tt));
                                }
 
+                               // elo ranking enabled
+                               nn = db_get(PS_GR_OUT_DB, sprintf("%s:_ranked", p));
+                               if(nn != "") { url_fputs(fh, sprintf("r %s\n", nn)); }
+
                                // output player events
                                for(e = PS_GR_OUT_EVL; (en = db_get(PS_GR_OUT_DB, sprintf("*:%s", e))) != ""; e = en)
                                {