Inter-Guild Link API Methods
The IGLInterop object provides five public methods but only three of them are part of the API; the remaining methods are used internally by Inter-Guild Link and should never be called by other AddOns. The public API methods include:
  • boolean IGLInterop.IsShowingGuildNamesInChat(nil);
    Indicates whether the player has chosen to display guild names in all chat messages that originate from allied guilds. When this method returns false, other AddOns should display all allied guild chat messages and event notices as if they originated within the local guild. When this method returns true, other AddOns should indicate to the user from which allied guild the chat message or event notice originates.
  • nil IGLInterop.RegisterAllyChatMessageFilter(string AddOnPrefix, string ChatTypeIdentifier, handle FunctionReference);
    Adds a call-back function to the set of registered listeners for a particular chat type so that external AddOns can block Inter-Guild Link from displaying chat messages from allied guilds that the other external AddOns are handling. The parameters include:
    • AddOnPrefix=(string) Short identifier of the external AddOn to register
    • ChatTypeIdentifier= (string) One of:
      • IGLAPIConstants.WOW_CHATTYPE_GUILD or "GUILD" for general guild chat
      • IGLAPIConstants.WOW_CHATTYPE_OFFICER or "OFFICER" for guild officer chat
    • FunctionReference=(handle) Global handle to the function to call for every occurance of the registered chat event; or nil to remove the listener
  • nil IGLInterop.RegisterAllyEventListener(string AddOnPrefix, [string EventIdentifier | table EventIdentifierSet], handle FunctionReference);
    Adds a call-back function from another AddOn to the set of registered listeners for a particular event type so that external AddOns can respond to remote ally guild events as if they originated from the local guild. This method has two forms. You can use it to register a single EventIdentifier value to a single FunctionReference or you can use it to register an array of EventIdentifier values to a single FunctionReference. The parameters include:
    • AddOnPrefix=(string) Short identifier of the external AddOn to register
    • EventIdentifier OR EventIdentifierSet, as:
      • EventIdentifier=(string) One of:
        • IGLAPIConstants.WOW_EVENT_CALENDAR_UPDATE_EVENT_LIST or "CALENDAR_UPDATE_EVENT_LIST" to receive notice of whenever an allied guild calendar event has been changed
        • IGLAPIConstants.WOW_EVENT_CHAT_MSG_ADDON or "CHAT_MSG_ADDON" to receive notice of whenever an allied guild member transmits other AddOn data
        • IGLAPIConstants.WOW_EVENT_CHAT_MSG_GUILD or "CHAT_MSG_GUILD" to recieve notice of whenever an allied guild member sends a general guild chat message (this is a notice only; use RegisterAllyChatMessageFilter() to filter such messages)
        • IGLAPIConstants.WOW_EVENT_CHAT_MSG_GUILD_ACHIEVEMENT or "CHAT_MSG_GUILD_ACHIEVEMENT" to receive notice of whenever an allied guild or guild member has earned an Achievement
        • IGLAPIConstants.WOW_EVENT_CHAT_MSG_OFFICER or "CHAT_MSG_OFFICER" to recieve notice of whenever an allied guild member sends a guild officer chat message (this is a notice only; use RegisterAllyChatMessageFilter() to filter such messages)
        • IGLAPIConstants.WOW_EVENT_GUILD_MOTD or "GUILD_MOTD" to receive notice of whenever an allied guild has posted a new Message of the Day
        • IGLAPIConstants.WOW_EVENT_GUILD_ROSTER_UPDATE or "GUILD_ROSTER_UPDATE" to receive notice of whenever an allied guild member is updated in the guild roster
        • IGLAPIConstants.WOW_EVENT_TRADE_SKILL_UPDATE or "TRADE_SKILL_UPDATE" to recieve notice of whenever an allied guild member's Trade Skill (Profession) table has changed
      • EventIdentifierSet=(table) An array of several EventIdentifier values, all of which are to be registered along with a single call-back function reference (FunctionReference)
    • FunctionReference=(handle) Global handle to the function to call for every occurance of the registered event; or nil to remove the listener

Your Call-Back Functions
The call-back functions that you create should be based on these templates:
  • boolean FilterAllied[Guild|Officer]ChatMessage(string ChatTypeIdentifier, string GuildName, string SenderName, string ChatMessage, string EventTarget, string AwayType, string SenderGUId);
    You can choose to handle message filtering with a single handler function OR you can supply a dedicated message filtering handler for each available ChatTypeIdentifier value. A return value of true will cause Inter-Guild Link to silently ignore the chat message event. Other call-back functions that are also registered with IGLInterop.RegisterAllyChatMessageFilter() for the given ChatTypeIdentifier will also be called, whether or not you suppress the message. However, listeners registered with IGLInterop.RegisterAllyEventListener() will not be notified of the chat message event if any call-back function returns true here. For every allied guild chat message, the call-back function will receive the following arguments:
    • ChatTypeIdentifier=(string) The chat channel to which the message was sent; will be one of:
      • IGLAPIConstants.WOW_CHATTYPE_GUILD for general guild chat
      • IGLAPIConstants.WOW_CHATTYPE_OFFICER for guild officer chat
    • GuildName=(string) Name of the allied guild from which the chat message originates
    • SenderName=(string) Name of the guild member who sent the message
    • ChatMessage=(string) The entire chat message that awaits display
    • EventTarget=(string) Name of the character that is targeted by the event
    • AwayType=(string) User status (AFK/DND/AWAY) if away
    • SenderGUId=(string) System-assigned GUId of the sending use
  • nil HandleAlliedEvents(string EventIdentifier, string GuildName, table ...); OR nil OnAllied[EventId]_Event(string EventIdentifier, string GuildName, table ...);
    You can choose to either direct all event notices to a single handler function OR you can supply a dedicated event handler for each available EventIdentifier value (or any combination of the two). Note that allied guild and/or allied officer chat events will not be received if any call-back functions suppress the message(s) because filtering occurs before event notification. The arguments that will be provided to the call-back function vary based on the EventIdentifier value and are documented on the Inter-Guild Link API Constants page, though every such call will always receive the following arguments as the first two:
    • EventIdentifier=(string) Will be one of the WOW_EVENT_* constants found in IGLAPIConstants
    • GuildName=(string) Name of the allied guild from which this event originates

Caveats
Inter-Guild Link filters messages that fit certain patterns which include allied guild names so that relayed messages aren't duplicated on-screen. Because of this, you should take care when appending allied guild names (when IGLInterop.IsShowingGuildNamesInChat() returns true) to your own messages for display, else your messages will become filtered. To ensure that your message is not filtered by Inter-Guild Link, do not use the following patterns:
  • "<%s> %s", like: "<GuildName> Message"
  • "[%s-%s]: %s", like: "[PlayerName-GuildName]: Message"
 
Stats
Files: 0
Downloads: 0
Favorites: 0

Menu
» Home



Content

New & Updated


WOWInterface