From: Ant Zucaro Date: Wed, 14 Mar 2012 02:19:59 +0000 (-0400) Subject: Honor cl_allow_uid2name 0 when cl_allow_uidtracking is 1. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=074823acb52862ccc4ecf13429e93cd45e592074;p=xonotic%2Fxonstat.git Honor cl_allow_uid2name 0 when cl_allow_uidtracking is 1. In an attempt to display better nick information I've overwritten the provided nick (in this case none) w/ what was on the player record. This is wrong - if uid2name is 0, thus leading to no nick provided, that means I should show "Anonymous Player". This ends up being a little silly when uidtracking is 1, because a person can just click on the "Anonymous Player" link to see who was actually playing :D. --- diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index d043fe3..6d5bd5a 100755 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -389,17 +389,14 @@ def create_player_game_stat(session=None, player=None, if key == 'scoreboard-kills': pgstat.kills = value if key == 'scoreboard-suicides': pgstat.suicides = value - # check to see if we had a name, and if - # not use the name from the player id + # check to see if we had a name, and if + # not use an anonymous handle if pgstat.nick == None: - pgstat.nick = player.nick + pgstat.nick = "Anonymous Player" + pgstat.stripped_nick = "Anonymous Player" - # whichever nick we ended up with, strip it and store as the stripped_nick - pgstat.stripped_nick = qfont_decode(strip_colors(pgstat.nick)) - - # if the nick we end up with is different from the one in the - # player record, change the nick to reflect the new value - if pgstat.nick != player.nick and player.player_id > 2: + # otherwise process a nick change + elif pgstat.nick != player.nick and player.player_id > 2: register_new_nick(session, player, pgstat.nick) # if the player is ranked #1 and it is a team game, set the game's winner