Go Back   WowAce Forums > General > Lua Code Discussion
Lua Code Discussion You scared? Terrified. Mortified. Petrified. Stupefied... by [coding].

Reply
 
Thread Tools
Old 08-02-2013   #1
oscarucb
Junior Member
 
oscarucb's Avatar
 
Join Date: Dec 2007
Posts: 68
Default 5.4 changes to TradeSkill hyperlinks

Heads-up to authors of TradeSkill-related addons: the TradeSkill hyperlink format is undergoing some massive changes in 5.4 (as of PTR build 17252).

Code:
5.3 format: |Htrade:<playerGUID>:<spellid>:<rank>:<rankmax>:<databits>|h[<profname>]|h
5.4 format: |Htrade:<playerGUID>:<spellid>:<pid>|h[<profname>]|h
Most notably, the <databits>, <rank> and <rankmax> fields are being removed entirely and all data is being fetched dynamically from the server based on player GUID in the link. The new <pid> field is technically redundant with spellid, and is the Profession ID as returned by GetProfessionInfo().

The implications of this change are that most addons that parse the contents of the tradeskill hyperlink in any way will likely need fixes for 5.4. Addons that try to parse the databits field will likely need major changes (mine is in this category).

It also appears that as a result of this change, it's no longer possible to forge an "all recipes" tradeskill hyperlink for the user that can be clicked to open a tradeskill window containing every available spell (eg ProfessionsDatabase). Many addons have embedded this handy quality-of-life feature in one way or another, however I believe it's no longer possible to implement such a link-generation facility (unless there is some kind of backdoor or other trick I'm unaware of). Addons which totally replace the tradeskill window could potentially still offer a display of every spell, but would need to bypass the Blizzard GetTradeSkill* API's to provide the data (and could not provide an "all recipes" link for use in chat, etc). The inability to forge arbitrary trade hyperlinks may also hinder TradeSkill data-mining code.

I'm curious to hear from other TradeSkill addon authors regarding these changes and how you plan to handle them..

Last edited by oscarucb; 09-20-2013 at 05:45 AM.
oscarucb is offline   Reply With Quote
Old 08-04-2013   #2
EthanCentaurai
Newbie
 
EthanCentaurai's Avatar
 
Join Date: Sep 2007
Location: Leeds, England
Posts: 5
Send a message via Skype™ to EthanCentaurai
Default Re: 5.4 changes to TradeSkill hyperlinks

Thanks for the heads-up about this.

I've looked through my code and am confident that TradeSkillInfo will be completely unaffected by this change as it does not use tradeskill hyperlinks at all.

I cannot guarantee 100% compatibility though as I have not been able to download the current PTR, but I will keep an eye on things in case any issues arise.
__________________

Twitter | Blog
EthanCentaurai is offline   Reply With Quote
Old 08-30-2013   #3
oscarucb
Junior Member
 
oscarucb's Avatar
 
Join Date: Dec 2007
Posts: 68
Default Re: 5.4 changes to TradeSkill hyperlinks

So it appears the situation is actually significantly worse than I originally realized (as of PTR build 5.4.0 17337).

Not only is all the tradeskill data fetched dynamically from the server, but it furthermore appears that this fetching will ONLY take place if the character GUID in the link has already been encountered by the client during the current session. Stated differently, you can only open links from characters that you are grouped with, chatting with or standing near in the game world. Any attempt to open links obtained via other means will silently fail.

This means that in particular, you cannot open tradeskill links for your alts. It also means that if player A whispers his tradeskill link to player B, and player B whispers it to player C, then player C will be unable to open that link unless he has "encountered" player A during the current session.

I don't know if this behavior is intentional (some kind of misguided security measure?), but it seems more likely to be a design flaw in the new tradeskill hyperlink implementation. Either way this is a major departure from previous behavior and will play havoc with some addons (anything with a feature to link your alt's profession).
oscarucb is offline   Reply With Quote
Old 08-30-2013   #4
EthanCentaurai
Newbie
 
EthanCentaurai's Avatar
 
Join Date: Sep 2007
Location: Leeds, England
Posts: 5
Send a message via Skype™ to EthanCentaurai
Default Re: 5.4 changes to TradeSkill hyperlinks

I suspect it is being done as a throttle to deliberately prevent addons from spamming the server with queries. Since the patch is due in 10 days, if they don't change anything I will assume the changes are intentional.

Either way, TradeSkillInfo will be completely unaffected. Other addons will need changes.
__________________

Twitter | Blog
EthanCentaurai is offline   Reply With Quote
Old 08-30-2013   #5
oscarucb
Junior Member
 
oscarucb's Avatar
 
Join Date: Dec 2007
Posts: 68
Default Re: 5.4 changes to TradeSkill hyperlinks

I don't think it's an intentional throttling measure, because it's still possible to flood the server with requests for any cached GUID (which you encounter in large quantity while standing in town or sitting in a 40-man raid). So it would be a very ineffectual throttle.

I suspect it's a consequence of how GUID caching is handled in the C code - the code that activates the hyperlink is dropping dead when it encounters a cache miss, instead of initiating a cache fetch as it should (as it does in 5.3 when you open a link with an uncached GUID and it has to fetch the player name).

In any case I agree it's unlikely to change again this late in the patch cycle, which means live users will probably be stuck with the negative implications of this new behavior for awhile. For whatever it's worth I've created a thread on the Blizzard bug report forum to complain about the issue. Feel free to add your voice:

http://us.battle.net/wow/en/forum/topic/10025372561

Last edited by oscarucb; 09-20-2013 at 05:44 AM.
oscarucb is offline   Reply With Quote
Old 08-31-2013   #6
cremor
Hero Member
 
Join Date: Feb 2007
Posts: 841
Default Re: 5.4 changes to TradeSkill hyperlinks

Does this change affect the professions display of the guild frame somehow? Or are the GUIDs of all guild members automatically in the cache?
cremor is offline   Reply With Quote
Old 08-31-2013   #7
oscarucb
Junior Member
 
oscarucb's Avatar
 
Join Date: Dec 2007
Posts: 68
Default Re: 5.4 changes to TradeSkill hyperlinks

Quote:
Originally Posted by cremor View Post
Does this change affect the professions display of the guild frame somehow? Or are the GUIDs of all guild members automatically in the cache?
The guild tradeskill window appears to be unaffected, but only because that window never uses a hyperlink of any kind (nor does it offer one for linking into chat). Guild tradeskills use the same TradeSkillFrame, but are opened via a different code path thru lua/C (GUILD_TRADESKILL_UPDATE), and the displayed data is fetched using an independent API (ie GetGuildTradeSkillInfo() and friends). So basically it avoids the trouble by never touching the new problematic hyperlink encoding/implementation.

Note that being in the same guild with someone does not mean their GUID is cached, even if they are logged in and you are looking at the roster. You still cannot open the tradeskill hyperlinks of that character unless you've "encountered" them during the current login session (eg if they speak in guild chat, whispers or join a group with you). This means that for example, having all your alts in the same guild still does not allow you to open the tradeskill hyperlinks for your alts (or whisper a working link to other players), but you can still manually navigate thru the professions pane of the guild roster to open their tradeskill.
oscarucb is offline   Reply With Quote
Old 09-04-2013   #8
sapu94
Full Member
 
Join Date: Feb 2010
Posts: 107
Default Re: 5.4 changes to TradeSkill hyperlinks

Just came across this thread. I was surprised to find this didn't break TSM_Crafting, but not being able to open alts' professions is very lame and I see a lot of tickets / questions about that in my future...

EDIT: Will add my support to the wow forums thread.
__________________
Lead developer of the TradeSkillMaster gold making addon.

"A good programmer is someone who always looks both ways before crossing a one-way street." ~Doug Linder
sapu94 is offline   Reply With Quote
Old 09-08-2013   #9
oscarucb
Junior Member
 
oscarucb's Avatar
 
Join Date: Dec 2007
Posts: 68
Default Re: 5.4 changes to TradeSkill hyperlinks

For what it's worth, the problematic Blizzard code is inside the C-code implementation of ItemRefTooltip:SetHyperlink(), as called by SetItemRef() in FrameXML/ItemRef.lua.
oscarucb is offline   Reply With Quote
Old 09-11-2013   #10
sapu94
Full Member
 
Join Date: Feb 2010
Posts: 107
Default Re: 5.4 changes to TradeSkill hyperlinks

Just a heads up, GetTradeSkillNumMade() now gives seemingly random values for enchants.
__________________
Lead developer of the TradeSkillMaster gold making addon.

"A good programmer is someone who always looks both ways before crossing a one-way street." ~Doug Linder
sapu94 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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

Forum Jump


All times are GMT. The time now is 05:02 PM.