]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Cleanup init
authorSamual Lenks <samual@xonotic.org>
Sun, 1 Dec 2013 03:38:51 +0000 (22:38 -0500)
committerSamual Lenks <samual@xonotic.org>
Sun, 1 Dec 2013 03:38:51 +0000 (22:38 -0500)
qcsrc/common/playerstats.qc
qcsrc/common/playerstats.qh

index daf31b0d1de57f65c6c091147198637dfc0ae545..e605b858d06ec20477d51d0d15b07434e4d6aeda 100644 (file)
@@ -234,50 +234,51 @@ void PlayerStats_GameReport_EndMatch(float finished)
 
 void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that scores are added properly
 {
-       string uri;
+       if(autocvar_g_playerstats_gamereport_uri == "") { return; }
+
        PS_GR_OUT_DB = -1;
-       PlayerStats_GameReport_DelayMapVote = FALSE;
-       uri = autocvar_g_playerstats_uri;
-       if(uri == "")
-               return;
        PS_GR_OUT_DB = db_create();
-       if(PS_GR_OUT_DB >= 0)
-               PlayerStats_GameReport_DelayMapVote = TRUE; // must wait for it at match end
-
-       serverflags |= SERVERFLAG_PLAYERSTATS;
 
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ALIVETIME);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_AVGLATENCY);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_WINS);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_MATCHES);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_JOINS);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_SCOREBOARD_VALID);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_SCOREBOARD_POS);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_RANK);
+       if(PS_GR_OUT_DB >= 0)
+       {
+               PlayerStats_GameReport_DelayMapVote = TRUE;
 
-    // accuracy stats
-    entity w;
-    float i;
-    for(i = WEP_FIRST; i <= WEP_LAST; ++i)
-    {
-        w = get_weaponinfo(i);
-        PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-hit"));
-        PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-fired"));
-        PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-cnt-hit"));
-        PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-cnt-fired"));
-        PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-frags"));
-    }
+               serverflags |= SERVERFLAG_PLAYERSTATS;
+
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ALIVETIME);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_AVGLATENCY);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_WINS);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_MATCHES);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_JOINS);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_SCOREBOARD_VALID);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_SCOREBOARD_POS);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_RANK);
+
+               // accuracy stats
+               entity w;
+               float i;
+               for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+               {
+                       w = get_weaponinfo(i);
+                       PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-hit"));
+                       PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-fired"));
+                       PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-cnt-hit"));
+                       PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-cnt-fired"));
+                       PlayerStats_GameReport_AddEvent(strcat("acc-", w.netname, "-frags"));
+               }
 
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_BOTLIKE);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD);
-       PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_3);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_5);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_10);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_15);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_20);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_25);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_KILL_SPREE_30);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_BOTLIKE);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD);
+               PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM);
+       }
+       else { PlayerStats_GameReport_DelayMapVote = FALSE; }
 }
 
 void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
index 5c8c81f914240e65e167cb517a5df70167b0687d..ba81ab754efd05c0cff303bd3dc1a2983d64df45 100644 (file)
@@ -59,7 +59,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status);
 
 .string playerstats_id;
 
-string autocvar_g_playerstats_uri;
+//string autocvar_g_playerstats_uri;
 string autocvar_g_playerstats_gamereport_ladder;
 string autocvar_g_playerstats_gamereport_uri;