feat(rust): Guarded Crate — feed, map, Warden, Place a guarded crate (PLAN_REDESIGNS §14.3.5)
Stage 6 of the §14.3 integration plan, on protocol 14. Spec: docs rust-link/PROTOCOL.md §20.9. - gc.started and gc.ended public, gc.failed staff's; guardedCrate.js reads each row per viewer (the clearer's name for the presence audience, Steam id, position and key for staff, `won` for everyone). - Triggers rust.gc.started and rust.gc.ended (a crate a player cleared only). - The step rust.gc.place: an event from rust.options.gc_events and a world call's location; refused at verify for Guarded Crate absent, NpcSpawn missing (D364), console unavailable, or an unknown event. Kept (D373); the run log's success line says so (D380). Budget rust.gc.crates. - Warden (D375): guarded_won, title category guardedwon, Crates cleared column. - Map marker, server settings line, swagger, engagement manifest, bundle, README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -203,9 +203,10 @@ 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 and Dangerous Treasures, which the server serves publicly', () => {
|
||||
assert.deepEqual(kindsFor('world'), ['world.event', 'pvp.zone.created', 'dt.started', 'dt.won'])
|
||||
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'])
|
||||
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'))
|
||||
assert.ok(!FEED_KINDS.includes('pvp.zone.deleted'), 'a zone closing is a staff line')
|
||||
})
|
||||
@@ -271,3 +272,30 @@ test('a win names its winner only when the server sent the name, and says how ma
|
||||
test('a treasure event ending, for a staff reader, is its own line', () => {
|
||||
assert.equal(describe(treasure('dt.ended', { grid: 'K12' })).verb, 'A Dangerous Treasures event has ended')
|
||||
})
|
||||
|
||||
// ── Guarded Crate (protocol 14, PLAN_REDESIGNS §14.3.5) ───────────────────
|
||||
|
||||
const guarded = (kind, frame) => row(kind, { kind, ...frame })
|
||||
|
||||
test('a guarded crate landing says where, and names nobody', () => {
|
||||
const line = describe(guarded('gc.started', { grid: 'M4' }))
|
||||
assert.equal(line.verb, 'A guarded crate landed')
|
||||
assert.equal(line.detail, 'M4')
|
||||
assert.equal(line.actor, null)
|
||||
})
|
||||
|
||||
test('a clearing names its clearer only when the server sent the name', () => {
|
||||
const named = describe(guarded('gc.ended', { grid: 'M4', won: true, name: 'Alice' }))
|
||||
assert.equal(named.actor, 'Alice')
|
||||
assert.equal(named.verb, 'cleared the guarded crate')
|
||||
assert.equal(named.detail, 'M4')
|
||||
|
||||
const unnamed = describe(guarded('gc.ended', { grid: 'M4', won: true }))
|
||||
assert.equal(unnamed.actor, null)
|
||||
assert.equal(unnamed.verb, 'The guarded crate was cleared')
|
||||
})
|
||||
|
||||
test('an ending with nobody clearing it, and a timeout for a staff reader, are their own lines', () => {
|
||||
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')
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user