Files
praxisandClaude Fable 5.2 cf9ad2ff3c Client interface: addons, login-screen adapters and launcher
66 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

60 lines
3.7 KiB
Lua

-- Optional owned-test-copy diagnostic. No requests at addon load/login, no
-- item use, equips, grants, state mutation or item/spell API replacement.
local active=false
local function public(v)return type(issecretvalue)~="function" or not issecretvalue(v)end
function GWStartReadOnlyItemBatchProbe(nonce)
if active or not public(nonce)or type(nonce)~="string"or not nonce:match("^[0-9a-f]+$")or #nonce>32 then return false end
local data=GWReadOnlyItemBatchData
if type(data)~="table"or type(data.items)~="table"or #data.items<1 or #data.items>10000 or type(C_Timer)~="table"or type(C_Timer.After)~="function"then return false end
if type(C_Item)~="table"or type(C_Item.GetItemInfo)~="function"or type(C_Item.GetItemInfoInstant)~="function"or type(C_Item.RequestLoadItemDataByID)~="function"then return false end
local get,instant,request=C_Item.GetItemInfo,C_Item.GetItemInfoInstant,C_Item.RequestLoadItemDataByID
local result={run=nonce,planned=#data.items,requested=0,checked=0,passed=0,errors=0,mismatches={},complete=false,phase="request",profile=data.profile}
GatewayDiagnosticsSaved=GatewayDiagnosticsSaved or {}
GatewayDiagnosticsSaved.itemBatchProbe=result
active=true
local at,attempt,retries=1,0,0
local first,last=1,math.min(#data.items,96)
result.windowSize=96
local function check(row)
local n,_,quality=get(row.id)
local id,_,_,_,nativeIcon,class,subclass=instant(row.id)
if not public(n)or not public(quality)or not public(id)or not public(class)or not public(subclass)then return nil,"secret metadata"end
if n==nil or n==""then return nil,"not cached"end
if row.icon~=nil and not public(nativeIcon)then return nil,"secret icon"end
if n~=row.name or id~=row.id or class~=row.class or subclass~=row.subclass or quality~=row.quality or row.icon~=nil and nativeIcon~=row.icon then
local mismatch={id=row.id,name=n,class=class,subclass=subclass,quality=quality}
if row.icon~=nil then mismatch.icon=nativeIcon end
return false,mismatch
end
return true
end
local step
step=function()
local ok=pcall(function()
if C_Item.GetItemInfo~=get or C_Item.GetItemInfoInstant~=instant or C_Item.RequestLoadItemDataByID~=request then error("Original item API changed")end
for _=1,8 do
local row=data.items[at]
if not row or at>last then
if result.phase=="request"then result.phase="check";at=first;C_Timer.After(0.3,step);return end
if last==#data.items then result.complete=true;result.phase="complete";active=false;return end
first=last+1;last=math.min(#data.items,first+95);at=first
result.phase="request";C_Timer.After(0.03,step);return
end
if result.phase=="request"then request(row.id);result.requested=result.requested+1
else
local matched,reason=check(row)
if matched==nil and attempt<40 and retries<200 then attempt=attempt+1;retries=retries+1;result.retries=retries;C_Timer.After(0.1,step);return end
result.checked=result.checked+1
if matched then result.passed=result.passed+1
else result.mismatches[#result.mismatches+1]=type(reason)=="table"and reason or{id=row.id,reason=reason}end
end
at=at+1;attempt=0
end
C_Timer.After(0.05,step)
end)
if not ok then result.errors=result.errors+1;result.phase="failed";result.complete=true;active=false end
end
C_Timer.After(0,step)
return true
end