Call as
addon.Platform:GetRosterClassObservation(unit)
Available directly through addon; no dependency is needed.
What it does
Read public roster identity on identified client families. Input routing is limited to player, party1 through party4 and raid1 through raid40. Call UnitExists with that exact one-argument token first; known false returns false without querying class. For a present unit, consume only UnitClass return two as a readable nonempty class filename string, without a class enum restriction. Missing, failed, malformed or restricted required facts return nil with a reason.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | Exact helper-owned player, party1..party4 or raid1..raid40 token. |
Returns
| 1 | string | boolean | nil | Observed class filename string, false for a known absent unit, or nil when unavailable. |
|---|---|---|
| 2 | string | nil | Validation, policy or availability reason for a nil result. |
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 API | |||||
|---|---|---|---|---|---|
UnitClass | |||||
UnitExists | |||||
canaccessvalue |
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
for index = 1, 4 do
local class = addon.Platform:GetRosterClassObservation("party" .. index)
if class == "PRIEST" then return true end
end
return falseDependencies
rosterUnit→Platform.roster_class.rosterUnit
Source
Platform/roster_class.lua, line 29. Read only in game; Duplicate makes an editable copy.
Platform.roster_class.GetRosterClassObservation(self, unit)
if not self:CanReadValue(unit) then return nil,'restricted-value' end
if type(unit)~='string' or not rosterUnit(unit) then return nil,'invalid-roster-unit' end
if self:GetClientFamily()=='unknown' then return nil,'unsupported-client' end
if type(UnitExists)~='function' then return nil,'missing-api' end
local ok,exists=pcall(UnitExists,unit)
if not ok then return nil,'api-error' end
if not self:CanReadValue(exists) then return nil,'restricted-value' end
if exists==nil then return nil,'roster-data-unavailable' end
if type(exists)~='boolean' then return nil,'invalid-api-result' end
if not exists then return false end
if type(UnitClass)~='function' then return nil,'missing-api' end
local success,_,class=pcall(UnitClass,unit)
if not success then return nil,'api-error' end
if not self:CanReadValue(class) then return nil,'restricted-value' end
if canaccessvalue and not canaccessvalue(class) then return nil,'restricted-value' end
if class==nil then return nil,'roster-class-unavailable' end
if type(class)~='string' or class=='' then return nil,'invalid-api-result' end
return class




