XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

feat: handle QueuedDialogues in saveDialogue (#1524)

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

74f9d156
Sainan <63328889+Sainan@users.noreply.github.com>
提交于

代码差异

3 个文件 +6 -5
Modified src/controllers/api/saveDialogueController.ts +4 -3
@@ -21,7 +21,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
21 21 if (!inventory.DialogueHistory) {
22 22 throw new Error("bad inventory state");
23 23 }
24 if (request.QueuedDialogues.length != 0 || request.OtherDialogueInfos.length != 0) {
24 if (request.OtherDialogueInfos.length != 0) {
25 25 logger.error(`saveDialogue request not fully handled: ${String(req.body)}`);
26 26 }
27 27 inventory.DialogueHistory.Dialogues ??= [];
@@ -36,6 +36,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
36 36 AvailableGiftDate: new Date(0),
37 37 RankUpExpiry: new Date(0),
38 38 BountyChemExpiry: new Date(0),
39 QueuedDialogues: [],
39 40 Gifts: [],
40 41 Booleans: [],
41 42 Completed: [],
@@ -45,7 +46,7 @@ export const saveDialogueController: RequestHandler = async (req, res) => {
45 46 }
46 47 dialogue.Rank = request.Rank;
47 48 dialogue.Chemistry = request.Chemistry;
48 //dialogue.QueuedDialogues = request.QueuedDialogues;
49 dialogue.QueuedDialogues = request.QueuedDialogues;
49 50 for (const bool of request.Booleans) {
50 51 dialogue.Booleans.push(bool);
51 52 }
@@ -77,7 +78,7 @@ interface SaveCompletedDialogueRequest {
77 78 Rank: number;
78 79 Chemistry: number;
79 80 CompletionType: number;
80 QueuedDialogues: string[]; // unsure
81 QueuedDialogues: string[];
81 82 Booleans: string[];
82 83 ResetBooleans: string[];
83 84 Data: ICompletedDialogue;
Modified src/models/inventoryModels/inventoryModel.ts +1 -1
@@ -773,7 +773,7 @@ const dialogueSchema = new Schema<IDialogueDatabase>(
773 773 AvailableGiftDate: Date,
774 774 RankUpExpiry: Date,
775 775 BountyChemExpiry: Date,
776 //QueuedDialogues: ???
776 QueuedDialogues: { type: [String], default: [] },
777 777 Gifts: { type: [dialogueGiftSchema], default: [] },
778 778 Booleans: { type: [String], default: [] },
779 779 Completed: { type: [completedDialogueSchema], default: [] },
Modified src/types/inventoryTypes/inventoryTypes.ts +1 -1
@@ -1091,7 +1091,7 @@ export interface IDialogueClient {
1091 1091 AvailableGiftDate: IMongoDate;
1092 1092 RankUpExpiry: IMongoDate;
1093 1093 BountyChemExpiry: IMongoDate;
1094 //QueuedDialogues: any[];
1094 QueuedDialogues: string[];
1095 1095 Gifts: IDialogueGift[];
1096 1096 Booleans: string[];
1097 1097 Completed: ICompletedDialogue[];