WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   String variables in C_LFGList.GetSearchResultInfo (https://www.wowinterface.com/forums/showthread.php?t=57843)

Kinav 02-27-20 07:12 AM

String variables in C_LFGList.GetSearchResultInfo
 
Some addon doesn't work in my russian client. I tried to find problem and fix it. And found next problem with API and some string variables. API function C_LFGList.GetSearchResultInfo returns "name" and "comment" as string. But only print() LUA-command works fine with this string. There is an example of my code:

HelloWorld.toc
Code:

## Interface: 80300
## SavedVariables: name, comment
## Title: Hello World!
## Notes: My first AddOn
## Version: 1.0.0

HelloWorld.lua
HelloWorld.xml

HelloWorld.lua
Code:

local b = CreateFrame("Button", "MyButton", UIParent, "UIPanelButtonTemplate")
b:SetSize(80 ,22) -- width, height
b:SetText("Button!")
b:SetPoint("CENTER")
b:SetScript("OnClick", function()
        name = C_LFGList.GetSearchResultInfo(693).name
        comment = C_LFGList.GetSearchResultInfo(693).comment
        print("name: ", name,". String len: ", string.len(name))
        print("comment:", comment,". String len: ", string.len(comment))
end)

HelloWorld.xml
Code:

<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">
        <Script File="HelloWorld.lua"/>
        <Frame name="HelloWorldFrame">
                <Scripts>
                        <OnLoad>
                        </OnLoad>
                </Scripts>
        </Frame>
 </Ui>


Result in game:
Code:

name: the shard of heaven farm wm of. String len: 8
comment: осколки небес фарм вм оф. String len:8

and saved this variables in file "...World of Warcraft\_retail_\WTF\Account\...\SavedVariables\HelloWorld.lua"
Code:

name = "|Kr730|k"
comment = "|Kr731|k"


Possible problem with UTF8 charset, but UTF8 addon also doesn't work with these strings.

Update: the same problem is with EN game client.

Kanegasi 02-27-20 12:38 PM

That is Blizzard's method of "encrypting" or obfuscating strings. The tech started with realID and battletags where add-ons are unable to actually access anyone's real name even though you can see it. If you're familiar with text formatting, the system uses | then a letter then data input then another | and usually the same letter lowercase. This is most commonly seen with colors using |chexcodeTEXT|r and clickable inline links using |Hlinkdata|hVisibleText|h. Communities, group finder, and bnet friends all use |Kdata|k for obfuscation.

It is not possible for code to read or save what you see.


All times are GMT -6. The time now is 01:35 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI