% (self.player_id, self.game_id, self.create_dt, self.stat_type)
def nick_stripped(self):
- return strip_colors(self.nick)
+ if self.nick is None:
+ return "Anonymous Player"
+ else:
+ return strip_colors(self.nick)
def nick_html_colors(self):
- return html_colors(self.nick)
+ if self.nick is None:
+ return "Anonymous Player"
+ else:
+ return html_colors(self.nick)
def team_html_color(self):
# blue
"""\r
Creates player game and weapon stats according to what type of player\r
"""\r
- # remove 'joins' from here even though it should be required\r
- if 'matches' in player_events 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
- player_events=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
+ player_events=player_events)\r
\r
\r
def stats_submit(request):\r
else:\r
nick = None\r
\r
- player = get_or_create_player(session=session, \r
+ if 'matches' in player_events and 'scoreboardvalid' \\r
+ in player_events:\r
+ player = get_or_create_player(session=session, \r
hashkey=player_events['P'], nick=nick)\r
- log.debug('Creating stats for %s' % player_events['P'])\r
- create_player_stats(session=session, player=player, game=game, \r
- player_events=player_events)\r
+ log.debug('Creating stats for %s' % player_events['P'])\r
+ create_player_stats(session=session, player=player, game=game, \r
+ player_events=player_events)\r
\r
session.commit()\r
log.debug('Success! Stats recorded.')\r