return gmap\r
\r
\r
-def create_game(session=None, start_dt=None, game_type_cd=None,\r
- server_id=None, map_id=None, winner=None, match_id=None,\r
- duration=None):\r
+def create_game(session, start_dt, game_type_cd, server_id, map_id,\r
+ match_id, duration, mod, winner=None):\r
"""\r
Creates a game. Parameters:\r
\r
server_id - server identifier of the server hosting the game\r
map_id - map on which the game was played\r
winner - the team id of the team that won\r
+ duration - how long the game lasted\r
+ mod - mods in use during the game\r
"""\r
seq = Sequence('games_game_id_seq')\r
game_id = session.execute(seq)\r
game = Game(game_id=game_id, start_dt=start_dt, game_type_cd=game_type_cd,\r
server_id=server_id, map_id=map_id, winner=winner)\r
game.match_id = match_id\r
+ game.mod = mod[:64]\r
\r
try:\r
game.duration = datetime.timedelta(seconds=int(round(float(duration))))\r
game_type_cd = game_type_cd,\r
map_id = gmap.map_id,\r
match_id = game_meta['I'],\r
- duration = duration)\r
+ duration = duration,\r
+ mod = game_meta.get('O', None))\r
\r
for events in raw_players:\r
player = get_or_create_player(\r