feat: TruePVE in the zone step (PLAN_REDESIGNS §14.3.2, WIP)
Stage 3 of the §14.3 integration plan (D362, D368): world.zone's optional
truePve ({exclude: true} or {ruleset}), all or nothing, unmapped on every
path that erases one of our zones, with truepve.json for erases while
TruePVE is away. Docs and PRs still to come.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -99,15 +99,17 @@ async function deletePreset(id) {
|
||||
|
||||
/**
|
||||
* Each configured server, in the operator's order, with what its last hello said
|
||||
* about ZoneManager (`{ version, flags }`) and ZoneDomes (`{ loaded, version,
|
||||
* helper, ready }`). Either is null for a server that never said: no ZoneManager,
|
||||
* a plugin before protocol 13, or a server never reached.
|
||||
* about ZoneManager (`{ version, flags }`), ZoneDomes (`{ loaded, version,
|
||||
* helper, ready }`) and TruePVE (`{ loaded, version }`). Each is null for a server
|
||||
* that never said: no ZoneManager, a plugin before protocol 13 (14 for TruePVE), or
|
||||
* a server never reached.
|
||||
*/
|
||||
async function listZoneServers() {
|
||||
const rows = await core.query(
|
||||
`SELECT s.id, s.name, s.enabled,
|
||||
JSON_EXTRACT(st.raw, '$.zoneManager') AS zoneManager,
|
||||
JSON_EXTRACT(st.raw, '$.integrations.zoneDomes') AS zoneDomes
|
||||
JSON_EXTRACT(st.raw, '$.integrations.zoneDomes') AS zoneDomes,
|
||||
JSON_EXTRACT(st.raw, '$.integrations.truePve') AS truePve
|
||||
FROM ${SERVERS} s
|
||||
LEFT JOIN ${STATE} st ON st.server_id = s.id
|
||||
ORDER BY s.sort_order ASC, s.id ASC`,
|
||||
@@ -115,6 +117,7 @@ async function listZoneServers() {
|
||||
return rows.map((r) => {
|
||||
const zm = json(r.zoneManager, null)
|
||||
const zd = json(r.zoneDomes, null)
|
||||
const tp = json(r.truePve, null)
|
||||
return {
|
||||
id: r.id,
|
||||
name: r.name,
|
||||
@@ -135,6 +138,9 @@ async function listZoneServers() {
|
||||
ready: zd.ready === true,
|
||||
}
|
||||
: null,
|
||||
// Protocol 14 (PLAN_REDESIGNS §14.3.2): null from a plugin older than TruePVE's support.
|
||||
truePve:
|
||||
tp && typeof tp === 'object' ? { loaded: tp.loaded === true, version: typeof tp.version === 'string' ? tp.version : null } : null,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ async function optionRows() {
|
||||
}))
|
||||
}
|
||||
|
||||
/** What one server's last hello said about ZoneManager and ZoneDomes, or null. */
|
||||
/** What one server's last hello said about ZoneManager, ZoneDomes and TruePVE, or null. */
|
||||
async function serverZoneMods(serverId) {
|
||||
return (await db.listZoneServers()).find((s) => s.id === serverId) || null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user