]> de.git.xonotic.org Git - xonotic/xonstat.git/commitdiff
Honor cl_allow_uid2name 0 when cl_allow_uidtracking is 1.
authorAnt Zucaro <azucaro@gmail.com>
Wed, 14 Mar 2012 02:19:59 +0000 (22:19 -0400)
committerAnt Zucaro <azucaro@gmail.com>
Wed, 14 Mar 2012 02:19:59 +0000 (22:19 -0400)
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.

xonstat/views/submission.py

index d043fe3623d6f8e272a5a2cf7d2884684b4b0299..6d5bd5a02fa371f5106b9aa014bd944b29cf4519 100755 (executable)
@@ -389,17 +389,14 @@ def create_player_game_stat(session=None, player=None,
         if key == 'scoreboard-kills': pgstat.kills = value\r
         if key == 'scoreboard-suicides': pgstat.suicides = value\r
 \r
-    # check to see if we had a name, and if \r
-    # not use the name from the player id\r
+    # check to see if we had a name, and if\r
+    # not use an anonymous handle\r
     if pgstat.nick == None:\r
-        pgstat.nick = player.nick\r
+        pgstat.nick = "Anonymous Player"\r
+        pgstat.stripped_nick = "Anonymous Player"\r
 \r
-    # whichever nick we ended up with, strip it and store as the stripped_nick\r
-    pgstat.stripped_nick = qfont_decode(strip_colors(pgstat.nick))\r
-\r
-    # if the nick we end up with is different from the one in the\r
-    # player record, change the nick to reflect the new value\r
-    if pgstat.nick != player.nick and player.player_id > 2:\r
+    # otherwise process a nick change\r
+    elif pgstat.nick != player.nick and player.player_id > 2:\r
         register_new_nick(session, player, pgstat.nick)\r
 \r
     # if the player is ranked #1 and it is a team game, set the game's winner\r