Regional Flag6.2.4 Lua API ChangesSource
avatar
Blue Poster
Target Source
#1 - 2016/03/02 08:13:00 PM
In the upcoming Patch 6.2.4, we're moving to a new Battle.net infrastructure. There are changes to many of the Battle.net-related Lua APIs, including Battle.net friends and Battle.net chat. If you maintain an AddOn that makes use of those features, you may want to log in to the PTR and test that your AddOn still functions correctly. To help AddOn authors troubleshoot potential compatibility issues, we’ve highlighted a few of the big changes to help direct you to areas that may need your attention.

Conversations
Support for conversations has been removed. This includes all C-functions (BNCreateConversation, BNGetConversationInfo, etc.) as well as all Lua/XML references to conversations.

Toons
The new Battle.net architecture doesn’t have the concept of “Toons”. Instead, we refer to “GameAccounts”. As a result, many functions with “Toon” in the name now refer to “GameAccount”
Examples:
BNGetToonInfo -> BNGetGameAccountInfo
BNGetFriendToonInfo -> BNGetFriendGameAccountInfo
BNGetNumFriendToons -> BNGetNumFriendGameAccounts

Presence IDs
Previously, “Presence IDs” could refer to either Battle.net accounts or individual toons. Most functions were able to accept either type of presence ID and, when passed the wrong type, tried to guess at what you were trying to do.

Presence IDs have been replaced with bnetIDAccount and bnetIDGameAccount. With this change, we’ve made all functions strict about whether they accept Account IDs or Game Account IDs. In order to make this easier, all Lua variables have been updated to specify which type of ID they are.

You can translate from a bnetIDGameAccount to a bnetIDAccount as follows:
bnetIDAccount = select(17, BNGetGameAccountInfo(bnetIDGameAccount));
You can find a player’s active bnetIDGameAccount from a bnetIDAccount as follows:
bnetIDGameAccount = select(6, BNGetFriendInfoByID(bnetIDAccount));
Current Realm Name
The “realmName” CVar no longer exists. You can get the name of the current realm using GetRealmName().

avatar
Blue Poster
Target Source
#5 - 2016/03/03 12:25:00 AM
03/02/2016 02:11 PMPosted by Bor
The “realmName” CVar no longer exists. You can get the name of the current realm using CurrentRealmName().

Do you mean GetRealmName(), the already-existing function? Or is this a new function that can (or must?) replace GetRealmName()?

The "realmName" CVar is no longer there, but the function to get the name of the current realm is still GetRealmName. Correction made to the post, thanks for asking.

avatar
Blue Poster
Target Source
#13 - 2016/03/03 08:01:00 PM
Do places that previously provided toon presence IDs now guarantee providing a game account ID? I'm specifically thinking of things like the arguments provided to the BN_CHAT_MSG_ADDON event handlers, as it's very useful to tie such in-game sent data to a specific game account source.

Yes, BN_CHAT_MSG_ADDON is now guaranteed to give a bnetIDGameAccount. All other chat events will provide a bnetIDAccount.

Does this include events? Are BN_TOON_NAME_UPDATED, BN_FRIEND_TOON_ONLINE, BN_FRIEND_TOON_OFFLINE all renamed to BN_GAME_ACCOUNT_NAME_UPDATED, BN_FRIEND_GAME_ACCOUNT_ONLINE, BN_FRIEND_GAME_ACCOUNT_OFFLINE respectively?

These events are no longer used. BN_FRIEND_INFO_CHANGED will fire for changes to both account and game-account data.

03/02/2016 02:34 PMPosted by Omegal
Another change i noticed, any function that returned btag now only returns string and strips # and numbers.

Thanks for the heads-up! This should be fixed in a coming build to work the same way that it does on live.

avatar
Blue Poster
Target Source
#18 - 2016/03/04 01:29:00 AM
03/03/2016 03:37 PMPosted by Bor
03/03/2016 02:44 PMPosted by Gello
It seems BNSendGameData is not working. I'm more and more convinced that it's bugged. But maybe I'm missing something.

As far as I can see, you're using it right and it's definitely getting the WoW game account ID. Since the SendAddonMessage() works, I'm assuming you did RegisterAddonMessagePrefix("Rematch"), which is the only other thing I can think of there.

From what I can see, it should be working. Best guess is that, yeah, there's some sort of bug going on there. Rygarius, is this a known issue? Or are there other changes that we need to account for with BNSendGameData()?

We're aware of an issue with BNSendGameData() not working correctly in the current build. The issue has been tracked down and should be fixed in an upcoming PTR build.