XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

feat: worldState.allTheFissures (#2313)

Closes #2294 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2313 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>

764cdd1a
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

4 个文件 +37 -14
Modified README.md +1 -0
@@ -34,4 +34,5 @@ SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [confi
34 34 - `RadioLegion2Syndicate` for The Emissary
35 35 - `RadioLegionIntermissionSyndicate` for Intermission I
36 36 - `RadioLegionSyndicate` for The Wolf of Saturn Six
37 - `allTheFissures` can be set to `normal` or `hard` to enable all fissures either in normal or steel path, respectively.
37 38 - `worldState.circuitGameModes` can be provided with an array of valid game modes (`Survival`, `VoidFlood`, `Excavation`, `Defense`, `Exterminate`, `Assassination`, `Alchemy`)
Modified config.json.example +1 -0
@@ -74,6 +74,7 @@
74 74 "vallisOverride": "",
75 75 "duviriOverride": "",
76 76 "nightwaveOverride": "",
77 "allTheFissures": "",
77 78 "circuitGameModes": null
78 79 },
79 80 "dev": {
Modified src/services/configService.ts +1 -0
@@ -81,6 +81,7 @@ export interface IConfig {
81 81 vallisOverride?: string;
82 82 duviriOverride?: string;
83 83 nightwaveOverride?: string;
84 allTheFissures?: string;
84 85 circuitGameModes?: string[];
85 86 };
86 87 dev?: {
Modified src/services/worldStateService.ts +34 -14
@@ -1524,20 +1524,40 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1524 1524 };
1525 1525
1526 1526 export const populateFissures = async (worldState: IWorldState): Promise<void> => {
1527 const fissures = await Fissure.find({});
1528 for (const fissure of fissures) {
1529 const meta = ExportRegions[fissure.Node];
1530 worldState.ActiveMissions.push({
1531 _id: toOid(fissure._id),
1532 Region: meta.systemIndex + 1,
1533 Seed: 1337,
1534 Activation: toMongoDate(fissure.Activation),
1535 Expiry: toMongoDate(fissure.Expiry),
1536 Node: fissure.Node,
1537 MissionType: eMissionType[meta.missionIndex].tag,
1538 Modifier: fissure.Modifier,
1539 Hard: fissure.Hard
1540 });
1527 if (config.worldState?.allTheFissures) {
1528 let i = 0;
1529 for (const [tier, nodes] of Object.entries(fissureMissions)) {
1530 for (const node of nodes) {
1531 const meta = ExportRegions[node];
1532 worldState.ActiveMissions.push({
1533 _id: { $oid: (i++).toString().padStart(8, "0") + "8e0c70ba050f1eb7" },
1534 Region: meta.systemIndex + 1,
1535 Seed: 1337,
1536 Activation: { $date: { $numberLong: "1000000000000" } },
1537 Expiry: { $date: { $numberLong: "2000000000000" } },
1538 Node: node,
1539 MissionType: eMissionType[meta.missionIndex].tag,
1540 Modifier: tier,
1541 Hard: config.worldState.allTheFissures == "hard"
1542 });
1543 }
1544 }
1545 } else {
1546 const fissures = await Fissure.find({});
1547 for (const fissure of fissures) {
1548 const meta = ExportRegions[fissure.Node];
1549 worldState.ActiveMissions.push({
1550 _id: toOid(fissure._id),
1551 Region: meta.systemIndex + 1,
1552 Seed: 1337,
1553 Activation: toMongoDate(fissure.Activation),
1554 Expiry: toMongoDate(fissure.Expiry),
1555 Node: fissure.Node,
1556 MissionType: eMissionType[meta.missionIndex].tag,
1557 Modifier: fissure.Modifier,
1558 Hard: fissure.Hard
1559 });
1560 }
1541 1561 }
1542 1562 };
1543 1563