From: Ant Zucaro Date: Sat, 4 Feb 2017 16:40:26 +0000 (-0500) Subject: Add logic to identify fastest caps or laps by humans. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=aa5c210b024a693215cc76050e6c5606bf9148b0;p=xonotic%2Fxonstat.git Add logic to identify fastest caps or laps by humans. This also helps to identify blank games easier. --- diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 14847ad..20e20f9 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -109,6 +109,9 @@ class Submission(object): # does any human have a non-zero score? self.human_nonzero_score = False + # does any human have a fastest cap? + self.human_fastest = False + def next_item(self): """Returns the next key:value pair off the queue.""" try: @@ -138,6 +141,7 @@ class Submission(object): player_fired_weapon = False player_nonzero_score = False + player_fastest = False # Consume all following 'i' 'n' 't' 'e' records while len(self.q) > 0: @@ -153,6 +157,8 @@ class Submission(object): self.check_for_new_weapon_fired(sub_key) elif sub_key == 'scoreboard-score' and int(value) != 0: player_nonzero_score = True + elif sub_key == 'scoreboard-fastest': + player_fastest = True elif key == 'n': player[key] = unicode(value, 'utf-8') elif key in player_keys: @@ -174,6 +180,9 @@ class Submission(object): if player_nonzero_score: self.human_nonzero_score = True + if player_fastest: + self.human_fastest = True + elif played and not human: self.bots.append(player) else: