PlaneShift

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category
  • Assigned To
    Roland Schulz
  • Operating System
  • Severity Very Low
  • Priority
  • Reported Version
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: PlaneShift
Opened by Qia Fask - 01.09.2008
Last edited by Steven Schwartfeger - 21.09.2008

FS#2208 - Names appear in lowercase when using Tab to complete them

I often press Tab to finish off the name of players and NPCs, but for some reason the most recent version of PlaneShift makes the last names of NPCs appear as all lowercase letters.

For instance:

Allel + Tab = Allelia symiestra

Whereas before it would fill in the correct name:

Allelia Symiestra

Closed by  Steven Schwartfeger
21.09.2008 04:57
Reason for closing:  
Additional comments about closing:  

Nice.

Steven Schwartfeger commented on 01.09.2008 03:10

Verified.

This I never knew before… seems talking to them puts their name in the tab list, or something; I thought it was only characters you had used /tell or similar on.

weltall commented on 01.09.2008 06:59

The problem is the fact that the function takes for granted that there is only one word (the firstname) and there isn't a surname. While this works with players which sends only their name it doesn't work with npc which sends name and surname.
The function right now changes all letters to downcase and then makes the first one upper (check in npcroom1 that also MaleEnki gets Maleenki)

There are two ways to fix this and so I've done two patches:

The first just searches for a space and then changes also the first letter after it to upper case, which is more similar to the idea of who implemented the function:

http://pastebin.ca/1190258

The second removes the name normalization which shouldn't be necessary as it's already done during char creation and so names like ABCDE AFIADK shouldn't get in game to begin with and all should be already like Male Enky:

http://pastebin.ca/1190259

IMHO the correct fix is the second one…

Qia Fask commented on 01.09.2008 11:28

Steven Schwartfeger:

I try to interact with NPCs quite a lot, as they are after all supposed to be "real people". :p As such, I use Tab for their names a lot. Any name used in regular chat or /tell is added to the list of Tab names. It was only recently that the last name started going to lowercase.

weltall:

Great, thanks for the fast fix! :)

Caarrie commented on 01.09.2008 11:51

setting patch included

Roland Schulz commented on 16.09.2008 03:19

committed to trunk, r2159

peeg commented on 16.09.2008 16:09

Basically this commit reverted my (yes, buggy) patch for  FS#1278  - weltall's first patch is the way to go imho.
Could you have a look at it again?

weltall commented on 16.09.2008 16:45

I've tried what's examplained in  FS#1278  and it still worked fine. the comparenocase seems enough to fix that bug.

peeg commented on 16.09.2008 18:09

Try "/tell aCrAig hi".
"aCraig" will be added to the list of known names and every time you use "/tell a[tab]" you'll get "/tell aCraig". Not exactly broken, but still ugly.

Roland Schulz commented on 16.09.2008 18:40

Other games seem to do this by going through the list of close by or visible objects and selecting the one that most matches the prefix before the tab was pressed (giving priority to objects already interacted with recently) and then inserting that full name. Any prospect up to do this? Should be easy, just iterate through the proxylist and come up with the closest match. Bonus points for coding it so pressing tab multiple times finds the next likely object and so on.

weltall commented on 16.09.2008 19:09

ok now i can see it peeg strange that when i did it with an autotell it worked fine maybe it was because it was already in the list ok then the right fix is the first one but to me the real fix should be that the name shouldn't be sent at all with wrong case (so fixing this somewere else)
if i do /tell VENGEANCE hello i shouldn't get you tell VENGEANCE: hello

weltall commented on 16.09.2008 20:48

this fixes both peeg problem and what I've pointed out above: (pratically the normalization is done when the player inputs the name which is the only case when an unnormalized name can be input in the list)

Index: src/client/gui/chatwindow.cpp
===================================================================
--- src/client/gui/chatwindow.cpp	(revisione 2162)
+++ src/client/gui/chatwindow.cpp	(copia locale)
@@ -632,6 +632,9 @@
         else if (words[0] == "/tell")
         {
             pPerson = words[1];
+            pPerson.Downcase();
+            if (pPerson.Length() > 0)
+                pPerson.SetAt(0,toupper(pPerson.GetAt(0)));
             if (words.GetCount() == 2)
                 return PawsManager::GetSingleton().Translate("You must enter the text").Detach();
             words.GetTail(2,text);
Roland Schulz commented on 16.09.2008 23:47

that's not the right fix. it will only capitalize the first letter.

Qia Fask commented on 17.09.2008 03:27

Wow, so many comments for a bug that I thought was very simple. :p

Thank you all for your work on it.

I would also like to see it so typing in "qI" + Tab will fill in "Qia". Currently if you mis-capitalise a word, it will not let you use Tab on it. It lets you if it is all lowercase, but not if you mis-capitalise some letter.

weltall commented on 17.09.2008 05:16

There is only the first letter to capitalize in the tells: you can't send a tell to Acraig Newfie for example it will send Newfie as text.

anyway there is another way to fix this, which is server based:

Index: src/server/chatmanager.cpp
===================================================================
--- src/server/chatmanager.cpp	(revisione 2162)
+++ src/server/chatmanager.cpp	(copia locale)
@@ -389,7 +389,7 @@
     cmsg.SendMessage();
 
     // Echo the message back to the speaker also
-    psChatMessage cmsg2(client->GetClientNum(), msg.sPerson, 0, msg.sText, CHAT_TELLSELF, msg.translate);
+    psChatMessage cmsg2(client->GetClientNum(), who, 0, msg.sText, CHAT_TELLSELF, msg.translate);
     cmsg2.SendMessage();
 }
 

the name in this case is 100% secure to be correct as it's taken directly from the server (like how it happens for who receives the tell)

Roland Schulz commented on 17.09.2008 18:30

last patch also commited

Project Manager
Lanarel commented on 17.09.2008 22:16

Setting read to test, but hoping someone can test this as I lost track of all the things that were changed here :)

peeg commented on 19.09.2008 16:07

Now things are really broken ;)

Log in Acraig and Vengeance.
As Vengeance type "/tell Acraig Hi" and look at your Tells tab, you'll see "You tell Vengeance: Hi" but it should of course be "You tell Acraig: Hi". Also Acraig isn't added to the list of known names.
Acraig's Tell tab will read "Vengeance tells you: Hi" which is correct.

weltall commented on 20.09.2008 05:27

committed a fix which works and resolves the remaining issues to r2166

Qia Fask commented on 22.09.2008 00:00

Thanks for all your work.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing