]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix bad initialization of playerstats db handlers (caused error spam in the console...
authorterencehill <piuntn@gmail.com>
Sat, 27 Dec 2014 15:52:15 +0000 (16:52 +0100)
committerterencehill <piuntn@gmail.com>
Sat, 27 Dec 2014 15:52:15 +0000 (16:52 +0100)
qcsrc/common/playerstats.qc
qcsrc/common/playerstats.qh

index 813f966be05a568155fe40e9af9ff1373089dcf3..2c4a355e0a8c00a58a7c14649dde91a32b744fd4 100644 (file)
@@ -211,7 +211,6 @@ void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that
 {
        if(autocvar_g_playerstats_gamereport_uri == "") { return; }
 
-       PS_GR_OUT_DB = -1;
        PS_GR_OUT_DB = db_create();
 
        if(PS_GR_OUT_DB >= 0)
@@ -427,10 +426,7 @@ void PlayerStats_PlayerBasic(entity joiningplayer, float newrequest)
                {
                        // create the database if it doesn't already exist
                        if(PS_B_IN_DB < 0)
-                       {
-                               PS_B_IN_DB = -1;
                                PS_B_IN_DB = db_create();
-                       }
 
                        // now request the information
                        uri = strcat(uri, "/player/", uri_escape(uri_escape(joiningplayer.crypto_idfp)), "/elo.txt");
@@ -635,10 +631,7 @@ void PlayerStats_PlayerDetail(void)
        {
                // create the database if it doesn't already exist
                if(PS_D_IN_DB < 0)
-               {
-                       PS_D_IN_DB = -1;
                        PS_D_IN_DB = db_create();
-               }
 
                //uri = strcat(uri, "/player/", uri_escape(crypto_getmyidfp(0)));
                dprint("Retrieving playerstats from URL: ", autocvar_g_playerstats_playerdetail_uri, "\n");
@@ -987,7 +980,6 @@ void PlayerInfo_ready(entity fh, entity p, float status)
 
 void PlayerInfo_Init()
 {
-       playerinfo_db = -1;
        playerinfo_db = db_create();
 }
 
index 26a1efc28cfa68a4074dc08c58fa3ce0e7d10226..ab4bc166f0b29f05134bf953f16a4ae75deb0c69 100644 (file)
@@ -1,18 +1,18 @@
 #ifdef SVQC
-//float PS_PM_IN_DB;   // playerstats_prematch_in_db      // db for info COLLECTED at the beginning of a match
-float PS_GR_OUT_DB;  // playerstats_gamereport_out_db   // db of info SENT at the end of a match
-//float PS_GR_IN_DB;   // playerstats_gamereport_in_db    // db for info COLLECTED at the end of a match
-float PS_B_IN_DB;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
+//float PS_PM_IN_DB = -1;   // playerstats_prematch_in_db      // db for info COLLECTED at the beginning of a match
+float PS_GR_OUT_DB = -1;  // playerstats_gamereport_out_db   // db of info SENT at the end of a match
+//float PS_GR_IN_DB = -1;   // playerstats_gamereport_in_db    // db for info COLLECTED at the end of a match
+float PS_B_IN_DB = -1;    // playerstats_playerbasic_in_db   // db for info COLLECTED for basic player info (ELO)
 #endif
 
 #ifdef MENUQC
-float PS_D_IN_DB; // playerstats_playerdetail_in_db  // db for info COLLECTED for detailed player profile display
+float PS_D_IN_DB = -1; // playerstats_playerdetail_in_db  // db for info COLLECTED for detailed player profile display
 #endif
 
 #ifdef SVQC
 //string PS_PM_IN_EVL;   // playerstats_prematch_in_events_last
 string PS_GR_OUT_TL;   // playerstats_gamereport_out_teams_last
-string PS_GR_OUT_PL;   // playerstats_gamereport_out_players_las
+string PS_GR_OUT_PL;   // playerstats_gamereport_out_players_last
 string PS_GR_OUT_EVL;  // playerstats_gamereport_out_events_last
 //string PS_GR_IN_PL;    // playerstats_gamereport_in_players_last
 //string PS_GR_IN_EVL;   // playerstats_gamereport_in_events_last