From: Ant Zucaro Date: Tue, 16 Dec 2014 03:24:40 +0000 (-0500) Subject: Store player_ids in the games table. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=314e0bb53308f65d3637883573e99a6e47a4f2f6;p=xonotic%2Fxonstat.git Store player_ids in the games table. --- 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)