mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-25 21:40:05 +00:00
Removed temporary movement trace
- Gameplay retains tick delimiters without intercepting packet writes - Chest outcome and failure phase evidence remain in reports
This commit is contained in:
1 parent
718b13df46
commit
09d36ec990
1 file changed
+2
-25
@@ -8,28 +8,8 @@ const simplifyNbt = value => {
|
|||||||
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, simplifyNbt(entry)]))
|
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, simplifyNbt(entry)]))
|
||||||
}
|
}
|
||||||
|
|
||||||
const traceMovement = context => {
|
const completeClientTicks = context => {
|
||||||
const client = context.bot._client
|
const client = context.bot._client
|
||||||
const write = client.write
|
|
||||||
const records = context.report.treasureMovement = []
|
|
||||||
const numeric = value => typeof value === 'number' && !Number.isFinite(value) ? String(value) : value
|
|
||||||
const record = (direction, name, packet) => {
|
|
||||||
const entity = context.bot.entity
|
|
||||||
records.push({ direction, name, at: new Date().toISOString(),
|
|
||||||
packet: Object.fromEntries(['teleportId', 'x', 'y', 'z', 'yaw', 'pitch', 'flags']
|
|
||||||
.filter(key => key in packet).map(key => [key, numeric(packet[key])])),
|
|
||||||
entity: Object.fromEntries(['x', 'y', 'z'].map(key => [key, numeric(entity.position[key])])
|
|
||||||
.concat(['yaw', 'pitch'].map(key => [key, numeric(entity[key])]))) })
|
|
||||||
if (records.length > 64) records.shift()
|
|
||||||
}
|
|
||||||
const incoming = packet => record('incoming', 'position', packet)
|
|
||||||
const rotation = packet => record('incoming', 'player_rotation', packet)
|
|
||||||
client.prependListener('position', incoming)
|
|
||||||
client.prependListener('player_rotation', rotation)
|
|
||||||
client.write = function (name, packet, ...rest) {
|
|
||||||
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')
|
context.expect(context.bot.supportFeature('sendsClientTickEndPacket'), 'Fixture client supports tick delimiters')
|
||||||
let tickTimer
|
let tickTimer
|
||||||
const finishTick = () => {
|
const finishTick = () => {
|
||||||
@@ -41,9 +21,6 @@ const traceMovement = context => {
|
|||||||
finishTick()
|
finishTick()
|
||||||
context.signal.addEventListener('abort', () => {
|
context.signal.addEventListener('abort', () => {
|
||||||
clearTimeout(tickTimer)
|
clearTimeout(tickTimer)
|
||||||
client.write = write
|
|
||||||
client.removeListener('position', incoming)
|
|
||||||
client.removeListener('player_rotation', rotation)
|
|
||||||
context.bot.removeListener('move', finishTick)
|
context.bot.removeListener('move', finishTick)
|
||||||
}, { once: true })
|
}, { once: true })
|
||||||
}
|
}
|
||||||
@@ -52,7 +29,7 @@ export default {
|
|||||||
name: 'iris-treasure-maps',
|
name: 'iris-treasure-maps',
|
||||||
description: 'Verify exploration-map targets, bounded misses, retained loot, and normal/copper storage on Iris.',
|
description: 'Verify exploration-map targets, bounded misses, retained loot, and normal/copper storage on Iris.',
|
||||||
async run(context) {
|
async run(context) {
|
||||||
traceMovement(context)
|
completeClientTicks(context)
|
||||||
context.bot.physicsEnabled = false
|
context.bot.physicsEnabled = false
|
||||||
context.bot.clearControlStates()
|
context.bot.clearControlStates()
|
||||||
context.bot.entity.velocity.set(0, 0, 0)
|
context.bot.entity.velocity.set(0, 0, 0)
|
||||||
|
|||||||
Reference in new issue
Block a user