Thread Tools Display Modes
01/03/24, 02:35 AM   #1
vsrs_au
Join Date: Dec 2022
Posts: 18
Is retrieval of info of non-logged in chars in same acct allowed?

Does the ESOUI API allow retrieval of information of characters in the logged-in account other than the currently logged-in character? Or is this blocked for security reasons?
  Reply With Quote
01/03/24, 12:08 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
You can only get the characterIds and their names, but no bags, items, achievements (afaik), or any other info while not having those characters logged in.
Here is an example function how to retrieve that from my addon FCOItemSaver with 2 possibilities to create a table with different keys:
Lua Code:
  1. --Function to get all characters of the currently logged in @account: server's unique characterID and non unique name.
  2. --Returns a table:nilable with 2 possible variants, either the character ID is key and the name is the value,
  3. --or vice versa.
  4. --Parameter boolean, keyIsCharName:
  5. -->True: the key of the returned table is the character name
  6. -->False: the key of the returned table is the unique character ID (standard)
  7. function FCOIS.GetCharactersOfAccount(keyIsCharName)
  8.     keyIsCharName = keyIsCharName or false
  9.     local charactersOfAccount
  10.     --Check all the characters of the account
  11.     for i = 1, GetNumCharacters() do
  12.         local name, _, _, _, _, _, characterId = GetCharacterInfo(i)
  13.         local charName = zo_strformat(SI_UNIT_NAME, name)
  14.         if characterId ~= nil and charName ~= "" then
  15.             if charactersOfAccount == nil then charactersOfAccount = {} end
  16.             if keyIsCharName then
  17.                 charactersOfAccount[charName]   = characterId
  18.             else
  19.                 charactersOfAccount[characterId]= charName
  20.             end
  21.         end
  22.     end
  23.     return charactersOfAccount
  24. end



Therefor several libraries have been created, or addons, like
Inventory Insight from Ashes, What pledges at my alts, LibCharacterKnowledge, etc.
which store that other char's data in the SavedVariables so you can have a look at that from your currently logged in char.

Last edited by Baertram : 01/03/24 at 12:14 PM.
  Reply With Quote

ESOUI » Developer Discussions » General Authoring Discussion » Is retrieval of info of non-logged in chars in same acct allowed?


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