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:
@@ -203,8 +203,9 @@ test('every type the server knows has its own words, and an unknown one says its
|
||||
assert.equal(describe(world({ event: 'meteor.landed' })).verb, 'meteor.landed')
|
||||
})
|
||||
|
||||
test('the world filter asks for world events, Dynamic PVP zones opening, Dangerous Treasures and Guarded Crate, which the server serves publicly', () => {
|
||||
assert.deepEqual(kindsFor('world'), ['world.event', 'pvp.zone.created', 'dt.started', 'dt.won', 'gc.started', 'gc.ended'])
|
||||
test('the world filter asks for world events, Dynamic PVP zones opening, Dangerous Treasures, Guarded Crate and RaidableBases, which the server serves publicly', () => {
|
||||
assert.deepEqual(kindsFor('world'), ['world.event', 'pvp.zone.created', 'dt.started', 'dt.won', 'gc.started', 'gc.ended', 'raid.started', 'raid.completed', 'raid.purchased', 'raid.locked'])
|
||||
assert.ok(!FEED_KINDS.includes('raid.ended'), 'a raid base despawning is a staff line')
|
||||
assert.ok(!FEED_KINDS.includes('dt.ended'), 'a treasure event ending is a staff line')
|
||||
assert.ok(!FEED_KINDS.includes('gc.failed'), 'a guarded crate timing out is a staff line')
|
||||
assert.ok(FEED_KINDS.includes('pvp.zone.created'))
|
||||
@@ -299,3 +300,41 @@ test('an ending with nobody clearing it, and a timeout for a staff reader, are t
|
||||
assert.equal(describe(guarded('gc.ended', { grid: 'M4', won: false })).verb, 'A guarded crate ended with nobody clearing it')
|
||||
assert.equal(describe(guarded('gc.failed', { grid: 'M4' })).verb, 'A guarded crate timed out with its guards standing')
|
||||
})
|
||||
|
||||
// ── RaidableBases (protocol 14, PLAN_REDESIGNS §11.4) ─────────────────────
|
||||
//
|
||||
// Every difficulty here is invented (D386): the line says the plugin's own name.
|
||||
|
||||
const raid = (kind, frame) => row(kind, { kind, ...frame })
|
||||
|
||||
test('a raid base appearing says its difficulty as the plugin named it, where, and whether it is PvP', () => {
|
||||
const line = describe(raid('raid.started', { difficulty: 'Wobbly', grid: 'G7', pvp: true }))
|
||||
assert.equal(line.verb, 'A Wobbly raid base appeared')
|
||||
assert.equal(line.detail, 'G7 · PvP')
|
||||
assert.equal(line.actor, null)
|
||||
assert.equal(describe(raid('raid.started', { difficulty: 'Eerie', grid: 'G7' })).verb, 'An Eerie raid base appeared')
|
||||
assert.equal(describe(raid('raid.started', { grid: 'G7' })).verb, 'A raid base appeared')
|
||||
})
|
||||
|
||||
test('a raid names its raiders only when the server sent the names, and otherwise counts them', () => {
|
||||
const named = describe(raid('raid.completed', { difficulty: 'Wobbly', grid: 'G7', names: ['Alice', 'Bob', 'Cy'], raiderCount: 4 }))
|
||||
assert.equal(named.actor, 'Alice, Bob and 2 others')
|
||||
assert.equal(named.verb, 'raided a Wobbly raid base')
|
||||
|
||||
const two = describe(raid('raid.completed', { difficulty: 'Wobbly', names: ['Alice', 'Bob'], raiderCount: 2 }))
|
||||
assert.equal(two.actor, 'Alice and Bob')
|
||||
|
||||
const unnamed = describe(raid('raid.completed', { difficulty: 'Wobbly', grid: 'G7', raiderCount: 3 }))
|
||||
assert.equal(unnamed.actor, null)
|
||||
assert.equal(unnamed.verb, 'A Wobbly raid base was raided')
|
||||
assert.equal(unnamed.detail, 'G7 · by 3 players')
|
||||
})
|
||||
|
||||
test('a purchase and an admin lock name the player only when the server sent the name (D390), and a despawn is its own line', () => {
|
||||
assert.equal(describe(raid('raid.purchased', { difficulty: 'Wobbly', name: 'Alice' })).actor, 'Alice')
|
||||
assert.equal(describe(raid('raid.purchased', { difficulty: 'Wobbly', name: 'Alice' })).verb, 'bought a Wobbly raid base')
|
||||
assert.equal(describe(raid('raid.purchased', { difficulty: 'Wobbly' })).verb, 'A Wobbly raid base was bought')
|
||||
assert.equal(describe(raid('raid.locked', { difficulty: 'Wobbly', name: 'Alice' })).verb, 'A Wobbly raid base was locked to Alice')
|
||||
assert.equal(describe(raid('raid.locked', { difficulty: 'Wobbly' })).verb, 'A Wobbly raid base was locked to a player')
|
||||
assert.equal(describe(raid('raid.ended', { difficulty: 'Wobbly' })).verb, 'A Wobbly raid base despawned')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user