返回提交历史
Modified
src/controllers/api/loginController.ts
+1
-1
Modified
src/services/worldStateService.ts
+56
-31
Modified
src/types/worldStateTypes.ts
+8
-1
XFEstudio/SpaceNinjaServer
feat: EndlessXpSchedule (#4099)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/4099 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
45376464
代码差异
3 个文件
+65
-33
@@ -67,7 +67,7 @@ export const loginController: RequestHandler = async (request, response) => {
67
67
if (args.dev) {
68
68
logger.debug(`We are eagerly awaiting your pull requests!`);
69
69
} else {
70
response.status(400).json({ error: "do you want me to change your diapers, too?" });
70
response.status(400).json({ error: "I'm making a list and checking it twice" });
71
71
return;
72
72
}
73
73
}
@@ -37,7 +37,8 @@ import type {
37
37
IWorldState,
38
38
TCircuitGameMode,
39
39
IFlashSale,
40
IAlertMissionInfo
40
IAlertMissionInfo,
41
IEndlessXpChoice
41
42
} from "../types/worldStateTypes.ts";
42
43
import { toMongoDate2, toOid, toOid2, version_compare } from "../helpers/inventoryHelpers.ts";
43
44
import { logger } from "../utils/logger.ts";
@@ -1893,7 +1894,8 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
1893
1894
VoidStorms: [],
1894
1895
DailyDeals: [],
1895
1896
//LibraryInfo: {},
1896
EndlessXpChoices: [],
1897
//EndlessXpChoices: [],
1898
//EndlessXpSchedule: [],
1897
1899
KnownCalendarSeasons: [],
1898
1900
PVPChallengeInstances: [],
1899
1901
FeaturedGuilds: [],
@@ -4302,35 +4304,24 @@ export const getWorldState = (buildLabel?: string): IWorldState => {
4302
4304
}
4303
4305
4304
4306
// Circuit choices cycling every week
4305
worldState.EndlessXpChoices.push({
4306
Category: "EXC_NORMAL",
4307
Choices: [
4308
["Nidus", "Octavia", "Harrow"],
4309
["Gara", "Khora", "Revenant"],
4310
["Garuda", "Baruuk", "Hildryn"],
4311
["Excalibur", "Trinity", "Ember"],
4312
["Loki", "Mag", "Rhino"],
4313
["Ash", "Frost", "Nyx"],
4314
["Saryn", "Vauban", "Nova"],
4315
["Nekros", "Valkyr", "Oberon"],
4316
["Hydroid", "Mirage", "Limbo"],
4317
["Mesa", "Chroma", "Atlas"],
4318
["Ivara", "Inaros", "Titania"]
4319
][week % 11]
4320
});
4321
worldState.EndlessXpChoices.push({
4322
Category: "EXC_HARD",
4323
Choices: [
4324
["Boar", "Gammacor", "Angstrum", "Gorgon", "Anku"],
4325
["Bo", "Latron", "Furis", "Furax", "Strun"],
4326
["Lex", "Magistar", "Boltor", "Bronco", "CeramicDagger"],
4327
["Torid", "DualToxocyst", "DualIchor", "Miter", "Atomos"],
4328
["AckAndBrunt", "Soma", "Vasto", "NamiSolo", "Burston"],
4329
["Zylok", "Sibear", "Dread", "Despair", "Hate"],
4330
["Dera", "Sybaris", "Cestra", "Sicarus", "Okina"],
4331
["Braton", "Lato", "Skana", "Paris", "Kunai"]
4332
][week % 8]
4333
});
4307
if (!buildLabel || version_compare(buildLabel, gameToBuildVersion["42.0.0"]) >= 0) {
4308
worldState.EndlessXpSchedule = [
4309
{
4310
Activation: { $date: { $numberLong: weekStart.toString() } },
4311
Expiry: { $date: { $numberLong: weekEnd.toString() } },
4312
CategoryChoices: getEndlessXpChoices(week)
4313
}
4314
];
4315
if (isBeforeNextExpectedWorldStateRefresh(timeMs, weekEnd)) {
4316
worldState.EndlessXpSchedule.push({
4317
Activation: { $date: { $numberLong: (weekStart + 604800000).toString() } },
4318
Expiry: { $date: { $numberLong: (weekEnd + 604800000).toString() } },
4319
CategoryChoices: getEndlessXpChoices(week)
4320
});
4321
}
4322
} else {
4323
worldState.EndlessXpChoices = getEndlessXpChoices(week);
4324
}
4334
4325
4335
4326
// 1999 Calendar Season cycling every week + YearIteration every 4 weeks
4336
4327
worldState.KnownCalendarSeasons.push(getCalendarSeason(week));
@@ -4613,6 +4604,40 @@ export const getLiteSortie = (week: number): ILiteSortie => {
4613
4604
};
4614
4605
};
4615
4606
4607
const getEndlessXpChoices = (week: number): IEndlessXpChoice[] => {
4608
return [
4609
{
4610
Category: "EXC_NORMAL",
4611
Choices: [
4612
["Nidus", "Octavia", "Harrow"],
4613
["Gara", "Khora", "Revenant"],
4614
["Garuda", "Baruuk", "Hildryn"],
4615
["Excalibur", "Trinity", "Ember"],
4616
["Loki", "Mag", "Rhino"],
4617
["Ash", "Frost", "Nyx"],
4618
["Saryn", "Vauban", "Nova"],
4619
["Nekros", "Valkyr", "Oberon"],
4620
["Hydroid", "Mirage", "Limbo"],
4621
["Mesa", "Chroma", "Atlas"],
4622
["Ivara", "Inaros", "Titania"]
4623
][week % 11]
4624
},
4625
{
4626
Category: "EXC_HARD",
4627
Choices: [
4628
["Boar", "Gammacor", "Angstrum", "Gorgon", "Anku"],
4629
["Bo", "Latron", "Furis", "Furax", "Strun"],
4630
["Lex", "Magistar", "Boltor", "Bronco", "CeramicDagger"],
4631
["Torid", "DualToxocyst", "DualIchor", "Miter", "Atomos"],
4632
["AckAndBrunt", "Soma", "Vasto", "NamiSolo", "Burston"],
4633
["Zylok", "Sibear", "Dread", "Despair", "Hate"],
4634
["Dera", "Sybaris", "Cestra", "Sicarus", "Okina"],
4635
["Braton", "Lato", "Skana", "Paris", "Kunai"]
4636
][week % 8]
4637
}
4638
];
4639
};
4640
4616
4641
export const isArchwingMission = (node: IRegion): boolean => {
4617
4642
if (node.name.indexOf("Archwing") != -1) {
4618
4643
return true;
@@ -35,7 +35,8 @@ export interface IWorldState {
35
35
LastCompletedTargetType?: string;
36
36
};
37
37
PVPChallengeInstances: IPVPChallengeInstance[];
38
EndlessXpChoices: IEndlessXpChoice[];
38
EndlessXpChoices?: IEndlessXpChoice[]; // < U42
39
EndlessXpSchedule?: IEndlessXpScheduleEntry[]; // >= U42
39
40
FeaturedGuilds: IFeaturedGuild[];
40
41
SeasonInfo?: {
41
42
Activation: IMongoDate; // Nightwave was introduced in U24 so this is fine
@@ -397,6 +398,12 @@ export interface IEndlessXpChoice {
397
398
Choices: string[];
398
399
}
399
400
401
export interface IEndlessXpScheduleEntry {
402
Activation: IMongoDate;
403
Expiry: IMongoDate;
404
CategoryChoices: IEndlessXpChoice[];
405
}
406
400
407
export interface IFeaturedGuild {
401
408
_id: IOid;
402
409
Name: string;