]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Store player_ids in the games table.
authorAnt Zucaro <azucaro@gmail.com>
Tue, 16 Dec 2014 03:24:40 +0000 (22:24 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Tue, 16 Dec 2014 03:24:40 +0000 (22:24 -0500)
xonstat/views/submission.py

index 069018261b91f6fee7c9dc152b86f0d822b74443..da7e3bc13865cd0a48f7c599204c20034ef4954e 100644 (file)
@@ -871,6 +871,8 @@ def submit_stats(request):
                 duration     = duration,\r
                 mod          = game_meta.get('O', None))\r
 \r
+        # keep track of the players we've seen\r
+        player_ids = []\r
         for events in raw_players:\r
             player = get_or_create_player(\r
                 session = session,\r
@@ -883,11 +885,15 @@ def submit_stats(request):
             if player.player_id > 1:\r
                 anticheats = create_anticheats(session, pgstat, game, player,\r
                     events)\r
+                player_ids.append(player.player_id)\r
 \r
             if should_do_weapon_stats(game_type_cd) and player.player_id > 1:\r
                 pwstats = create_weapon_stats(session, game_meta, game, player,\r
                         pgstat, events)\r
 \r
+        # store them on games for easy access\r
+        game.players = player_ids\r
+\r
         for events in raw_teams:\r
             try:\r
                 teamstat = create_team_stat(session, game, events)\r