Skip to content

Return of Reckoning

Wiki

RoR Wiki

API:GetDatabaseGuildData

From RoR Wiki

UI Lua API · Guild functions
Version: WAR 1.4.8

Returns the stored profile of a guild, looked up by guild id.

guildData = GetDatabaseGuildData(guildId)

Arguments

guildId
number – Guild id, for example the id from a GUILD: chat hyperlink.

Returns

guildData
table – The guild's profile, or nothing if the client has no profile for that id. The table has the same fields as the one returned by GuildRecruitmentProfileGetData.

Details

  • If guildId is the player's own guild, the client's own guild record is used. Otherwise the id is looked up in the client's store of guild profiles. The function does not ask the server.
  • Always test the result for nil, as the stock UI does.

Errors

None besides the generic Invalid Parameters message when the argument is missing or not a number.

Example

From default/ea_chatwindow/source/chathyperlinking.lua:

function EA_ChatWindow.OnGuildLinkLButtonUp( guildId, flags, x, y )
    if( flags == SystemData.ButtonFlags.SHIFT )
    then
        local guildData = GetDatabaseGuildData( guildId )
        if( not guildData )
        then
            return
        end
        EA_ChatWindow.InsertGuildLink( guildData )
        return
    end
    ...

See also