ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Is retrieval of info of non-logged in chars in same acct allowed? (https://www.esoui.com/forums/showthread.php?t=10773)

vsrs_au 01/03/24 02:35 AM

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?

Baertram 01/03/24 12:08 PM

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.


All times are GMT -6. The time now is 08:59 AM.

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