Support persistent residents with normal resurrection and closer companions
Core tests / core (push) Successful in 2m54s

This commit is contained in:
Codex
2026-09-24 05:33:45 +12:00
parent 0731774457
commit 64e2796a74
11 changed files with 85 additions and 16 deletions
+8
View File
@@ -20,10 +20,12 @@ function player(guid,name,account,level,dead)
players[name]=p; return p
end
function AuthDBQuery(sql)
if string.find(sql,"azerothai_realm_rules",1,true) then return {GetUInt32=function()return mode or 1 end} end
if string.find(sql,'SELECT id FROM account',1,true) then
if string.find(sql,'id=99 ',1,true) then return nil end
return {GetUInt32=function() return 2 end}
end
if string.find(sql,"SELECT guid,name,account_id FROM azerothai_lifecycle WHERE state='dead'",1,true) then return nil end
local q={i=1}
function q:GetUInt32(n) return rows[self.i][n+1] end
function q:GetString(n) return rows[self.i][n+1] end
@@ -131,3 +133,9 @@ assert(entries==2,'Death Knights must be audited at level 55')
events[8](8,nil,players.HordeDK);tick();assert(not players.HordeDK and deaths==1)
""")
print('PASS: retirement, protection, level-1 entry, replay safety, and 25/25 faction balancing')
normal=LuaRuntime();normal.execute(setup)
normal.execute("mode=0;players={};rows={};for i=1,25 do rows[#rows+1]={100+i,'Resident'..i,2,0,'active',2};player(100+i,'Resident'..i,2,5,i==1) end;rows[#rows+1]={200,'Reserve',2,0,'reserve',2};player(200,'Reserve',2,1,false)")
normal.execute((Path(__file__).parents[1]/'ale/azerothai_lifecycle.lua').read_text())
normal.execute("events[8](8,nil,players.Resident1);tick();assert(players.Resident1 and deaths==0);assert(not players.Reserve,'Recoverable death must retain its population slot');local n=0;for _ in pairs(players)do n=n+1 end;assert(n==25)")
print('Normal resurrection mode preserves identity and reserves the dead resident population slot')