[RESOLVED]FilterName only called some instances(0.2.8sty+ct)

What do you want to see in Armagetron soon? Any new feature ideas? Let's ponder these ground breaking ideas...
Post Reply
Obsi
Posts: 7
Joined: Fri Sep 18, 2009 8:52 am

[RESOLVED]FilterName only called some instances(0.2.8sty+ct)

Post by Obsi »

Noticed authenticated names were occasionally showing up in ladderlog in lowercase. From what I can tell by glancing at the code it's because ePlayerNetID::FilterName is getting called on lines like

Code: Select all

sg_deathDeathZoneWriter << ePlayerNetID::FilterName(target->Player()->GetUserName());
(tron/gWinZone.cpp - line 1581)

but not on lines like

Code: Select all

sg_deathShotFragWriter << prey->GetUserName() << hunter->GetUserName();
(tron/gWinZone.cpp - line 1654)

Not sure if this was intentional or an oversight, but it does result in mismatched capitalization in the ladderlog. A 'gotcha' to watch out for in your parser.
Last edited by Obsi on Mon Oct 05, 2009 12:21 am, edited 3 times in total.
User avatar
Z-Man
God & Project Admin
Posts: 11710
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: ePlayerNetID::FilterName only called in some instances

Post by Z-Man »

The player's user name is already filtered, so those additional calls to FilterName are redundant for players not logged in and just wrong for authenticated players. What source versions did you find them in? I only found them in sty+ct. So, goandfixit :)
Obsi
Posts: 7
Joined: Fri Sep 18, 2009 8:52 am

Re: ePlayerNetID::FilterName only called in some instances

Post by Obsi »

Code: Select all

--- tron/gWinZone.cpp.orig      2009-09-30 12:07:49.000000000 -0700
+++ tron/gWinZone.cpp   2009-09-30 12:08:50.000000000 -0700
@@ -1578,7 +1578,7 @@
     {
                target->Player()->AddScore(score_deathzone, tOutput(), "$player_lose_deathzone");
     target->Kill();
-               sg_deathDeathZoneWriter << ePlayerNetID::FilterName(target->Player()->GetUserName());
+               sg_deathDeathZoneWriter << target->Player()->GetUserName();
                sg_deathDeathZoneWriter.write();
     }
     else
@@ -2513,7 +2513,7 @@

                        if ( closest )
                        {
-                               sg_deathBasezoneConqueredWriter << ePlayerNetID::FilterName(closest->GetUserName());
+                               sg_deathBasezoneConqueredWriter << closest->GetUserName();
                                if ( enemies_.size() > 0 || sg_defendRate < 0)
                                {
                     tColoredString playerName;


Also noticed team names being filtered by it, did some digging, but wasn't sure if they were previously filtered or not so I left them alone.
User avatar
Z-Man
God & Project Admin
Posts: 11710
Joined: Sun Jan 23, 2005 6:01 pm
Location: Cologne
Contact:

Re: FilterName only called some instances (0.2.8 sty+ct)

Post by Z-Man »

Yeah, team names should be filtered consistently. Basically to transform whitespace to underscores.
User avatar
kyle
Reverse Outside Corner Grinder
Posts: 1963
Joined: Thu Jun 08, 2006 3:33 pm
Location: Indiana, USA, Earth, Milky Way Galaxy, Universe, Multiverse
Contact:

Re: FilterName only called some instances (0.2.8 sty+ct)

Post by kyle »

hmmm I must have kept those from previous revisions when I merged with mainline. I'll fix them this week.
Image
Post Reply