From 52f366672777143a066216c8d6973a3866ac4db2 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 16 Oct 2017 20:09:21 -0400 Subject: [PATCH] Properly account for Elo opt-outs. --- xonstat/views/submission.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index a830a3f..8b42dbc 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -612,7 +612,7 @@ def create_game(session, game_type_cd, server_id, map_id, match_id, start_dt, du game.mod = mod[:64] # There is some drift between start_dt (provided by app) and create_dt - # (default in the database), so we'll make them the same until this is + # (default in the database), so we'll make them the same until this is # resolved. game.create_dt = start_dt @@ -1148,7 +1148,10 @@ def submit_stats(request): frag_matrix = create_frag_matrix(session, submission.player_indexes, pgstat, events) # player ranking opt-out - if 'r' in events and events['r'] != '0': + if 'r' in events and events['r'] == '0': + log.debug("Excluding player {} from ranking calculations (opt-out)" + .format(pgstat.player_id)) + else: elo_pgstats.append(pgstat) if player.player_id > 1: -- 2.39.2