# player_id/stripped_nick not found, create one\r
# but we don't store "Anonymous Player #N"\r
if not re.search('^Anonymous Player #\d+$', player.nick):\r
- player_nick = PlayerNick()\r
+ player_nick = PlayerNick()\r
player_nick.player_id = player.player_id\r
- player_nick.stripped_nick = stripped_nick\r
+ player_nick.stripped_nick = player.stripped_nick\r
player_nick.nick = player.nick\r
session.add(player_nick)\r
\r
# We change to the new nick regardless\r
player.nick = new_nick\r
+ player.stripped_nick = strip_colors(new_nick)\r
session.add(player)\r
\r
\r
session.add(player)\r
session.flush()\r
\r
- # if nick is given to us, use it. If not, use "Anonymous Player"\r
- # with a suffix added for uniqueness.\r
- if nick:\r
- player.nick = nick[:128]\r
- else:\r
- player.nick = "Anonymous Player #{0}".format(player.player_id)\r
+ # if nick is given to us, use it. If not, use "Anonymous Player"\r
+ # with a suffix added for uniqueness.\r
+ if nick:\r
+ player.nick = nick[:128]\r
+ player.stripped_nick = strip_colors(nick[:128])\r
+ else:\r
+ player.nick = "Anonymous Player #{0}".format(player.player_id)\r
+ player.stripped_nick = player.nick\r
\r
hashkey = Hashkey(player_id=player.player_id, hashkey=hashkey)\r
session.add(hashkey)\r