Commit Graph

1 Commits

Author SHA1 Message Date
florian.berthold b6d42dfe5d Add OmenSync: addon-channel fallback for Vol'jin party threat
The CoA Vol'jin core does not push UnitDetailedThreatSituation data
for party-member units, so vanilla Omen draws only the local
player's bar in 5-mans. The same install on Bronzebeard/classic+
shows the whole party because that core does push the data. The gap
is server-side, not client-side, and there is no Omen flag that
fixes it.

OmenSync layers a tiny SendAddonMessage("OMSYNC", …, "PARTY"|"RAID")
relay on top:
- Each player's Omen broadcasts its own player+pet threat values
  (throttled, ~0.4s + 5% delta) every time updatethreat() succeeds
  via the API path.
- Receivers store incoming values keyed by senderGUID/mobGUID and
  serve them as a fallback in updatethreat() whenever
  UnitDetailedThreatSituation returns nil.

When the API does push data (Bronzebeard) the existing path still
wins; sync values are simply unused, so this is a no-op on healthy
realms. Both peers must run a fork that emits the OMSYNC prefix.

Wire format keeps each message under the 255-byte AddonMessage cap:
    <subjectGUID>|<mobGUID>|<threatValue>|<isTanking 0|1>
Sender's name comes from CHAT_MSG_ADDON's sender arg. Subject GUID
distinguishes the player and pet broadcasts each Omen instance
emits.

Hook in Omen.lua's local updatethreat():
- After UnitDetailedThreatSituation returns nil for any unit, try
  Omen:SyncGetThreat(guid, mobGUID).
- After it returns a value for "player" or "pet", call
  Omen:SyncBroadcastThreat to relay it to peers.
2026-05-08 23:40:17 +02:00