]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Support the new scoreboardpos and teamrank fields.
authorAnt Zucaro <azucaro@gmail.com>
Wed, 16 Jan 2013 02:37:44 +0000 (21:37 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Wed, 16 Jan 2013 02:37:44 +0000 (21:37 -0500)
Two new player events being sent to sort games every which way :D.

xonstat/views/submission.py

index 364babb67ff3419fcb34f704f78a1fc8687a5142..5f30aaead783943502bf266d8dbe74a5501f2847 100644 (file)
@@ -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