Files
bdot1andClaude Opus 5.5 f679318d70 v1.15.0: drag and drop only - everything ships with WhoDidIt, no CMD for players
Holybunny tested it: players had to run CMD files to get half the addon,
the "not downloaded yet" prompt sent them to the sync helper (which then
read 2,929 raid logs for ~50 minutes), and the built-in Chronicle logger
started logging for someone who had switched ChronicleCompanion off.

- Chronicle\, RollFor\ and DopingControl\ now ship in the repository at
  their pinned commits, each with a WDI_NOTICE.txt crediting its authors
  (DopingControl keeps its MIT LICENSE; ChronicleCompanion and RollFor
  state no licence: not under WhoDidIt's MIT licence, removed on request).
  The maintainer's decision.
- the built-in Chronicle logger logs nothing until the player says yes
  (asked the first time they enter a raid, or Start logging); until then
  its auto-logging is off. If the separate ChronicleCompanion is installed
  but switched off, the built-in copy stays off too.
- no player is told to run a CMD any more: missing parts say "download
  WhoDidIt again"; raid times aren't counted as missing (they come from the
  master feed); the Rankings bar shows the feed for players, and Sync now /
  helper states only for the master's characters
- the sync helper and AutoSync are maintainer-only: they check the WTF
  folder for a B.MASTERS character and otherwise explain and stop (-Force
  overrides; AutoSync-Off works for anyone). The helper no longer installs
  addons; EmbedUpdate.ps1 is the maintainer tool for moving pins.
- README (install = drag and drop), CLAUDE.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 00:00:04 +01:00

80 lines
3.3 KiB
Lua

if WDI_DOPING_SKIP then return end -- DopingControl scan/reach.lua
-- Unit readability probe: online FALLBACK via UnitIsConnected, distance via
-- UnitXP_SP3 "distanceBetween". Distance is DIAGNOSTIC ONLY -- it is written
-- into the store but NEVER used as a filter (readability is
-- decided from the read RESULT, not from a range assumption).
--
-- ONLINE IS A FALLBACK ONLY (measured
-- in-game): the raid roster online flag (GetRaidRosterInfo return 8) is
-- SERVER TRUTH and wins in scan/engine.lua scanOne -- UnitIsConnected can
-- read nil mid-zoning while the player is actually online (false-offline
-- bug). The reach online result is only consulted for roster entries
-- WITHOUT a roster flag (the party path).
--
-- Pure Lua 5.0, dofile-loadable offline: the WoW calls live in ReadUnit,
-- which is only invoked in-game; Normalize is pure and offline-tested.
DopingControl = DopingControl or {}
local DC = DopingControl
DC_Reach = DC_Reach or {}
local R = DC_Reach
-- ------------------------------------------------------------------
-- Normalize(haveOnline, onlineRaw, distOk, distVal) -> online, distance
-- haveOnline : bool -- UnitIsConnected existed AND its pcall succeeded.
-- UnitIsConnected returns 1/nil, where nil is read
-- as offline -- BUT it can also read nil mid-zoning
-- while the player is online (measured in-game),
-- which is why the engine only uses this value as a
-- fallback when there is no roster online flag.
-- onlineRaw : raw UnitIsConnected return (1/nil/false)
-- distOk : pcall success of UnitXP("distanceBetween", ...)
-- distVal : its first return
-- Returns:
-- online : true|false|nil -- nil = could not determine; the caller
-- (engine scanOne) consults this at all
-- only for entries without a roster flag
-- distance : number|nil -- nil = not measurable (no UnitXP_SP3, or
-- the call failed / returned a non-number)
-- ------------------------------------------------------------------
function R.Normalize(haveOnline, onlineRaw, distOk, distVal)
local online = nil
if haveOnline then
if onlineRaw then
online = true
else
online = false
end
end
local distance = nil
if distOk and type(distVal) == "number" then
distance = distVal
end
return online, distance
end
-- ------------------------------------------------------------------
-- ReadUnit(unit) -> online, distance (WoW runtime only)
-- Every foreign-unit call is pcall-wrapped (hard rule).
-- Missing UnitXP_SP3 only drops the diagnostic distance
-- -- the online read runs regardless.
-- ------------------------------------------------------------------
function R.ReadUnit(unit)
local haveOnline = false
local onlineRaw = nil
if UnitIsConnected then
local ok, v = pcall(UnitIsConnected, unit)
if ok then
haveOnline = true
onlineRaw = v
end
end
local distOk = false
local distVal = nil
if UnitXP then
distOk, distVal = pcall(UnitXP, "distanceBetween", "player", unit)
end
return R.Normalize(haveOnline, onlineRaw, distOk, distVal)
end