fix(rust): a zone resource carries its deadline as until (W1)
Stage 4 of docs/modules/rust/PLAN_LAST_FIXES.md, the module's half of W1. A placed zone now reports `until`, reckoned from the answer as now plus holdMs, so it lands a round trip after the game's own deadline and never before it. Core's reconcile then files a zone gone past that deadline as expired, where a reconnect used to log resource.orphaned five seconds before the game's world.expired arrived. Crates and NPCs send no holdMs, so they carry no until. No core pin change: `until` has been in the resource contract all along, and a core without the reconcile half only shows it on the console. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E14m6SuuY6i1vASFeGDBeY
This commit is contained in:
@@ -178,10 +178,13 @@ test('a zone crosses with its key, its duration, and the monument without the se
|
||||
server: 'main',
|
||||
body: { runId: '7', key: 'k1', monument: 'airfield_1', offsetX: 0, offsetZ: -20, radius: 40, holdMs: 5400000, name: 'Brawl' },
|
||||
})
|
||||
// The ref carries the server: revert and reconcile are handed no params.
|
||||
assert.deepStrictEqual(result.resources, [
|
||||
{ kind: 'world', ref: 'main:rg-7-1-1', payload: { serverId: 'main', what: 'zone', name: 'Z' } },
|
||||
])
|
||||
// The ref carries the server: revert and reconcile are handed no params. The
|
||||
// zone's deadline rides as `until` (W1); zones.test.js checks its value.
|
||||
const [resource] = result.resources
|
||||
assert.strictEqual(typeof resource.until, 'string')
|
||||
const { until, ...rest } = resource
|
||||
assert.deepStrictEqual(rest, { kind: 'world', ref: 'main:rg-7-1-1', payload: { serverId: 'main', what: 'zone', name: 'Z' } })
|
||||
assert.strictEqual(result.resources.length, 1)
|
||||
})
|
||||
|
||||
test('one resource per thing placed, and a repeated key is said to be one', async (t) => {
|
||||
|
||||
Reference in New Issue
Block a user