From ab6f93224590b8e9c699507ae40940643d434823 Mon Sep 17 00:00:00 2001 From: sanasol Date: Tue, 27 Jan 2026 04:05:08 +0100 Subject: [PATCH] Add HYTALE_NOOP_TEST to test read/write without patching Tests if our file read/write process itself causes corruption. Co-Authored-By: Claude Opus 4.5 --- backend/utils/clientPatcher.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/backend/utils/clientPatcher.js b/backend/utils/clientPatcher.js index 398aaf0..c6e4bd7 100644 --- a/backend/utils/clientPatcher.js +++ b/backend/utils/clientPatcher.js @@ -577,6 +577,14 @@ class ClientPatcher { progressCallback('Patching domain references...', 50); } + // HYTALE_NOOP_TEST: Just read and write binary without any changes + if (process.env.HYTALE_NOOP_TEST === '1') { + console.log('NOOP TEST: Writing binary without modifications...'); + fs.writeFileSync(clientPath, data); + this.markAsPatched(clientPath); + return { success: true, patchCount: 0, noop: true }; + } + console.log('Applying domain patches (length-prefixed format)...'); const { buffer: patchedData, count } = this.applyDomainPatches(data, newDomain);