]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/playerstats.qc
Merge branch 'terencehill/noclip_death_fix' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qc
index 2c9bbcde805eb9770015c385877971563b872731..511ac46e66eedc7a8b35ce447b328b56f1a89ff7 100644 (file)
@@ -152,6 +152,8 @@ 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);
@@ -376,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)
                                {
@@ -484,6 +490,21 @@ void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
        }
 }
 
+SHUTDOWN(PlayerStats_PlayerBasic_Shutdown)
+{
+       if(PS_B_IN_DB >= 0)
+       {
+               db_close(PS_B_IN_DB);
+               PS_B_IN_DB = -1;
+       }
+
+       if(PS_GR_OUT_DB >= 0)
+       {
+               db_close(PS_GR_OUT_DB);
+               PS_GR_OUT_DB = -1;
+       }
+}
+
 void PlayerStats_PlayerBasic_CheckUpdate(entity joiningplayer)
 {
        // determine whether we should retrieve playerbasic information again