Thread Tools Display Modes
04-21-12, 10:57 AM   #1
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
Real ID "k" string to text

while trying to mod one of my addons I have run into a problem... WoW events such as "CHAT_MSG_BN_WHISPER" return as arg[2] a K string instead of the person's real name...
like my gf's name was returned as |Kf15|k00000000000000|k that is useless to me(and the rest of the world) I read up on what it means but have no idea how to turn it into her actual name. I have printed the string and the name shows but I have no way of doing any pattern matching... string manipulation on the string as it is not a name but a "K" string and a waste



|K[gsf][0-9]+|k[0]+|k
New in 4.0 - Represents a Battle.net friend's name. The 3rd character indicates given name, surname, or full name. The number which follows it represents the friend's Bnet Presence ID. The zeros between the |k form a string of the same length as the name which will replace it. E.g. if your first name is John and your presence id is 30, your given name (John) would be represented by the string |Kg30|k0000|k .
  Reply With Quote
04-21-12, 12:30 PM   #2
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Blizzard added this to keep real names private from addons. Otherwise, an addon you install could transmit someone's real name to a 3rd party.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-21-12, 02:02 PM   #3
Dridzt
A Pyroguard Emberseer
 
Dridzt's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2005
Posts: 1,360
You can take a look at Starinnia's RealID Toons that's probably the most help you'll get.
  Reply With Quote
04-21-12, 02:21 PM   #4
Vlad
A Molten Giant
 
Vlad's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2005
Posts: 793
This is one of the major issues with making addon to help organize our real id friends and a log of their toons, because you have no unique identifier for a real id friend, only a session id and the weird text.
  Reply With Quote
04-21-12, 03:22 PM   #5
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
well that stinks... even some kind of local constant for each person would have worked... like a guid for the real id list or some other thing that didn't change... also who cares if it can get your name as there is in most cases a great chance that someone else has that name... are they going to be switching over to the gamer tags then? With non unique identifiers this whole system is rather pointless.

Thanks anyways (and shaking my fist at Blizz)
  Reply With Quote
04-21-12, 03:25 PM   #6
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Originally Posted by Billtopia View Post
also who cares if it can get your name as there is in most cases a great chance that someone else has that name...
"most" is not the same as "all" - there are probably more unique names than you think. Besides, whether or not someone else has the name too is irrelevant. It's a privacy issue nonetheless.

are they going to be switching over to the gamer tags then? With non unique identifiers this whole system is rather pointless.
I believe so, yes. Though I don't know if they will display the tags to addons.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
04-24-12, 06:17 AM   #7
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
I think I may have found a solution... and I should have thought of it sooner. I will just have the user put a "key" in the Real ID friend's note and match the key. so they can put a delimited nickname in the note and I will search out the nickname and then my addon should work fine...
  Reply With Quote
04-24-12, 07:18 AM   #8
Talyrius
An Onyxian Warder
 
Talyrius's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 363
That's not very practical...
  Reply With Quote
04-24-12, 05:34 PM   #9
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
What are you actually trying to accomplish? It's 100% possible to replace full names in the chat frame with first names only, with last names only, with first name + last initial, with initials only, with character name + server, or with character name, and I do several of these things in PhanxChat. However, without knowing what you actually want to do, it's pretty much impossible to help you.
  Reply With Quote
04-25-12, 01:53 PM   #10
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
what it is is an added functionality to my addon Nick Alert. What the addon originally did is when anyone mentioned your character name ( or other saved trigger word ) in any monitored chat channel. It would output that line of chat to MSBT and play a noise to alert you.

Someone asked if I could make it alert them when specific persons ( from real id) message them and normal whispers from specific people. I need to be able to uniquely identify the real ID account without knowing all the person's character names from wow and sc...

I attempted first by going off of the only other thing I could get being name lengths... but even then that is not really unique. ( I guess part of his prob is the all the toon's names his GF doesn't recognize )

It now matches the string in the note and alerts with the person's name and whatever they messaged being output to MSBT along with a nice loud sound .

Last edited by Billtopia : 04-25-12 at 03:23 PM. Reason: clarification
  Reply With Quote
04-25-12, 02:02 PM   #11
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
I suppose I could make the addon put the key in the note for them but other than that... I don't know. I mean if they even gave us some unique attribute I could track. The names on the list can move so that index is out, name lengths can be the same, etc...

I could go another way and use a generic key in the note that could be put there and removed with the addon... I don't know
  Reply With Quote
04-25-12, 03:53 PM   #12
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
If you want to detect names in plain text (not player links) and match them up with the user's Real ID friends, then asking the user to input keywords for each friend is probably the only solution.

As for the issue of your friend's girlfriend not recognizing character names, you could easily make your addon replace the character name displayed in chat with the Real ID name associated with that character (if any). See PhanxChat's PlayerNames module for an example of how to maintain a mapping of character names to Real ID names (I do it the other way, actually, but it would be trivial to reverse it).
  Reply With Quote
04-25-12, 04:31 PM   #13
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
it already uses the full name ("|Kf" string) returned from the Chat_Msg_BN* events when it posts the alerts. he said he was using another addon for chatting and it replaced the K strings with the toon names and it didn't help... ( My question I should have asked is since you need to be a friend with the person for them to Real ID chat you ... ) I was thinking I could add the flag with the addon but it would make the command lines a real pain for the user. Right now they have to add the flag and tell me what nickname they used. I could just make one flag thinking on that as I don't even need to use the nickname. then I could make a list of buttons with the K strings for the text and have them click them to add the string or remove it. I don't need a unique match that way but I would have to remove the command line for it.
  Reply With Quote
04-29-12, 05:20 PM   #14
Billtopia
A Flamescale Wyrmkin
AddOn Author - Click to view addons
Join Date: Apr 2009
Posts: 110
SO, I ended up rewriting the Real ID support on the addon to have it so the user clicks the name to toggle the alerting on or off... I made it so the addon handles the note because as Talyrius stated it was impractical... and the users seemed to have a hard time understanding how to do it... I guess a big list of scrolling buttons ( well the labels scroll but not the buttons) is easier for them... but not really for me.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Real ID "k" string to text

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off