return (idfp, status)\r
\r
\r
+def num_real_players(player_events):\r
+ """\r
+ Returns the number of real players (those who played \r
+ and are on the scoreboard).\r
+ """\r
+ real_players = 0\r
+\r
+ for events in player_events:\r
+ if is_real_player(events):\r
+ real_players += 1\r
+\r
+ return real_players\r
+\r
+\r
def has_minimum_real_players(settings, player_events):\r
"""\r
Determines if the collection of player events has enough "real" players\r
except:\r
minimum_required_players = 2\r
\r
- real_players = 0\r
- for events in player_events:\r
- if is_real_player(events):\r
- real_players += 1\r
+ real_players = num_real_players(player_events)\r
\r
#TODO: put this into a config setting in the ini file?\r
if real_players < minimum_required_players:\r
# FIXME: if we have two players and game type is 'dm',\r
# change this into a 'duel' gametype. This should be\r
# removed when the stats actually send 'duel' instead of 'dm'\r
- if len(players) == 2 and game_meta['G'] == 'dm':\r
+ if num_real_players(players) == 2 and game_meta['G'] == 'dm':\r
game_meta['G'] = 'duel'\r
\r
server = get_or_create_server(session=session, hashkey=idfp, \r