Reconcile delayed hardcore deaths with native population registry

This commit is contained in:
Codex
2026-09-22 18:15:35 -04:00
parent 46935c791e
commit 8e96c7ff47
3 changed files with 41 additions and 0 deletions
+12
View File
@@ -9,6 +9,7 @@ local TARGET_PER_FACTION = 25
local gates = {}
local gateAt = {}
local arrivals = {}
local reconciledAt = 0
local alliance = {[1]=true,[3]=true,[4]=true,[7]=true,[11]=true}
local horde = {[2]=true,[5]=true,[6]=true,[8]=true,[10]=true}
local function faction(row)
@@ -77,6 +78,17 @@ end
local function enforce()
if not ready then reload() end
-- The dashboard may receive a verified death from an older transport backlog
-- after this process seeded its registry. Import terminal states only; never
-- overwrite a locally observed death with an older active database row.
if os.time()-reconciledAt>=10 then
local q=AuthDBQuery("SELECT guid,name,account_id FROM azerothai_lifecycle WHERE state='dead' AND protected=0 AND LOWER(name)<>'zaku'")
if q then repeat
local row=residents[q:GetUInt32(0)]
if row and not row.protected and row.name==q:GetString(1) and row.account==q:GetUInt32(2) then row.state="dead" end
until not q:NextRow() end
reconciledAt=os.time()
end
local mgr=GetRandomPlayerbotMgr()
-- Disallow every retired identity before the native manager fills vacancies.
for guid,row in pairs(residents) do