From 91773082afc39775a00be757c2da54fc374ad045 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 24 Jun 2025 02:10:39 +0200 Subject: [PATCH 1/2] Move optional bug fixes to separate config section --- config.json.example | 4 ++++ src/services/configService.ts | 4 ++++ src/services/missionInventoryUpdateService.ts | 4 +++- src/services/worldStateService.ts | 17 ++++++++++++++--- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/config.json.example b/config.json.example index 50061401..38b874f0 100644 --- a/config.json.example +++ b/config.json.example @@ -25,6 +25,10 @@ "dontSubtractPurchaseStandingCost": false, "dontSubtractVoidTraces": false, "dontSubtractConsumables": false, + "bugFixes": { + "ignore1999LastRegionPlayed": false, + "fixXtraCheeseTimer": false + }, "unlockAllShipFeatures": false, "unlockAllShipDecorations": false, "unlockAllFlavourItems": false, diff --git a/src/services/configService.ts b/src/services/configService.ts index ab91cf79..9803ccb1 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -65,6 +65,10 @@ export interface IConfig { unlockAllSimarisResearchEntries?: boolean; spoofMasteryRank?: number; nightwaveStandingMultiplier?: number; + bugFixes?: { + ignore1999LastRegionPlayed?: boolean; + fixXtraCheeseTimer?: boolean; + }; worldState?: { creditBoost?: boolean; affinityBoost?: boolean; diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index c6d98de6..2e87cd6a 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -268,7 +268,9 @@ export const addMissionInventoryUpdates = async ( addMissionComplete(inventory, value); break; case "LastRegionPlayed": - inventory.LastRegionPlayed = value; + if (!(config.bugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) { + inventory.LastRegionPlayed = value; + } break; case "RawUpgrades": addMods(inventory, value); diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index ea48ef44..a031664e 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -1325,6 +1325,17 @@ export const getWorldState = (buildLabel?: string): IWorldState => { const cheeseInterval = hourInSeconds * 8; const cheeseDuration = hourInSeconds * 2; const cheeseIndex = Math.trunc(timeSecs / cheeseInterval); + let cheeseStart = cheeseIndex * cheeseInterval; + let cheeseEnd = cheeseStart + cheeseDuration; + let cheeseNext = (cheeseIndex + 1) * cheeseInterval; + // Live servers only update the start time once it happens, which makes the + // client show a negative countdown during off-hours. Optionally adjust the + // times so the next activation is always in the future. + if (config.bugFixes?.fixXtraCheeseTimer && timeSecs >= cheeseEnd) { + cheeseStart = cheeseNext; + cheeseEnd = cheeseStart + cheeseDuration; + cheeseNext += cheeseInterval; + } const tmp: ITmp = { cavabegin: "1690761600", PurchasePlatformLockEnabled: true, @@ -1349,9 +1360,9 @@ export const getWorldState = (buildLabel?: string): IWorldState => { ennnd: true, mbrt: true, fbst: { - a: cheeseIndex * cheeseInterval, // This has a bug where the client shows a negative time for "Xtra cheese starts in ..." until it refreshes the world state. This is because we're only providing the new activation as soon as that time/date is reached. However, this is 100% faithful to live. - e: cheeseIndex * cheeseInterval + cheeseDuration, - n: (cheeseIndex + 1) * cheeseInterval + a: cheeseStart, + e: cheeseEnd, + n: cheeseNext }, sfn: [550, 553, 554, 555][halfHour % 4] }; -- 2.47.2 From 48f639ab2641bfe63e9fdd0631d93d89b7ba336a Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 24 Jun 2025 02:15:33 +0200 Subject: [PATCH 2/2] manual fixup --- config.json.example | 8 ++++---- src/services/configService.ts | 2 +- src/services/missionInventoryUpdateService.ts | 2 +- src/services/worldStateService.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/config.json.example b/config.json.example index 38b874f0..37300e0c 100644 --- a/config.json.example +++ b/config.json.example @@ -25,10 +25,6 @@ "dontSubtractPurchaseStandingCost": false, "dontSubtractVoidTraces": false, "dontSubtractConsumables": false, - "bugFixes": { - "ignore1999LastRegionPlayed": false, - "fixXtraCheeseTimer": false - }, "unlockAllShipFeatures": false, "unlockAllShipDecorations": false, "unlockAllFlavourItems": false, @@ -62,6 +58,10 @@ "unlockAllSimarisResearchEntries": false, "spoofMasteryRank": -1, "nightwaveStandingMultiplier": 1, + "unfaithfulBugFixes": { + "ignore1999LastRegionPlayed": false, + "fixXtraCheeseTimer": false + }, "worldState": { "creditBoost": false, "affinityBoost": false, diff --git a/src/services/configService.ts b/src/services/configService.ts index 9803ccb1..ff7c0670 100644 --- a/src/services/configService.ts +++ b/src/services/configService.ts @@ -65,7 +65,7 @@ export interface IConfig { unlockAllSimarisResearchEntries?: boolean; spoofMasteryRank?: number; nightwaveStandingMultiplier?: number; - bugFixes?: { + unfaithfulBugFixes?: { ignore1999LastRegionPlayed?: boolean; fixXtraCheeseTimer?: boolean; }; diff --git a/src/services/missionInventoryUpdateService.ts b/src/services/missionInventoryUpdateService.ts index 2e87cd6a..cd523253 100644 --- a/src/services/missionInventoryUpdateService.ts +++ b/src/services/missionInventoryUpdateService.ts @@ -268,7 +268,7 @@ export const addMissionInventoryUpdates = async ( addMissionComplete(inventory, value); break; case "LastRegionPlayed": - if (!(config.bugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) { + if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) { inventory.LastRegionPlayed = value; } break; diff --git a/src/services/worldStateService.ts b/src/services/worldStateService.ts index a031664e..a2902f40 100644 --- a/src/services/worldStateService.ts +++ b/src/services/worldStateService.ts @@ -1331,7 +1331,7 @@ export const getWorldState = (buildLabel?: string): IWorldState => { // Live servers only update the start time once it happens, which makes the // client show a negative countdown during off-hours. Optionally adjust the // times so the next activation is always in the future. - if (config.bugFixes?.fixXtraCheeseTimer && timeSecs >= cheeseEnd) { + if (config.unfaithfulBugFixes?.fixXtraCheeseTimer && timeSecs >= cheeseEnd) { cheeseStart = cheeseNext; cheeseEnd = cheeseStart + cheeseDuration; cheeseNext += cheeseInterval; -- 2.47.2