From 1c654650d4559c4a8c0e2ede5f22f0db2cecb2f6 Mon Sep 17 00:00:00 2001 From: Sainan Date: Thu, 9 Jan 2025 14:02:12 +0100 Subject: [PATCH 1/4] fix: cap helminth resources at 100% (#757) --- src/controllers/api/infestedFoundryController.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/controllers/api/infestedFoundryController.ts b/src/controllers/api/infestedFoundryController.ts index 04144475..16c356fe 100644 --- a/src/controllers/api/infestedFoundryController.ts +++ b/src/controllers/api/infestedFoundryController.ts @@ -176,6 +176,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => { totalPercentagePointsGained += snack.gain * 100 * apetiteFactor; // 30% would be gain=0.3, so percentage points is equal to gain * 100. resource.Count += Math.trunc(snack.gain * 1000 * apetiteFactor); // 30% would be gain=0.3 or Count=300, so Count=gain*1000. + if (resource.Count > 1000) resource.Count = 1000; } const recipeChanges = addInfestedFoundryXP(inventory.InfestedFoundry, 666 * totalPercentagePointsGained); -- 2.47.2 From 99416123d18fe393de396aa9694b23c452f409f9 Mon Sep 17 00:00:00 2001 From: Sainan Date: Fri, 10 Jan 2025 06:11:27 +0100 Subject: [PATCH 2/4] fix: EndlessXpChoices growing with every worldState request --- src/controllers/dynamic/worldStateController.ts | 5 +++-- static/fixed_responses/worldState.json | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index b95e621b..b2a4888d 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -5,12 +5,13 @@ import { IMongoDate, IOid } from "@/src/types/commonTypes"; export const worldStateController: RequestHandler = (req, res) => { const worldState: IWorldState = { - ...staticWorldState, BuildLabel: typeof req.query.buildLabel == "string" ? req.query.buildLabel.split(" ").join("+") : buildConfig.buildLabel, - Time: Math.round(Date.now() / 1000) + Time: Math.round(Date.now() / 1000), + EndlessXpChoices: [], + ...staticWorldState }; const week = Math.trunc(new Date().getTime() / 604800000); diff --git a/static/fixed_responses/worldState.json b/static/fixed_responses/worldState.json index 54b6903a..14e34008 100644 --- a/static/fixed_responses/worldState.json +++ b/static/fixed_responses/worldState.json @@ -1078,7 +1078,6 @@ "ConstructionProjects": [], "TwitchPromos": [], "ExperimentRecommended": [], - "EndlessXpChoices": [], "ForceLogoutVersion": 0, "SeasonInfo": { "Activation": { "$date": { "$numberLong": "1715796000000" } }, -- 2.47.2 From 9f57eb90a43bed190ffa1dce8592e9601ae5f2ab Mon Sep 17 00:00:00 2001 From: Sainan Date: Fri, 10 Jan 2025 06:14:38 +0100 Subject: [PATCH 3/4] fix: SyndicateMissions growing with every worldState request --- .../dynamic/worldStateController.ts | 12 +++++----- static/fixed_responses/worldState.json | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index b2a4888d..d796a075 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -27,30 +27,30 @@ export const worldStateController: RequestHandler = (req, res) => { const bountyCycle = Math.trunc(new Date().getTime() / 9000000); const bountyCycleStart = bountyCycle * 9000000; const bountyCycleEnd = bountyCycleStart + 9000000; - worldState.SyndicateMissions.push({ + worldState.SyndicateMissions[worldState.SyndicateMissions.findIndex(x => x.Tag == "ZarimanSyndicate")] = { _id: { $oid: bountyCycleStart.toString(16) + "0000000000000029" }, Activation: { $date: { $numberLong: bountyCycleStart.toString() } }, Expiry: { $date: { $numberLong: bountyCycleEnd.toString() } }, Tag: "ZarimanSyndicate", Seed: bountyCycle, Nodes: [] - }); - worldState.SyndicateMissions.push({ + }; + worldState.SyndicateMissions[worldState.SyndicateMissions.findIndex(x => x.Tag == "EntratiLabSyndicate")] = { _id: { $oid: bountyCycleStart.toString(16) + "0000000000000004" }, Activation: { $date: { $numberLong: bountyCycleStart.toString() } }, Expiry: { $date: { $numberLong: bountyCycleEnd.toString() } }, Tag: "EntratiLabSyndicate", Seed: bountyCycle, Nodes: [] - }); - worldState.SyndicateMissions.push({ + }; + worldState.SyndicateMissions[worldState.SyndicateMissions.findIndex(x => x.Tag == "HexSyndicate")] = { _id: { $oid: bountyCycleStart.toString(16) + "0000000000000006" }, Activation: { $date: { $numberLong: bountyCycleStart.toString(10) } }, Expiry: { $date: { $numberLong: bountyCycleEnd.toString(10) } }, Tag: "HexSyndicate", Seed: bountyCycle, Nodes: [] - }); + }; // Circuit choices cycling every week worldState.EndlessXpChoices.push({ diff --git a/static/fixed_responses/worldState.json b/static/fixed_responses/worldState.json index 14e34008..a3768ffc 100644 --- a/static/fixed_responses/worldState.json +++ b/static/fixed_responses/worldState.json @@ -340,6 +340,14 @@ } ] }, + { + "_id": { "$oid": "663a71c80000000000000004" }, + "Activation": { "$date": { "$numberLong": "1715106248403" } }, + "Expiry": { "$date": { "$numberLong": "2000000000000" } }, + "Tag": "EntratiLabSyndicate", + "Seed": 99562, + "Nodes": [] + }, { "_id": { "$oid": "663a71c80000000000000008" }, "Activation": { "$date": { "$numberLong": "1715106248403" } }, @@ -471,6 +479,22 @@ "xpAmounts": [780, 780, 780, 780, 1540] } ] + }, + { + "_id": { "$oid": "663a71c80000000000000029" }, + "Activation": { "$date": { "$numberLong": "1715106248403" } }, + "Expiry": { "$date": { "$numberLong": "2000000000000" } }, + "Tag": "ZarimanSyndicate", + "Seed": 99562, + "Nodes": [] + }, + { + "_id": { "$oid": "676b8d340000000000000006" }, + "Activation": { "$date": { "$numberLong": "1735101748215" } }, + "Expiry": { "$date": { "$numberLong": "2000000000000" } }, + "Tag": "HexSyndicate", + "Seed": 33872, + "Nodes": [] } ], "ActiveMissions": [ -- 2.47.2 From 954367d3dfad1221f5ce654f0cea15b5fbf91084 Mon Sep 17 00:00:00 2001 From: Sainan Date: Fri, 10 Jan 2025 06:15:58 +0100 Subject: [PATCH 4/4] fix: NodeOverrides growing with every worldState request --- src/controllers/dynamic/worldStateController.ts | 6 +----- static/fixed_responses/worldState.json | 1 + 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/controllers/dynamic/worldStateController.ts b/src/controllers/dynamic/worldStateController.ts index d796a075..8ad722be 100644 --- a/src/controllers/dynamic/worldStateController.ts +++ b/src/controllers/dynamic/worldStateController.ts @@ -17,11 +17,7 @@ export const worldStateController: RequestHandler = (req, res) => { const week = Math.trunc(new Date().getTime() / 604800000); // Elite Sanctuary Onslaught cycling every week - worldState.NodeOverrides.push({ - _id: { $oid: "5ad9f9bb6df82a56eabf3d44" }, - Node: "SolNode802", - Seed: week // unfaithful - }); + worldState.NodeOverrides.find(x => x.Node == "SolNode802")!.Seed = week; // unfaithful // Holdfast, Cavia, & Hex bounties cycling every 2.5 hours; unfaithful implementation const bountyCycle = Math.trunc(new Date().getTime() / 9000000); diff --git a/static/fixed_responses/worldState.json b/static/fixed_responses/worldState.json index a3768ffc..bde87f8a 100644 --- a/static/fixed_responses/worldState.json +++ b/static/fixed_responses/worldState.json @@ -690,6 +690,7 @@ { "_id": { "$oid": "549b18e9b029cef5991d6aec" }, "Node": "EuropaHUB", "Hide": true }, { "_id": { "$oid": "54a1737aeb658f6cbccf70ff" }, "Node": "ErisHUB", "Hide": true }, { "_id": { "$oid": "54a736ddec12f80bd6e9e326" }, "Node": "VenusHUB", "Hide": true }, + { "_id": { "$oid": "5ad9f9bb6df82a56eabf3d44" }, "Node": "SolNode802", "Seed": 9969639 }, { "_id": { "$oid": "5b8817c2bd4f253264d6aa91" }, "Node": "EarthHUB", -- 2.47.2