\r
log = logging.getLogger(__name__)\r
\r
+def is_real_player(events):\r
+ flg_is_real = False\r
+\r
+ if not events['P'].startswith('bot'):\r
+ # removing 'joins' here due to bug, but it should be here\r
+ if 'matches' in events and 'scoreboardvalid' in events:\r
+ flg_is_real = True\r
+\r
+ return flg_is_real\r
+\r
\r
def register_new_nick(session, player, new_nick):\r
"""\r
raise Exception("Required game meta fields (T, G, M, or S) missing.")\r
\r
real_players = 0\r
- for player_events in players:\r
- if not player_events['P'].startswith('bot'):\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
- real_players += 1\r
+ for events in players:\r
+ if is_real_player(events):\r
+ real_players += 1\r
\r
#TODO: put this into a config setting in the ini file?\r
if real_players < 1:\r