]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/playerstats.qc
Replace `vector_[xyz]` with `vector.[xyz]` where possible
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / playerstats.qc
index 13ae3ef10e8a6a3d4d730f05e9965dceb2b1b179..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)
@@ -382,9 +381,9 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                {
                        // url_fclose is processing, we got a response for writing the data
                        // this must come from HTTP
-                       print("Got response from player stats server:\n");
-                       while((s = url_fgets(fh))) { print("  ", s, "\n"); }
-                       print("End of response.\n");
+                       dprint("Got response from player stats server:\n");
+                       while((s = url_fgets(fh))) { dprint("  ", s, "\n"); }
+                       dprint("End of response.\n");
                        url_fclose(fh);
                        break;
                }
@@ -392,7 +391,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                case URL_READY_CLOSED:
                {
                        // url_fclose has finished
-                       print("Player stats written\n");
+                       dprint("Player stats written\n");
                        PlayerStats_GameReport_DelayMapVote = FALSE;
                        if(PS_GR_OUT_DB >= 0)
                        {
@@ -427,14 +426,11 @@ 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");
-                       print("Retrieving playerstats from URL: ", uri, "\n");
+                       dprint("Retrieving playerstats from URL: ", uri, "\n");
                        url_single_fopen(
                                uri,
                                FILE_APPEND,
@@ -499,7 +495,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
        {
                case URL_READY_CANWRITE:
                {
-                       print("-- Sending data to player stats server\n");
+                       dprint("-- Sending data to player stats server\n");
                        /*url_fputs(fh, "V 1\n");
                        #ifdef WATERMARK
                        url_fputs(fh, sprintf("R %s\n", WATERMARK));
@@ -517,11 +513,11 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                case URL_READY_CANREAD:
                {
                        string s = "";
-                       print("-- Got response from player stats server:\n");
+                       dprint("-- Got response from player stats server:\n");
                        //string gametype = string_null;
                        while((s = url_fgets(fh)))
                        {
-                               print("  ", s, "\n");
+                               dprint("  ", s, "\n");
                                /*
                                string key = "", value = "", data = "";
 
@@ -572,7 +568,7 @@ void PlayerStats_PlayerBasic_Handler(entity fh, entity p, float status)
                                continue;
                                */
                        }
-                       print("-- End of response.\n");
+                       dprint("-- End of response.\n");
                        url_fclose(fh);
                        break;
                }
@@ -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();
 }