]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
add also a teamrank field (non strict order of teams)
authorRudolf Polzer <divverent@xonotic.org>
Tue, 15 Jan 2013 14:38:18 +0000 (15:38 +0100)
committerRudolf Polzer <divverent@xonotic.org>
Tue, 15 Jan 2013 14:38:18 +0000 (15:38 +0100)
qcsrc/server/playerstats.qc
qcsrc/server/playerstats.qh

index 44f7bb5ed1f627cb931c32a2595c490f9a8b3c3a..17fc979d8c402307b777212b435fb1b094e3816a 100644 (file)
@@ -193,7 +193,7 @@ void PlayerStats_TeamScore(float t, string event_id, float value) // TODO: doesn
        i: player index
        e: followed by an event name, a space, and the event count/score
                event names can be:
-                       alivetime: total playing time of the player
+                       alivetime: total playing time of the uplayer
                        avglatency: average network latency compounded throughout the match
                        wins: number of games won (can only be set if matches is set)
                        matches: number of matches played to the end (not aborted by map switch)
@@ -367,10 +367,14 @@ void PlayerStats_AddGlobalInfo(entity p)
 }
 
 .float scoreboard_pos;
+.float playerrank;
+.float teamrank;
 void PlayerStats_EndMatch(float finished)
 {
        entity p;
-       PlayerScore_Sort(score_dummyfield, 0, 0);
+       PlayerScore_Sort(playerrank, 0, 0);
+       if(teamplay)
+               PlayerScore_Sort(teamrank, -1, 0);
        PlayerScore_Sort(scoreboard_pos, 1, 1);
        FOR_EACH_CLIENT(p) // spectators intentionally not included
        {
@@ -394,7 +398,9 @@ void PlayerStats_EndMatch(float finished)
                {
                        PlayerStats_Event(p, PLAYERSTATS_WINS, p.winning);
                        PlayerStats_Event(p, PLAYERSTATS_MATCHES, 1);
-                       PlayerStats_Event(p, PLAYERSTATS_RANK, p.score_dummyfield);
+                       PlayerStats_Event(p, PLAYERSTATS_RANK, p.playerrank);
+                       if(teamplay)
+                               PlayerStats_Event(p, PLAYERSTATS_TEAMRANK, p.teamrank);
                        PlayerStats_Event(p, PLAYERSTATS_SCOREBOARD_POS, p.scoreboard_pos);
                }
        }
index f3806d50df917fe39a165663fd62fa3f0937578c..6b4462cb78844c3c1a38526c3473375db7e30444 100644 (file)
@@ -6,6 +6,7 @@ string PLAYERSTATS_MATCHES = "matches";
 string PLAYERSTATS_JOINS = "joins";
 string PLAYERSTATS_SCOREBOARD_VALID = "scoreboardvalid";
 string PLAYERSTATS_RANK = "rank";
+string PLAYERSTATS_TEAMRANK = "teamrank";
 string PLAYERSTATS_SCOREBOARD_POS = "scoreboardpos";
 
 string PLAYERSTATS_TOTAL = "total-";