View Single Post
02/02/24, 10:12 AM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,579
These functions work the same way as they did back when the guild finder was introduced. My guess is, last year you simply happened to request data for guilds you had already opened in the guild finder, which made it seem like it worked the way you describe.

The game client only knows a very limited amount about guilds that exist on the server. Loading information about a couple ten thousand guilds for every single user at login is unfeasible. So in order to reduce server strain it only automatically requests data for the guilds you are a member of when you log in and it can also manually request data for guilds in the guild finder when it is needed.

Since it takes time to ask the server for guild data and receive it, this cannot happen during a simple GetGuildName or GetGuildRecruitmentMessageAttribute call.
You have to keep in mind that Lua operates on a single thread together with the rest of the game, which means it can only process one line at a time and if it had to wait for the server response, the whole game client would freeze for that duration.

This is why you'd have to call RequestGuildFinderAttributesForGuild(guildID) and wait for EVENT_GUILD_INFO_REQUEST_COMPLETE. However the game already offers a ZO_GuildBrowser_Manager class which wraps these low level functions and even provides a cache. That's why you should better use GUILD_BROWSER_MANAGER:RequestGuildData(guildId) and GUILD_BROWSER_MANAGER:RegisterCallback("OnGuildDataReady", function(guildId) end).

Also please keep in mind when you write your library or addon, that automatically requesting data for many guilds could potentially destabilize the server and force ZOS to lock the guild finder api like they had to do with the guild history api when Master Merchant became too popular.

(also moving this to general discussion since it's not really a valid wish)

EDIT: Another thing that could also explain your issue is that the guild finder does not return data when guild recruitment is deactivated. That can either happen when the guild master opts to disable it, or when the guild is full.

Last edited by sirinsidiator : 02/02/24 at 10:17 AM.
  Reply With Quote