feat(rust): RaidableBases — feed, raids map layer, Warlord, Spawn a raid base, profiles (PLAN_REDESIGNS §11.4)
PLAN_REDESIGNS §11.4 (D202-D208, D386-D391), protocol 14. Spec: docs rust-link/PROTOCOL.md §20.12. - raid.started, raid.completed, raid.purchased and raid.locked public, raid.ended staff's; raidableBases.js reads each row per viewer (raiders' and a buyer's names only for the presence audience, D376/D390; Steam ids, position and a run's key only for staff). Feed lines in the World filter. - The step rust.raidbase.spawn, "Spawn a raid base" (ledgered, budget rust.raids): difficulty, profile and base from option sources listing each server's own names (D386), a spot as a world call's location with a height adjustment or an exact height, and PvP/NPCs/lock as on/off/blank. A base the raids helper made is a world resource, so eventWorld's revert and reconcile serve it and world.expired marks it expired; one it did not make records nothing and the run log says it despawns on its own timer. Refused at verify for a server that said it cannot; a dry run with a spot returns the spot check as detail.warnings (MODULE_API 1.16.0, D391). rb-not-ready retries in ten minutes. - Warlord: raids_completed, title category raidscompleted, the leaderboard's Raid bases column (sort=raidsCompleted). - The map's raids layer (D114), public by default with its own audience; the run's key is dropped before any viewer gets it. - Server settings' line for RaidableBases; its profiles in Mod configuration under a virtual path (D205). - Swagger fragment, bundle and README. Tests: server 684/684 (raidableBases.test.js new, every name in it invented); client 99/99, build and externals. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -15,8 +15,9 @@
|
||||
// players who is on the server and where, and the sleepers
|
||||
// bases tool cupboards and player vending machines, as positions only
|
||||
// pvp Dynamic PVP's own PvP zones, where they are now (protocol 14)
|
||||
// raids RaidableBases' live bases, and which a run made (protocol 14)
|
||||
//
|
||||
// Defaults: world, events and pvp public; players and bases staff. The audiences are the
|
||||
// Defaults: world, events, pvp and raids public; players and bases staff. The audiences are the
|
||||
// presence rungs (`staff` · `signed_in` · `public`) and follow its asymmetric
|
||||
// fallbacks: an unknown stored word narrows to staff, an unknown viewer is
|
||||
// public (`model/visibility`).
|
||||
@@ -45,9 +46,11 @@ const log = core.logger('map')
|
||||
|
||||
// `pvp` (protocol 14, PLAN_REDESIGNS §14.3.3) is Dynamic PVP's own zones, public by
|
||||
// default: the game draws them for everyone near one, and they name nobody.
|
||||
const LAYERS = Object.freeze(['world', 'events', 'players', 'bases', 'pvp'])
|
||||
// `raids` (protocol 14, PLAN_REDESIGNS §11.4, D114) is RaidableBases' live bases, public
|
||||
// by default: the plugin marks them on the game's own map for everyone, and they name nobody.
|
||||
const LAYERS = Object.freeze(['world', 'events', 'players', 'bases', 'pvp', 'raids'])
|
||||
|
||||
const DEFAULTS = Object.freeze({ world: 'public', events: 'public', players: 'staff', bases: 'staff', pvp: 'public' })
|
||||
const DEFAULTS = Object.freeze({ world: 'public', events: 'public', players: 'staff', bases: 'staff', pvp: 'public', raids: 'public' })
|
||||
|
||||
/** D118: on, because it shows a member nothing the game does not already show them. */
|
||||
const DEFAULT_MATES = true
|
||||
@@ -304,6 +307,13 @@ async function mateIdsFor(serverId, acc) {
|
||||
return { own, mates: new Set(clan.filter((id) => !own.has(id))) }
|
||||
}
|
||||
|
||||
/** A raids row without the run's idempotency key, which only the bridge's own bookkeeping needs. */
|
||||
function withoutKey(row) {
|
||||
if (!row || typeof row !== 'object' || !('key' in row)) return row
|
||||
const { key, ...rest } = row
|
||||
return rest
|
||||
}
|
||||
|
||||
/** An events row without the health a boss's carries. */
|
||||
function withoutHealth(row) {
|
||||
if (!row || typeof row !== 'object' || !('health' in row)) return row
|
||||
@@ -334,6 +344,8 @@ function project(live, acc, ids = { own: new Set(), mates: new Set() }) {
|
||||
}
|
||||
// Dynamic PVP's zones (§14.3.3): an older plugin's answer has no `pvp`, and it is empty.
|
||||
if (acc.layers.pvp.visible) out.pvp = Array.isArray(live.pvp) ? live.pvp : []
|
||||
// RaidableBases' bases (§11.4): an older plugin's answer has none. A run's key stays off the map.
|
||||
if (acc.layers.raids.visible) out.raids = Array.isArray(live.raids) ? live.raids.map(withoutKey) : []
|
||||
if (acc.layers.bases.visible) {
|
||||
out.bases = Array.isArray(live.bases) ? live.bases : []
|
||||
if (live.basesTruncated) out.basesTruncated = true
|
||||
|
||||
Reference in New Issue
Block a user