]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Send total number of rounds played to xonstats
authorterencehill <piuntn@gmail.com>
Mon, 11 Dec 2023 22:27:10 +0000 (23:27 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 12 Dec 2023 17:19:31 +0000 (18:19 +0100)
qcsrc/common/playerstats.qc

index 17c76461fd3516a72b5355a39f906846cfe9f205..1ac99701f515ce3f26f386b054c33a0755927755 100644 (file)
@@ -369,6 +369,7 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                 * C: number of "unpure" cvar changes
                 * U: UDP port number of the server
                 * D: duration of the match
+                * RP: number of rounds played
                 * L: "ladder" in which the server is participating in
                 * P: player ID of an existing player; this also sets the owner for all following "n", "e" and "t" lines (lower case!)
                 * Q: team number of an existing team (format: team#NN); this also sets the owner for all following "e" lines (lower case!)
@@ -409,7 +410,10 @@ void PlayerStats_GameReport_Handler(entity fh, entity pass, float status)
                        url_fputs(fh, sprintf("C %d\n", cvar_purechanges_count));
                        url_fputs(fh, sprintf("U %d\n", cvar("port")));
                        url_fputs(fh, sprintf("D %f\n", max(0, time - game_starttime)));
-                       url_fputs(fh, sprintf("L %s\n", autocvar_g_playerstats_gamereport_ladder));
+                       if (rounds_played > 0)
+                               url_fputs(fh, sprintf("RP %d\n", rounds_played));
+                       if (autocvar_g_playerstats_gamereport_ladder != "")
+                               url_fputs(fh, sprintf("L %s\n", autocvar_g_playerstats_gamereport_ladder));
 
                        // TEAMS
                        if(teamplay)