From: antzucaro Date: Tue, 11 Oct 2011 22:18:09 +0000 (-0400) Subject: Set the winner of the game according to which team the #1 ranked player belongs. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=8c160ea345e3f613214ad1e5f55abb91c7f09d6b;p=xonotic%2Fxonstat.git Set the winner of the game according to which team the #1 ranked player belongs. --- diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 185907c..d8b0a1b 100755 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -235,6 +235,14 @@ def create_player_game_stat(session=None, player=None, pgstat.nick)) register_new_nick(session, player, pgstat.nick) + # if the player is ranked #1 and it is a team game, set the game's winner + # to be the team of that player + # FIXME: this is a hack, should be using the 'W' field (not present) + if pgstat.rank == '1' and pgstat.team: + log.debug('Found rank 1. Logging.') + game.winner = pgstat.team + session.add(game) + session.add(pgstat) session.flush()