X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fplayerstats.qc;h=60af8294f090d8d882aadbd8513d517f76f9883c;hb=e4715af2d04656465b64492ddf1c02ac1503ac43;hp=813f966be05a568155fe40e9af9ff1373089dcf3;hpb=a6a3b0cebd6928e3678ee4e97de4093f1b61c58b;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index 813f966be..60af8294f 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -191,7 +191,7 @@ void PlayerStats_GameReport(float finished) if(autocvar_g_playerstats_gamereport_uri != "") { - PlayerStats_GameReport_DelayMapVote = TRUE; + PlayerStats_GameReport_DelayMapVote = true; url_multi_fopen( autocvar_g_playerstats_gamereport_uri, FILE_APPEND, @@ -201,7 +201,7 @@ void PlayerStats_GameReport(float finished) } else { - PlayerStats_GameReport_DelayMapVote = FALSE; + PlayerStats_GameReport_DelayMapVote = false; db_close(PS_GR_OUT_DB); PS_GR_OUT_DB = -1; } @@ -211,12 +211,11 @@ 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) { - PlayerStats_GameReport_DelayMapVote = TRUE; + PlayerStats_GameReport_DelayMapVote = true; serverflags |= SERVERFLAG_PLAYERSTATS; @@ -253,7 +252,7 @@ void PlayerStats_GameReport_Init() // initiated before InitGameplayMode so that PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTBLOOD); PlayerStats_GameReport_AddEvent(PLAYERSTATS_ACHIEVEMENT_FIRSTVICTIM); } - else { PlayerStats_GameReport_DelayMapVote = FALSE; } + else { PlayerStats_GameReport_DelayMapVote = false; } } void PlayerStats_GameReport_Handler(entity fh, entity pass, float status) @@ -393,7 +392,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status) { // url_fclose has finished dprint("Player stats written\n"); - PlayerStats_GameReport_DelayMapVote = FALSE; + PlayerStats_GameReport_DelayMapVote = false; if(PS_GR_OUT_DB >= 0) { db_close(PS_GR_OUT_DB); @@ -406,7 +405,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status) default: { print("Player stats writing failed: ", ftos(status), "\n"); - PlayerStats_GameReport_DelayMapVote = FALSE; + PlayerStats_GameReport_DelayMapVote = false; if(PS_GR_OUT_DB >= 0) { db_close(PS_GR_OUT_DB); @@ -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(); }