Completed fixture client ticks

- Stationary gameplay sends tick delimiters after movement packets
- An initial delimiter closes movement sent before the scenario starts
This commit is contained in:
Brian Neumann-Fopiano committed 2026-10-13 16:52:12 -04:00
1 parent ee3af26f11
commit 9dbb6b6e85
1 file changed
+6 -1
@@ -27,13 +27,18 @@ const traceMovement = context => {
client.prependListener('position', incoming)
client.prependListener('player_rotation', rotation)
client.write = function (name, packet, ...rest) {
if (['position', 'position_look', 'look', 'teleport_confirm'].includes(name)) record('outgoing', name, packet)
if (['position', 'position_look', 'look', 'teleport_confirm', 'tick_end'].includes(name)) record('outgoing', name, packet)
return write.call(this, name, packet, ...rest)
}
context.expect(context.bot.supportFeature('sendsClientTickEndPacket'), 'Fixture client supports tick delimiters')
const finishTick = () => client.write('tick_end', {})
context.bot.on('move', finishTick)
finishTick()
context.signal.addEventListener('abort', () => {
client.write = write
client.removeListener('position', incoming)
client.removeListener('player_rotation', rotation)
context.bot.removeListener('move', finishTick)
}, { once: true })
}