From c7af75cffe7cea01b8a879750e32b698cfeb665d Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 18 Nov 2017 09:17:30 -0500 Subject: [PATCH] Don't compute the frag matrix for all game types. --- xonstat/views/submission.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 8b42dbc..085ed2b 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -405,6 +405,13 @@ def should_do_weapon_stats(game_type_cd): return game_type_cd not in {'cts'} +def should_do_frag_matrix(game_type_cd): + """True if the game type should record frag matrix values. False otherwise.""" + return game_type_cd in { + 'as', 'ca', 'ctf', 'dm', 'dom', 'ft', 'freezetag', 'ka', 'kh', 'rune', 'tdm', + } + + def gametype_elo_eligible(game_type_cd): """True of the game type should process Elos. False otherwise.""" return game_type_cd in {'duel', 'dm', 'ca', 'ctf', 'tdm', 'ka', 'ft'} @@ -1145,7 +1152,8 @@ def submit_stats(request): pgstat = create_game_stat(session, game, gmap, player, events) pgstats.append(pgstat) - frag_matrix = create_frag_matrix(session, submission.player_indexes, pgstat, events) + if should_do_frag_matrix(submission.game_type_cd): + create_frag_matrix(session, submission.player_indexes, pgstat, events) # player ranking opt-out if 'r' in events and events['r'] == '0': -- 2.39.2