fix: Minimal patching mode - only essential auth patches

Reduced patches from 6 to 3:
- Skip sentry (not needed for auth)
- Skip tools (not needed for auth)
- Skip telemetry (not needed for auth)
- Keep: domain, sessions, account-data

Fewer patches = less chance of triggering race condition.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
sanasol
2026-01-27 06:06:00 +01:00
parent 8ef13c5ee1
commit 225bc662b3

View File

@@ -231,22 +231,11 @@ class ClientPatcher {
console.log(` Patching strategy: ${strategy.description}`); console.log(` Patching strategy: ${strategy.description}`);
// 1. Patch telemetry/sentry URL // MINIMAL PATCHING MODE - only patch what's essential for auth
const oldSentry = 'https://ca900df42fcf57d4dd8401a86ddd7da2@sentry.hytale.com/2'; // Skip sentry (not needed for auth)
const newSentry = `${protocol}t@${domain}/2`; console.log(` Skipping sentry patch (minimal mode)`);
const sentryResult = this.replaceBytes( // 1. Patch main domain (hytale.com -> mainDomain) - ESSENTIAL
result,
this.stringToLengthPrefixed(oldSentry),
this.stringToLengthPrefixed(newSentry)
);
result = sentryResult.buffer;
if (sentryResult.count > 0) {
console.log(` Patched ${sentryResult.count} sentry URL(s)`);
totalCount += sentryResult.count;
}
// 2. Patch main domain (hytale.com -> mainDomain)
const domainResult = this.replaceBytes( const domainResult = this.replaceBytes(
result, result,
this.stringToLengthPrefixed(ORIGINAL_DOMAIN), this.stringToLengthPrefixed(ORIGINAL_DOMAIN),
@@ -258,11 +247,11 @@ class ClientPatcher {
totalCount += domainResult.count; totalCount += domainResult.count;
} }
// 3. Patch subdomain prefixes // 2. Only patch sessions (essential for auth) - skip tools/telemetry
const subdomains = ['https://tools.', 'https://sessions.', 'https://account-data.', 'https://telemetry.']; const essentialSubdomains = ['https://sessions.', 'https://account-data.'];
const newSubdomainPrefix = protocol + strategy.subdomainPrefix; const newSubdomainPrefix = protocol + strategy.subdomainPrefix;
for (const sub of subdomains) { for (const sub of essentialSubdomains) {
const subResult = this.replaceBytes( const subResult = this.replaceBytes(
result, result,
this.stringToLengthPrefixed(sub), this.stringToLengthPrefixed(sub),
@@ -274,6 +263,7 @@ class ClientPatcher {
totalCount += subResult.count; totalCount += subResult.count;
} }
} }
console.log(` Skipping tools/telemetry patches (minimal mode)`);
return { buffer: result, count: totalCount }; return { buffer: result, count: totalCount };
} }