mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-18 06:24:47 +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:
@@ -8,28 +8,8 @@ const simplifyNbt = value => {
|
||||
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [key, simplifyNbt(entry)]))
|
||||
}
|
||||
|
||||
const traceMovement = context => {
|
||||
const completeClientTicks = context => {
|
||||
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')
|
||||
let tickTimer
|
||||
const finishTick = () => {
|
||||
@@ -41,9 +21,6 @@ const traceMovement = context => {
|
||||
finishTick()
|
||||
context.signal.addEventListener('abort', () => {
|
||||
clearTimeout(tickTimer)
|
||||
client.write = write
|
||||
client.removeListener('position', incoming)
|
||||
client.removeListener('player_rotation', rotation)
|
||||
context.bot.removeListener('move', finishTick)
|
||||
}, { once: true })
|
||||
}
|
||||
@@ -52,7 +29,7 @@ export default {
|
||||
name: 'iris-treasure-maps',
|
||||
description: 'Verify exploration-map targets, bounded misses, retained loot, and normal/copper storage on Iris.',
|
||||
async run(context) {
|
||||
traceMovement(context)
|
||||
completeClientTicks(context)
|
||||
context.bot.physicsEnabled = false
|
||||
context.bot.clearControlStates()
|
||||
context.bot.entity.velocity.set(0, 0, 0)
|
||||
|
||||
Reference in New Issue
Block a user