feat: handle QueuedDialogues in saveDialogue #1524

Merged
Sainan merged 1 commits from queued-dialogues into main 2025-04-09 15:30:59 -07:00
3 changed files with 6 additions and 5 deletions

View File

@ -21,7 +21,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
if (!inventory.DialogueHistory) {
throw new Error("bad inventory state");
}
if (request.QueuedDialogues.length != 0 || request.OtherDialogueInfos.length != 0) {
if (request.OtherDialogueInfos.length != 0) {
logger.error(`saveDialogue request not fully handled: ${String(req.body)}`);
}
inventory.DialogueHistory.Dialogues ??= [];
@ -36,6 +36,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
AvailableGiftDate: new Date(0),
RankUpExpiry: new Date(0),
BountyChemExpiry: new Date(0),
QueuedDialogues: [],
Gifts: [],
Booleans: [],
Completed: [],
@ -45,7 +46,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
}
dialogue.Rank = request.Rank;
dialogue.Chemistry = request.Chemistry;
//dialogue.QueuedDialogues = request.QueuedDialogues;
dialogue.QueuedDialogues = request.QueuedDialogues;
for (const bool of request.Booleans) {
dialogue.Booleans.push(bool);
}
@ -77,7 +78,7 @@ interface SaveCompletedDialogueRequest {
Rank: number;
Chemistry: number;
CompletionType: number;
QueuedDialogues: string[]; // unsure
QueuedDialogues: string[];
Booleans: string[];
ResetBooleans: string[];
Data: ICompletedDialogue;

View File

@ -773,7 +773,7 @@ const dialogueSchema = new Schema<IDialogueDatabase>(
AvailableGiftDate: Date,
RankUpExpiry: Date,
BountyChemExpiry: Date,
//QueuedDialogues: ???
QueuedDialogues: { type: [String], default: [] },
Gifts: { type: [dialogueGiftSchema], default: [] },
Booleans: { type: [String], default: [] },
Completed: { type: [completedDialogueSchema], default: [] },

View File

@ -1089,7 +1089,7 @@ export interface IDialogueClient {
AvailableGiftDate: IMongoDate;
RankUpExpiry: IMongoDate;
BountyChemExpiry: IMongoDate;
//QueuedDialogues: any[];
QueuedDialogues: string[];
Gifts: IDialogueGift[];
Booleans: string[];
Completed: ICompletedDialogue[];