Reconcile dashboard online presence against complete live roster
This commit is contained in:
@@ -47,6 +47,11 @@ local function json_value(value)
|
||||
if value == nil then return "null" end
|
||||
if t == "boolean" then return value and "true" or "false" end
|
||||
if t == "number" then return tostring(value) end
|
||||
if t == "table" then
|
||||
local parts={}
|
||||
for _,item in ipairs(value) do parts[#parts+1]=json_value(item) end
|
||||
return "["..table.concat(parts,",").."]"
|
||||
end
|
||||
return '"' .. escape_json(value) .. '"'
|
||||
end
|
||||
|
||||
@@ -187,12 +192,16 @@ function AzerothAIEmitSnapshots()
|
||||
local ok,players=pcall(function() return GetPlayersInWorld() end)
|
||||
if not ok or type(players)~="table" then return 0 end
|
||||
local emitted=0
|
||||
local guids={}
|
||||
for _,player in pairs(players) do
|
||||
if is_playerbot(player) then
|
||||
emit("player.snapshot",player_payload(player))
|
||||
guids[#guids+1]=player:GetGUIDLow()
|
||||
emitted=emitted+1
|
||||
end
|
||||
end
|
||||
-- Use snapshot transport so roster reconciliation shares fresh-event priority.
|
||||
emit("player.snapshot",{roster=true,observedAt=os.time(),characterGuids=guids})
|
||||
return emitted
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user