and 'scoreboardvalid' in player_events:\r
pgstat = create_player_game_stat(session=session, \r
player=player, game=game, player_events=player_events)\r
+\r
+ #TODO: put this into a config setting in the ini file?\r
if not re.search('^bot#\d+$', player_events['P']):\r
create_player_weapon_stats(session=session, \r
player=player, game=game, pgstat=pgstat,\r
"Can't continue.")\r
raise Exception("Required game meta fields (T, G, M, or S) missing.")\r
\r
- has_real_players = False\r
+ real_players = 0\r
for player_events in players:\r
if not player_events['P'].startswith('bot'):\r
- if 'joins' in player_events and 'matches' in player_events\\r
+ # removing 'joins' here due to bug, but it should be here\r
+ if 'matches' in player_events\\r
and 'scoreboardvalid' in player_events:\r
- has_real_players = True\r
+ real_players += 1\r
\r
- if not has_real_players:\r
- raise Exception("No real players found. Stats ignored.")\r
+ #TODO: put this into a config setting in the ini file?\r
+ if real_players < 2:\r
+ raise Exception("The number of real players is below the minimum. "\\r
+ "Stats will be ignored.")\r
\r
server = get_or_create_server(session=session, name=game_meta['S'])\r
gmap = get_or_create_map(session=session, name=game_meta['M'])\r