Call as
addon.Platform:GetUnitPresenceObservation(unit)
Available directly through addon; no dependency is needed.
What it does
Observe unit presence on identified client families. Pass the selected unit unchanged to one protected UnitExists call. Preserve readable true and false; missing, failed, restricted, nil or malformed required observations return nil with a reason. No identity, visibility, range or combat-state query is added.
Arguments
| Name | Type | What it does |
|---|---|---|
self | RMPlatform | Rotation Master platform adapter (implicit with colon calls). |
unit | string | Readable nonempty unit token, passed unchanged as the single native argument. |
Returns
| 1 | boolean | nil | Known unit presence or absence; nil when the required observation is unavailable. |
|---|---|---|
| 2 | string | nil | Client-family, query-validation or required-observation 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 | |||||
|---|---|---|---|---|---|
UnitExists |
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 present = addon.Platform:GetUnitPresenceObservation("focus")
if present == nil then return nil end
return not presentSource
Platform/unit_presence.lua, line 65. Read only in game; Duplicate makes an editable copy.
Platform.unit_presence.GetUnitPresenceObservation(self, unit)
if not self:CanReadValue(unit) then return nil,'restricted-value' end
if type(unit)~='string' or unit=='' then return nil,'invalid-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,'unit-data-unavailable' end
if type(exists)~='boolean' then return nil,'invalid-api-result' end
return exists




