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: add nightwaveOverride to config (#2120)

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

5c5296d5
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

4 个文件 +74 -24
Modified README.md +17 -0
@@ -15,3 +15,20 @@ SpaceNinjaServer requires a `config.json`. To set it up, you can copy the [confi
15 15 - `logger.level` can be `fatal`, `error`, `warn`, `info`, `http`, `debug`, or `trace`.
16 16 - `myIrcAddresses` can be used to point to an IRC server. If not provided, defaults to `[ myAddress ]`.
17 17 - `worldState.lockTime` will lock the time provided in worldState if nonzero, e.g. `1743202800` for night in POE.
18 - `worldState.nightwaveOverride` will lock the nightwave season, assuming the client is new enough for it. Valid values:
19 - `RadioLegionIntermission13Syndicate` for Nora's Mix Vol. 9
20 - `RadioLegionIntermission12Syndicate` for Nora's Mix Vol. 8
21 - `RadioLegionIntermission11Syndicate` for Nora's Mix Vol. 7
22 - `RadioLegionIntermission10Syndicate` for Nora's Mix Vol. 6
23 - `RadioLegionIntermission9Syndicate` for Nora's Mix Vol. 5
24 - `RadioLegionIntermission8Syndicate` for Nora's Mix Vol. 4
25 - `RadioLegionIntermission7Syndicate` for Nora's Mix Vol. 3
26 - `RadioLegionIntermission6Syndicate` for Nora's Mix Vol. 2
27 - `RadioLegionIntermission5Syndicate` for Nora's Mix Vol. 1
28 - `RadioLegionIntermission4Syndicate` for Nora's Choice
29 - `RadioLegionIntermission3Syndicate` for Intermission III
30 - `RadioLegion3Syndicate` for Glassmaker
31 - `RadioLegionIntermission2Syndicate` for Intermission II
32 - `RadioLegion2Syndicate` for The Emissary
33 - `RadioLegionIntermissionSyndicate` for Intermission I
34 - `RadioLegionSyndicate` for The Wolf of Saturn Six
Modified config.json.example +2 -1
@@ -55,6 +55,7 @@
55 55 "affinityBoost": false,
56 56 "resourceBoost": false,
57 57 "starDays": true,
58 "lockTime": 0
58 "lockTime": 0,
59 "nightwaveOverride": ""
59 60 }
60 61 }
Modified src/services/configService.ts +1 -0
@@ -62,6 +62,7 @@ interface IConfig {
62 62 resourceBoost?: boolean;
63 63 starDays?: boolean;
64 64 lockTime?: number;
65 nightwaveOverride?: string;
65 66 };
66 67 }
67 68
Modified src/services/worldStateService.ts +54 -23
@@ -348,6 +348,7 @@ interface IRotatingSeasonChallengePools {
348 348 daily: string[];
349 349 weekly: string[];
350 350 hardWeekly: string[];
351 hasWeeklyPermanent: boolean;
351 352 }
352 353
353 354 const getSeasonChallengePools = (syndicateTag: string): IRotatingSeasonChallengePools => {
@@ -359,7 +360,12 @@ const getSeasonChallengePools = (syndicateTag: string): IRotatingSeasonChallenge
359 360 x.startsWith("/Lotus/Types/Challenges/Seasons/Weekly/") &&
360 361 !x.startsWith("/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanent")
361 362 ),
362 hardWeekly: syndicate.weeklyChallenges!.filter(x => x.startsWith("/Lotus/Types/Challenges/Seasons/WeeklyHard/"))
363 hardWeekly: syndicate.weeklyChallenges!.filter(x =>
364 x.startsWith("/Lotus/Types/Challenges/Seasons/WeeklyHard/")
365 ),
366 hasWeeklyPermanent: !!syndicate.weeklyChallenges!.find(x =>
367 x.startsWith("/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanent")
368 )
363 369 };
364 370 };
365 371
@@ -416,26 +422,34 @@ const pushWeeklyActs = (
416 422
417 423 activeChallenges.push(getSeasonWeeklyChallenge(pools, week, 0));
418 424 activeChallenges.push(getSeasonWeeklyChallenge(pools, week, 1));
419 activeChallenges.push(getSeasonWeeklyHardChallenge(pools, week, 2));
420 activeChallenges.push(getSeasonWeeklyHardChallenge(pools, week, 3));
421 activeChallenges.push({
422 _id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 0).toString().padStart(8, "0") },
423 Activation: { $date: { $numberLong: weekStart.toString() } },
424 Expiry: { $date: { $numberLong: weekEnd.toString() } },
425 Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentCompleteMissions"
426 });
427 activeChallenges.push({
428 _id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 1).toString().padStart(8, "0") },
429 Activation: { $date: { $numberLong: weekStart.toString() } },
430 Expiry: { $date: { $numberLong: weekEnd.toString() } },
431 Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEximus"
432 });
433 activeChallenges.push({
434 _id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 2).toString().padStart(8, "0") },
435 Activation: { $date: { $numberLong: weekStart.toString() } },
436 Expiry: { $date: { $numberLong: weekEnd.toString() } },
437 Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEnemies"
438 });
425 if (pools.hasWeeklyPermanent) {
426 activeChallenges.push({
427 _id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 0).toString().padStart(8, "0") },
428 Activation: { $date: { $numberLong: weekStart.toString() } },
429 Expiry: { $date: { $numberLong: weekEnd.toString() } },
430 Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentCompleteMissions"
431 });
432 activeChallenges.push({
433 _id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 1).toString().padStart(8, "0") },
434 Activation: { $date: { $numberLong: weekStart.toString() } },
435 Expiry: { $date: { $numberLong: weekEnd.toString() } },
436 Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEximus"
437 });
438 activeChallenges.push({
439 _id: { $oid: "67e1b96e9d00cb47" + (week * 7 + 2).toString().padStart(8, "0") },
440 Activation: { $date: { $numberLong: weekStart.toString() } },
441 Expiry: { $date: { $numberLong: weekEnd.toString() } },
442 Challenge: "/Lotus/Types/Challenges/Seasons/Weekly/SeasonWeeklyPermanentKillEnemies"
443 });
444 activeChallenges.push(getSeasonWeeklyHardChallenge(pools, week, 2));
445 activeChallenges.push(getSeasonWeeklyHardChallenge(pools, week, 3));
446 } else {
447 activeChallenges.push(getSeasonWeeklyChallenge(pools, week, 2));
448 activeChallenges.push(getSeasonWeeklyChallenge(pools, week, 3));
449 activeChallenges.push(getSeasonWeeklyChallenge(pools, week, 4));
450 activeChallenges.push(getSeasonWeeklyHardChallenge(pools, week, 5));
451 activeChallenges.push(getSeasonWeeklyHardChallenge(pools, week, 6));
452 }
439 453 };
440 454
441 455 export const pushClassicBounties = (syndicateMissions: ISyndicateMissionInfo[], bountyCycle: number): void => {
@@ -1258,6 +1272,9 @@ export const isArchwingMission = (node: IRegion): boolean => {
1258 1272 };
1259 1273
1260 1274 export const getNightwaveSyndicateTag = (buildLabel: string | undefined): string | undefined => {
1275 if (config.worldState?.nightwaveOverride) {
1276 return config.worldState.nightwaveOverride;
1277 }
1261 1278 if (!buildLabel || version_compare(buildLabel, "2025.05.20.10.18") >= 0) {
1262 1279 return "RadioLegionIntermission13Syndicate";
1263 1280 }
@@ -1268,6 +1285,20 @@ export const getNightwaveSyndicateTag = (buildLabel: string | undefined): string
1268 1285 };
1269 1286
1270 1287 const nightwaveTagToSeason: Record<string, number> = {
1271 RadioLegionIntermission13Syndicate: 15,
1272 RadioLegionIntermission12Syndicate: 14
1288 RadioLegionIntermission13Syndicate: 15, // Nora's Mix Vol. 9
1289 RadioLegionIntermission12Syndicate: 14, // Nora's Mix Vol. 8
1290 RadioLegionIntermission11Syndicate: 13, // Nora's Mix Vol. 7
1291 RadioLegionIntermission10Syndicate: 12, // Nora's Mix Vol. 6
1292 RadioLegionIntermission9Syndicate: 11, // Nora's Mix Vol. 5
1293 RadioLegionIntermission8Syndicate: 10, // Nora's Mix Vol. 4
1294 RadioLegionIntermission7Syndicate: 9, // Nora's Mix Vol. 3
1295 RadioLegionIntermission6Syndicate: 8, // Nora's Mix Vol. 2
1296 RadioLegionIntermission5Syndicate: 7, // Nora's Mix Vol. 1
1297 RadioLegionIntermission4Syndicate: 6, // Nora's Choice
1298 RadioLegionIntermission3Syndicate: 5, // Intermission III
1299 RadioLegion3Syndicate: 4, // Glassmaker
1300 RadioLegionIntermission2Syndicate: 3, // Intermission II
1301 RadioLegion2Syndicate: 2, // The Emissary
1302 RadioLegionIntermissionSyndicate: 1, // Intermission I
1303 RadioLegionSyndicate: 0 // The Wolf of Saturn Six
1273 1304 };