return (game_meta, players)\r
\r
\r
-def is_blank_game(players):\r
+def is_blank_game(gametype, players):\r
"""Determine if this is a blank game or not. A blank game is either:\r
\r
1) a match that ended in the warmup stage, where accuracy events are not\r
- present\r
+ present (for non-CTS games)\r
\r
2) a match in which no player made a positive or negative score AND was\r
on the scoreboard\r
+\r
+ ... or for CTS, which doesn't record accuracy events\r
+\r
+ 1) a match in which no player made a fastest lap AND was\r
+ on the scoreboard\r
"""\r
r = re.compile(r'acc-.*-cnt-fired')\r
flg_nonzero_score = False\r
flg_acc_events = False\r
+ flg_fastest_lap = False\r
\r
for events in players:\r
if is_real_player(events) and played_in_game(events):\r
flg_nonzero_score = True\r
if r.search(key):\r
flg_acc_events = True\r
+ if key == 'scoreboard-fastest':\r
+ flg_fastest_lap = True\r
\r
- return not (flg_nonzero_score and flg_acc_events)\r
+ if gametype == 'cts':\r
+ return not flg_fastest_lap\r
+ else:\r
+ return not (flg_nonzero_score and flg_acc_events)\r
\r
\r
def get_remote_addr(request):\r
'as',\r
'ca',\r
# 'cq',\r
- # 'cts',\r
+ 'cts',\r
'dm',\r
'dom',\r
'ft', 'freezetag',\r
log.debug("ERROR: Not enough real players")\r
raise pyramid.httpexceptions.HTTPOk("OK")\r
\r
- if is_blank_game(raw_players):\r
+ if is_blank_game(game_meta['G'], raw_players):\r
log.debug("ERROR: Blank game")\r
raise pyramid.httpexceptions.HTTPOk("OK")\r
\r