summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschneefux <schneefux+commit@schneefux.xyz>2017-06-20 14:00:20 +0200
committerschneefux <schneefux+commit@schneefux.xyz>2017-06-20 14:00:20 +0200
commit02d2cfbd0df62cf8d9fc2bb54d1046a9e6c45378 (patch)
tree9ea35d3537c324e3bf465a68d87f8facd6c51611
parent3741d6380ce0bf4916b0f801e91970ed774e6d93 (diff)
downloadanalyzer-02d2cfbd0df62cf8d9fc2bb54d1046a9e6c45378.tar.gz
analyzer-02d2cfbd0df62cf8d9fc2bb54d1046a9e6c45378.zip
do not write to participant on rejected matches
-rw-r--r--worker.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/worker.py b/worker.py
index 1fd18f7..47e7d95 100644
--- a/worker.py
+++ b/worker.py
@@ -153,11 +153,22 @@ def process():
matchup = []
anyAfk = False
for roster in match.rosters:
- team = []
for participant in roster.participants:
if participant.went_afk == 1:
anyAfk = True
break
+ if len(match.rosters) < 2:
+ logging.error("got an invalid matchup %s", match.api_id)
+ match.trueskill_quality = 0
+ continue
+ if anyAfk:
+ logging.error("got an afk matchup %s", match.api_id)
+ match.trueskill_quality = 0
+ continue
+
+ for roster in match.rosters:
+ team = []
+ for participant in roster.participants:
player = participant.player[0]
mu = participant.trueskill_mu or player.trueskill_mu
sigma = participant.trueskill_sigma or player.trueskill_sigma or 500
@@ -173,10 +184,6 @@ def process():
team.append(env.create_rating(float(mu), float(sigma)))
matchup.append(team)
- if len(matchup) != 2 or anyAfk == True:
- logging.error("got an invalid matchup %s", match.api_id)
- match.trueskill_quality = 0
- continue
logging.info("got a valid matchup %s", match.api_id)
# store the fairness of the match