From: Ant Zucaro Date: Wed, 16 Jan 2013 02:37:44 +0000 (-0500) Subject: Support the new scoreboardpos and teamrank fields. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8fd8247e29b9e900ebaf2820e71072c9a9c63a8d;p=xonotic%2Fxonstat.git Support the new scoreboardpos and teamrank fields. Two new player events being sent to sort games every which way :D. --- diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 364babb..5f30aae 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -435,7 +435,11 @@ def create_player_game_stat(session=None, player=None, pgstat.nick = value[:128] pgstat.stripped_nick = strip_colors(qfont_decode(pgstat.nick)) if key == 't': pgstat.team = int(value) - if key == 'rank': pgstat.rank = int(value) + if key == 'rank': + pgstat.rank = int(value) + # to support older servers who don't send scoreboardpos values + if pgstat.scoreboardpos is None: + pgstat.scoreboardpos = pgstat.rank if key == 'alivetime': pgstat.alivetime = datetime.timedelta(seconds=int(round(float(value)))) if key == 'scoreboard-drops': pgstat.drops = int(value) @@ -450,6 +454,8 @@ def create_player_game_stat(session=None, player=None, if key == 'scoreboard-captime': pgstat.fastest_cap = datetime.timedelta(seconds=float(value)/100) if key == 'avglatency': pgstat.avg_latency = float(value) + if key == 'teamrank': pgstat.teamrank = int(value) + if key == 'scoreboardpos': pgstat.scoreboardpos = int(value) # check to see if we had a name, and if # not use an anonymous handle