Thread Tools Display Modes
02-24-19, 08:23 PM   #1
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Connected Realm function(s)

A function to get the realms connected to this one would be a start.

The motivation for this is that some accounts have more characters than a single server can hold and have resorted to creating alts on connected realms. I believe those alts can send mail to each other and therefore share materials like crafting mats.

In Skillet, I keep a shopping list of materials needed by other characters that currently only works when all the characters are on the same realm. With a function to determine which realms are connected to this one, I can extend the shopping list across those realms.
  Reply With Quote
02-24-19, 09:59 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
https://wow.gamepedia.com/API_UnitRealmRelationship
  Reply With Quote
02-25-19, 07:01 AM   #3
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Unfortunately, this function applies to two units that are online. I'm looking for a function that can give me this relationship for two characters that are on the same account and therefore cannot be online at the same time.

RealmRelationship(realm) could return the same values as UnitRealmRelationship and I'd be a happy camper.

I can capture the realm and the name of each character (and even the GUID) when it is online along with the information about the character's crafting needs. When that character is offline, I need to know if its realm is connected to the one the currently online character is on.

I don't understand why Blizzard wants to keep the list of connected realms a secret. It is not really a secret as addons like CensusPlus figure it out. I'd be happy with an ACE3 library that provides the list. What I don't want to do is force the owner of the account to manually enter the information (and I really don't want to maintain that information manually myself).
  Reply With Quote
02-25-19, 03:41 PM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,857
You know the realms your characters are on, couldn't you run a nameplate scan for characters on the same realm(s) and compare those, storing the results?

Lua Code:
  1. SLASH_AAAAA1 = "/aa"
  2. SlashCmdList["AAAAA"] = function(msg)
  3.     for i=1, 40 do
  4.         local name, realm = UnitName("NamePlate"..i)
  5.         if realm then
  6.             local realmRelationship = UnitRealmRelationship("NamePlate"..i)
  7.             print(name, realm, realmRelationship)
  8.         end
  9.     end
  10. end

Something a bit more elegant <cough> and automated could be put together and build your db over time/characters I'm sure.

Edit: Too much time on my hands.
Lua Code:
  1. local f = CreateFrame("Frame", "FizzleNamePlateInspector", UIParent)
  2. f:RegisterEvent("UNIT_NAME_UPDATE")
  3. f:RegisterEvent("NAME_PLATE_UNIT_ADDED")
  4. f:SetScript("OnEvent", function(self, event, ...)
  5.     local arg1 = ...
  6.     local name, realm = UnitName(arg1)
  7.     if realm then
  8.         local realmRelationship = UnitRealmRelationship(arg1)
  9.         print(name, realm, realmRelationship)
  10.     end
  11. end)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 02-25-19 at 04:35 PM.
  Reply With Quote
02-25-19, 04:54 PM   #5
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
I just remembered player GUIDs. The second part is a realm ID and connected realms share that ID.

https://wow.gamepedia.com/GUID

Lua Code:
  1. local guid = UnitGUID("player")
  2. local kind, server, ID = strsplit("-", guid or "")
  3. -- example: guid="Player-970-0002FD64" kind=="Player" server=="970" ID="0002FD64"

For example, if you were on (NA) Blackrock, the middle number will be 10, but if you were on (NA) Earthen Ring, (NA) Auchindoun, or (NA) Cho'gall, which are connected together, it will be 101. The server in the example, 970, is the connected realms "Beta Leveling Realm 01" and "Beta Leveling Realm 03".

CensusPlus "figures this out" with a fork of LibRealmInfo named "LibRealmID". The original lists each server as their original ID with a connection data table while the fork combines the data into one table with "ID-servername" keys.

You'll have to arrange Skillet in a way that remembers the GUID of each alt and allows sharing between characters that have the same server ID in their GUID, which means users have to login to each alt once your change is released to save each GUID.

Last edited by Kanegasi : 02-25-19 at 04:59 PM.
  Reply With Quote
02-25-19, 05:28 PM   #6
bsmorgan
A Cobalt Mageweaver
AddOn Author - Click to view addons
Join Date: Mar 2005
Posts: 219
Originally Posted by Kanegasi View Post
I just remembered player GUIDs. The second part is a realm ID and connected realms share that ID.
This is the revelation I need! Currently, the per character data is stored in AceDB's realm tables but I can move them to the global table indexed by this shared realm ID and it should all work (famous last words)!
  Reply With Quote
03-06-19, 12:59 PM   #7
brykrys
A Deviate Faerie Dragon
 
brykrys's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 13
Sounds like GetAutoCompleteRealms would help here.
  Reply With Quote

WoWInterface » Developer Discussions » Wish List » Connected Realm function(s)

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