WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Guild Permissions (https://www.wowinterface.com/forums/showthread.php?t=57344)

Aeriez 08-10-19 10:17 PM

Guild Permissions
 
I've already written a script to get guild permissions with regards to Officer Notes. However, I've run into a bit of a snag on the login process. It appears my addon loads considerably before any guild information is retrieved and it errors out. What's the best way to go about waiting until guild information is received? Listening for GUILD_ROSTER_UPDATE doesn't seem to do the trick

Kanegasi 08-10-19 10:34 PM

Guild roster information is not available at a consistent time during loading or even after the game finishes loading. You have to force load the info using GuildRoster() as early as possible.

Yukyuk 08-11-19 01:06 AM

Im my addon I use GUILD ROSTER UPDATE.
While testing I noticed its fires two times during the loading process but the first time the guild infornation is sometimes not available.

This is the code I use:
Code:

                elseif event == "GUILD_ROSTER_UPDATE" then
                        --print("GUILD_ROSTER_UPDATE")       
                        GuildInfo()                       
                        if IsInGuild() then
                                GildamDB[cfg.REALM_NAME][cfg.PLAYER_NAME].Guild.name = GetGuildInfo("player")
                                Gildam_Roster()
                        end       
                end


SDPhantom 08-11-19 05:35 AM

GUILD_ROSTER_UPDATE fires with a flag signalling true if C_GuildInfo.GuildRoster() should be called and false when data has arrived.


All times are GMT -6. The time now is 05:53 AM.

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