fix: SyndicateMissions growing with every worldState request

This commit is contained in:
Sainan 2025-01-10 06:14:38 +01:00
parent 99416123d1
commit 9f57eb90a4
2 changed files with 30 additions and 6 deletions

View File

@ -27,30 +27,30 @@ export const worldStateController: RequestHandler = (req, res) => {
const bountyCycle = Math.trunc(new Date().getTime() / 9000000); const bountyCycle = Math.trunc(new Date().getTime() / 9000000);
const bountyCycleStart = bountyCycle * 9000000; const bountyCycleStart = bountyCycle * 9000000;
const bountyCycleEnd = bountyCycleStart + 9000000; const bountyCycleEnd = bountyCycleStart + 9000000;
worldState.SyndicateMissions.push({ worldState.SyndicateMissions[worldState.SyndicateMissions.findIndex(x => x.Tag == "ZarimanSyndicate")] = {
_id: { $oid: bountyCycleStart.toString(16) + "0000000000000029" }, _id: { $oid: bountyCycleStart.toString(16) + "0000000000000029" },
Activation: { $date: { $numberLong: bountyCycleStart.toString() } }, Activation: { $date: { $numberLong: bountyCycleStart.toString() } },
Expiry: { $date: { $numberLong: bountyCycleEnd.toString() } }, Expiry: { $date: { $numberLong: bountyCycleEnd.toString() } },
Tag: "ZarimanSyndicate", Tag: "ZarimanSyndicate",
Seed: bountyCycle, Seed: bountyCycle,
Nodes: [] Nodes: []
}); };
worldState.SyndicateMissions.push({ worldState.SyndicateMissions[worldState.SyndicateMissions.findIndex(x => x.Tag == "EntratiLabSyndicate")] = {
_id: { $oid: bountyCycleStart.toString(16) + "0000000000000004" }, _id: { $oid: bountyCycleStart.toString(16) + "0000000000000004" },
Activation: { $date: { $numberLong: bountyCycleStart.toString() } }, Activation: { $date: { $numberLong: bountyCycleStart.toString() } },
Expiry: { $date: { $numberLong: bountyCycleEnd.toString() } }, Expiry: { $date: { $numberLong: bountyCycleEnd.toString() } },
Tag: "EntratiLabSyndicate", Tag: "EntratiLabSyndicate",
Seed: bountyCycle, Seed: bountyCycle,
Nodes: [] Nodes: []
}); };
worldState.SyndicateMissions.push({ worldState.SyndicateMissions[worldState.SyndicateMissions.findIndex(x => x.Tag == "HexSyndicate")] = {
_id: { $oid: bountyCycleStart.toString(16) + "0000000000000006" }, _id: { $oid: bountyCycleStart.toString(16) + "0000000000000006" },
Activation: { $date: { $numberLong: bountyCycleStart.toString(10) } }, Activation: { $date: { $numberLong: bountyCycleStart.toString(10) } },
Expiry: { $date: { $numberLong: bountyCycleEnd.toString(10) } }, Expiry: { $date: { $numberLong: bountyCycleEnd.toString(10) } },
Tag: "HexSyndicate", Tag: "HexSyndicate",
Seed: bountyCycle, Seed: bountyCycle,
Nodes: [] Nodes: []
}); };
// Circuit choices cycling every week // Circuit choices cycling every week
worldState.EndlessXpChoices.push({ worldState.EndlessXpChoices.push({

View File

@ -340,6 +340,14 @@
} }
] ]
}, },
{
"_id": { "$oid": "663a71c80000000000000004" },
"Activation": { "$date": { "$numberLong": "1715106248403" } },
"Expiry": { "$date": { "$numberLong": "2000000000000" } },
"Tag": "EntratiLabSyndicate",
"Seed": 99562,
"Nodes": []
},
{ {
"_id": { "$oid": "663a71c80000000000000008" }, "_id": { "$oid": "663a71c80000000000000008" },
"Activation": { "$date": { "$numberLong": "1715106248403" } }, "Activation": { "$date": { "$numberLong": "1715106248403" } },
@ -471,6 +479,22 @@
"xpAmounts": [780, 780, 780, 780, 1540] "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": [ "ActiveMissions": [