返回提交历史
Modified
src/services/inventoryService.ts
+9
-4
Modified
src/types/inventoryTypes/inventoryTypes.ts
+21
-11
XFEstudio/XFESpaceNinjaServer
fix: handle people having no memories of tau (#3840)
Closes #3835 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3840 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
4f5451e2
代码差异
2 个文件
+30
-15
@@ -26,7 +26,8 @@ import type {
26
26
IDialogueDatabase,
27
27
IKubrowPetPrintClient,
28
28
IWeeklyMissionChallengeInfo,
29
IKubrowPetEgg
29
IKubrowPetEgg,
30
ITauPrequelQuestCustomData
30
31
} from "../types/inventoryTypes/inventoryTypes.ts";
31
32
import { InventorySlot, equipmentKeys } from "../types/inventoryTypes/inventoryTypes.ts";
32
33
import type { IGenericUpdate, IUpdateNodeIntrosResponse } from "../types/genericUpdate.ts";
@@ -3070,9 +3071,13 @@ export const handleTauMemories = async (inventory: TInventoryDatabaseDocument):
3070
3071
x => x.ItemType == "/Lotus/Types/Keys/TauPrequel/TauPrequelQuestKeyChain"
3071
3072
);
3072
3073
if (oldPeace?.Completed) {
3073
oldPeace.CustomData ||= `{"ChosenMemories":{"TauPrequelStage11_PoolA":{"Name":"cat0","Choice":1},"TauPrequelStage13_PoolA":{"Name":"cat1","Choice":1},"TauPrequelStage14_PoolA":{"Name":"cat2","Choice":1}}}`;
3074
const customData = JSON.parse(oldPeace.CustomData) as {
3075
ChosenMemories: { InboxMessageSent?: boolean } & Record<string, { Name: string; Choice: number }>;
3074
oldPeace.CustomData ||= `{}`;
3075
const customData = JSON.parse(oldPeace.CustomData) as ITauPrequelQuestCustomData;
3076
// If the user didn't pick any memories during the quest, ChosenMemories would not exist. TOVERIFY: What is the expected behaviour in that case?
3077
customData.ChosenMemories ??= {
3078
TauPrequelStage11_PoolA: { Name: "cat0", Choice: 1 },
3079
TauPrequelStage13_PoolA: { Name: "cat1", Choice: 1 },
3080
TauPrequelStage14_PoolA: { Name: "cat2", Choice: 1 }
3076
3081
};
3077
3082
if (!customData.ChosenMemories.InboxMessageSent) {
3078
3083
customData.ChosenMemories.InboxMessageSent = true;
@@ -218,6 +218,27 @@ export interface IQuestKeyDatabase {
218
218
CompletionDate?: Date;
219
219
}
220
220
221
export interface IQuestKeyClient extends Omit<IQuestKeyDatabase, "CompletionDate"> {
222
CompletionDate?: IMongoDate;
223
}
224
225
export interface IQuestStage {
226
c: number;
227
i: boolean;
228
m: boolean;
229
b: any[];
230
}
231
232
export interface ITauPrequelQuestCustomData {
233
ChosenMemories?: Record<string, { Name: string; Choice: number }> & { InboxMessageSent?: boolean };
234
AsyncMissionAssistDeploys?: {
235
MissionTag: string;
236
LoadOutSaveOption: number;
237
DeploymentType: string;
238
LocationTag: string;
239
}[]; // TODO: Should we maybe handle these deploys in some way (in asyncMissionAssistController)?
240
}
241
221
242
export const equipmentKeys = [
222
243
"Suits",
223
244
"LongGuns",
@@ -1078,17 +1099,6 @@ export interface IPlayerSkills {
1078
1099
LPS_DRIFT_ENDURANCE: number;
1079
1100
}
1080
1101
1081
export interface IQuestKeyClient extends Omit<IQuestKeyDatabase, "CompletionDate"> {
1082
CompletionDate?: IMongoDate;
1083
}
1084
1085
export interface IQuestStage {
1086
c: number;
1087
i: boolean;
1088
m: boolean;
1089
b: any[];
1090
}
1091
1092
1102
export interface IRawUpgrade {
1093
1103
ItemType: string;
1094
1104
ItemCount: number;