ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   Bug Reports (https://www.esoui.com/forums/forumdisplay.php?f=187)
-   -   [open] Guilds: Number of members is displayed/returned incorrectly (https://www.esoui.com/forums/showthread.php?t=9490)

@DeadSoon 12/02/20 04:25 AM

[open] Guilds: Number of members is displayed/returned incorrectly
 
Hello,

for some reasons the number of active members (guild size) is returned incorrectly for smaller guilds (of which I am not a member). For larger guilds it is returned correctly and accurate but for guilds that have only 1-20? members it just returns 0 all the time. I access the data on the following way:

Lua Code:
  1. GUILD_BROWSER_MANAGER:RequestGuildData(guildId)
  2.  
  3. -- some delay.... I know the data is not available instantly
  4.  
  5. local guildData = GUILD_BROWSER_MANAGER:GetGuildData(guildId)
  6. d(guildData.size)  -- accurate number for a big guild but stays 0 for a small guild

Of course, the number is returned correctly if Im a member of the guild -> the bug appears only when viewing other guilds. Furthermore, the number is always the same as displayed in the guild information. I supose I access the data the same way the game itself does. Therefore, the bug is also present e.g. when you open a guild chat link of a small guild.
  1. Is there any mistake in my approach or exists another way to access the size of a guild I am not a member of?
  2. Is there a intentional minimum size limit in order to prevent the server from calculating the size for all the smaller guilds!?
  3. Or is it just a bug, what I think? :p

Thanks in advance

Baertram 12/02/20 07:04 AM

I'd register a callback function to this event to start your code as the guilddata is ready:
https://github.com/esoui/esoui/blob/...shared.lua#L35

Lua Code:
  1. local function OnGuildDataReady(guildId)
  2. ...
  3. end
  4.  
  5. GUILD_BROWSER_MANAGER:RegisterCallback("OnGuildDataReady", OnGuildDataReady)

This is how the ZOs code does it.

Create your own callback register and use e.g. anoher local function MyOnGuildDataReady, and in there do your checks on the guilddata. This should strip your "wait some time" code as it shouldl fire as your requested guildData IS ready.

Maybe this will already fix he 0 issue then.

btw: Did you check the guildId is correct and given? Maybe it is 0 itsself and thus the function returns 0 ?


Guild size data:
https://github.com/esoui/esoui/blob/...nager.lua#L199
Maybe this helps and returns another value (which would make me wonder) GetGuildSizeAttribute(guildId)

@DeadSoon 12/03/20 03:21 PM

Thank you Baertram for your helpful hints.

Unfortunately, this does not solve the 0 problem. Your code and also GetGuildSizeAttribute(guildId) works the same way as expected and returns 0 for smaller guilds.

Here is just one example: This guild on NA server is currently small. If you can reach it somehow to get the number of the member without joining the guild. Please let me know:

|H1:guild:738317|hKBMU|h

However, thanks for considering and best regards


All times are GMT -6. The time now is 05:45 PM.

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