From: Rudolf Polzer Date: Tue, 15 Jan 2013 14:38:18 +0000 (+0100) Subject: add also a teamrank field (non strict order of teams) X-Git-Tag: xonotic-v0.7.0~108^2~11 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=41a232f236f88bd1c409d00bc3228df2899b93b0;p=xonotic%2Fxonotic-data.pk3dir.git add also a teamrank field (non strict order of teams) --- diff --git a/qcsrc/server/playerstats.qc b/qcsrc/server/playerstats.qc index 44f7bb5ed..17fc979d8 100644 --- a/qcsrc/server/playerstats.qc +++ b/qcsrc/server/playerstats.qc @@ -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); } } diff --git a/qcsrc/server/playerstats.qh b/qcsrc/server/playerstats.qh index f3806d50d..6b4462cb7 100644 --- a/qcsrc/server/playerstats.qh +++ b/qcsrc/server/playerstats.qh @@ -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-";