Reference › Function reference › Platform

Platform.glyphs.GetGlyphSocketSnapshot

public

Call as

addon.Platform:GetGlyphSocketSnapshot()

Available directly through addon; no dependency is needed.

What it does

Observe glyph sockets on verified Wrath, Cata and Mists client layouts. Returns slots and a complete flag. Each slot has active=false when known locked or empty, active=true plus spellID when occupied, or nil active plus reason when unavailable. Unknown layouts and failed count queries return nil with a reason. This does not compare item names or prove exact item-to-spell identity.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).

Returns

1table | nilNormalized bounded socket snapshot with slots and complete, or nil when the query is unavailable.
2string | nilPolicy, validation or availability reason for a nil snapshot.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
GetGlyphSocketInfoClassic EraTBC AnniversaryClassic progressionForeverRetail
GetNumGlyphSocketsClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

Example

local snapshot = addon.Platform:GetGlyphSocketSnapshot()
if not snapshot then return nil end
for _, slot in ipairs(snapshot.slots) do
  if slot.active and slot.spellID == value.spell then return true end
end
if not snapshot.complete then return nil end
return false

Dependencies

Source

Platform/glyphs.lua, line 97. Read only in game; Duplicate makes an editable copy.

Platform.glyphs.GetGlyphSocketSnapshot(self)
    local position=layout(self:GetClientInfo())
    if not position then return nil,'unsupported-glyph-layout' end
    if type(GetNumGlyphSockets)~='function' then return nil,'missing-api' end
    local ok,count=pcall(GetNumGlyphSockets)
    if not ok then return nil,'api-error' end
    if not self:CanReadValue(count) then return nil,'restricted-value' end
    if count==nil then return nil,'glyph-data-unavailable' end
    if not integer(count,0) or count>64 then return nil,'invalid-api-result' end
    local fn=GetGlyphSocketInfo
    if count>0 and type(fn)~='function' then return nil,'missing-api' end
    local result={slots={},complete=true}
    for index=1,count do
        local record=socket(self,fn,index,position)
        result.slots[index]=record
        if record.active==nil then result.complete=false end
    end
    return result

Back to Function reference