feat(rust): Dangerous Treasures — feed, map, Treasure Hunter, Start a Dangerous Treasures event (PLAN_REDESIGNS §14.3.4)
Stage 5 of the §14.3 integration plan, on protocol 14 (docs rust-link/PROTOCOL.md §20.8). - dt.started and dt.won are public kinds, dt.ended a staff kind. The new dangerousTreasures.js reads each row per viewer: grid and invaderCount for everyone, the winner's name for the presence audience (D376), the position, the step's key, the winner's Steam id and the invaders for staff. - Feed lines in the World events filter: "A Dangerous Treasures event has started · K12", "Alice won the treasure · K12 · 3 players fought for it". - Triggers rust.dt.started (with byEvent) and rust.dt.won, public, cooldown subject the server, names only. - eventDangerousTreasures.js: rust.dt.start, "Start a Dangerous Treasures event" (risk change, reversible none, budget rust.dt.events), server and difficulty. Refused at verify where the server said DT is not loaded or console.plugins is false (Rust-Plugins#34). dt-not-ready answers "Dangerous Treasures is not ready yet" with retryAfterMs 600000 (D365, D371); dt-no-spot retries on core's delay; DT's own refusals are permanent. - Treasure Hunter (D375): treasuresWon -> treasures_won, the title category treasureswon, and a sortable Treasures column shown where the server reports DT or a row counts one. - The map draws a running chest on the world layer; the server settings' plugin line names DT and whether a step can start one, from the integrations read's new `console`. - coreApi ^1.15.0, ci/core-ref.json pinned to website main at #215's merge. ci/bundle.json ships the two new files; swagger fragment and engagement manifest regenerated; README lists DT. Server 627/627 (16 new in test/dangerousTreasures.test.js) and every check; client 92/92, build and externals. Booted against the pinned core: 45 triggers, 13 actions, 11 budgets, 21 option sources; 89 routes unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -157,6 +157,12 @@ test('the classification covers exactly the event kinds the protocol defines, th
|
||||
// nobody; the closing is a staff line (PLAN_REDESIGNS §14.3.3).
|
||||
'pvp.zone.created',
|
||||
'pvp.zone.deleted',
|
||||
// Protocol 14 (§20.8): Dangerous Treasures. The opening and the win are
|
||||
// public, read per viewer by `dangerousTreasures.js`; the ending is staff's
|
||||
// (PLAN_REDESIGNS §14.3.4).
|
||||
'dt.started',
|
||||
'dt.won',
|
||||
'dt.ended',
|
||||
]
|
||||
|
||||
assert.deepEqual([...catalogue.ALL_KINDS].sort(), [...PROTOCOL_4].sort())
|
||||
@@ -179,6 +185,13 @@ test('the classification covers exactly the event kinds the protocol defines, th
|
||||
assert.equal(catalogue.isPublic('pvp.zone.created'), true)
|
||||
assert.equal(catalogue.isPresence('pvp.zone.created'), false)
|
||||
assert.equal(catalogue.isPublic('pvp.zone.deleted'), false, 'a zone closing is a staff line')
|
||||
// D376 for Dangerous Treasures: the win names its winner only to the presence
|
||||
// audience, per viewer, so neither public kind is a presence kind.
|
||||
for (const kind of ['dt.started', 'dt.won']) {
|
||||
assert.equal(catalogue.isPublic(kind), true)
|
||||
assert.equal(catalogue.isPresence(kind), false)
|
||||
}
|
||||
assert.equal(catalogue.isPublic('dt.ended'), false, 'a treasure event ending is a staff line')
|
||||
})
|
||||
|
||||
test('every kind that names a player who was on is behind the presence setting', () => {
|
||||
@@ -203,6 +216,7 @@ test('every kind that names a player who was on is behind the presence setting',
|
||||
|
||||
// And what is left names nobody — a world event included, once `worldEvents.shapeFor`
|
||||
// has taken its names off for a viewer below the presence audience (D376).
|
||||
// Dynamic PVP's opening names nobody at all.
|
||||
assert.deepEqual(catalogue.kindsFor({}).sort(), ['npc.boss.spawned', 'pvp.zone.created', 'server.initialized', 'server.shutdown', 'server.wipe', 'world.event'])
|
||||
// Dynamic PVP's opening names nobody at all, and a Dangerous Treasures win names
|
||||
// nobody once `dangerousTreasures.shapeFor` has read it for such a viewer.
|
||||
assert.deepEqual(catalogue.kindsFor({}).sort(), ['dt.started', 'dt.won', 'npc.boss.spawned', 'pvp.zone.created', 'server.initialized', 'server.shutdown', 'server.wipe', 'world.event'])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user