返回提交历史
Modified
src/services/missionInventoryUpdateService.ts
+29
-0
Modified
src/types/requestTypes.ts
+4
-0
XFEstudio/SpaceNinjaServer
fix: save nightwave challenges & sortie/archon hunt completion (#933)
Closes #932, Closes #468 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/933 Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com> Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
78638338
代码差异
2 个文件
+33
-0
@@ -83,6 +83,19 @@ export const addMissionInventoryUpdates = (
83
83
if (inventoryUpdates.MissionFailed === true) {
84
84
return;
85
85
}
86
if (inventoryUpdates.RewardInfo && inventoryUpdates.RewardInfo.periodicMissionTag) {
87
const tag = inventoryUpdates.RewardInfo.periodicMissionTag;
88
const existingCompletion = inventory.PeriodicMissionCompletions.find(completion => completion.tag === tag);
89
90
if (existingCompletion) {
91
existingCompletion.date = new Date();
92
} else {
93
inventory.PeriodicMissionCompletions.push({
94
tag: tag,
95
date: new Date()
96
});
97
}
98
}
86
99
for (const [key, value] of getEntriesUnsafe(inventoryUpdates)) {
87
100
if (value === undefined) {
88
101
logger.error(`Inventory update key ${key} has no value `);
@@ -178,6 +191,22 @@ export const addMissionInventoryUpdates = (
178
191
});
179
192
break;
180
193
}
194
case "SyndicateId": {
195
inventory.CompletedSyndicates.push(value);
196
break;
197
}
198
case "SortieId": {
199
inventory.CompletedSorties.push(value);
200
break;
201
}
202
case "SeasonChallengeCompletions":
203
const processedCompletions = value.map(({ challenge, id }) => ({
204
challenge: challenge.substring(challenge.lastIndexOf("/") + 1),
205
id
206
}));
207
208
inventory.SeasonChallengeHistory.push(...processedCompletions);
209
break;
181
210
default:
182
211
// Equipment XP updates
183
212
if (equipmentKeys.includes(key as TEquipmentKey)) {
@@ -44,6 +44,9 @@ export type IMissionInventoryUpdateRequest = {
44
44
CrewShipAmmo?: ITypeCount[];
45
45
BonusMiscItems?: ITypeCount[];
46
46
47
SyndicateId?: string;
48
SortieId?: string;
49
SeasonChallengeCompletions?: ISeasonChallenge[];
47
50
AffiliationChanges?: IAffiliationChange[];
48
51
crossPlaySetting?: string;
49
52
rewardsMultiplier?: number;
@@ -100,6 +103,7 @@ export interface IRewardInfo {
100
103
rewardQualifications?: string; // did a Survival for 5 minutes and this was "1"
101
104
PurgatoryRewardQualifications?: string;
102
105
rewardSeed?: number;
106
periodicMissionTag?: string;
103
107
}
104
108
105
109
export type IMissionStatus = "GS_SUCCESS" | "GS_FAILURE" | "GS_DUMPED" | "GS_QUIT" | "GS_INTERRUPTED";