From 314e0bb53308f65d3637883573e99a6e47a4f2f6 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Mon, 15 Dec 2014 22:24:40 -0500 Subject: [PATCH] Store player_ids in the games table. --- xonstat/views/submission.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 0690182..da7e3bc 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -871,6 +871,8 @@ def submit_stats(request): duration = duration, mod = game_meta.get('O', None)) + # keep track of the players we've seen + player_ids = [] for events in raw_players: player = get_or_create_player( session = session, @@ -883,11 +885,15 @@ def submit_stats(request): if player.player_id > 1: anticheats = create_anticheats(session, pgstat, game, player, events) + player_ids.append(player.player_id) if should_do_weapon_stats(game_type_cd) and player.player_id > 1: pwstats = create_weapon_stats(session, game_meta, game, player, pgstat, events) + # store them on games for easy access + game.players = player_ids + for events in raw_teams: try: teamstat = create_team_stat(session, game, events) -- 2.39.2