From ddc9b9fce184648418583be858ab14024ac51ca2 Mon Sep 17 00:00:00 2001 From: Sainan Date: Tue, 18 Jun 2024 20:21:54 +0200 Subject: [PATCH] update unlockAllQuests to use ExportKeys --- src/controllers/api/inventoryController.ts | 11 +++--- static/fixed_responses/allQuestKeys.json | 39 ---------------------- 2 files changed, 6 insertions(+), 44 deletions(-) delete mode 100644 static/fixed_responses/allQuestKeys.json diff --git a/src/controllers/api/inventoryController.ts b/src/controllers/api/inventoryController.ts index 36cb9a44..7d922ea2 100644 --- a/src/controllers/api/inventoryController.ts +++ b/src/controllers/api/inventoryController.ts @@ -5,12 +5,11 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel"; import { Request, RequestHandler, Response } from "express"; import { config } from "@/src/services/configService"; import allMissions from "@/static/fixed_responses/allMissions.json"; -import allQuestKeys from "@/static/fixed_responses/allQuestKeys.json"; import allShipDecorations from "@/static/fixed_responses/allShipDecorations.json"; import allSkins from "@/static/fixed_responses/allSkins.json"; import { ILoadoutDatabase } from "@/src/types/saveLoadoutTypes"; import { IShipInventory } from "@/src/types/inventoryTypes/inventoryTypes"; -import { ExportFlavour } from "warframe-public-export-plus"; +import { ExportFlavour, ExportKeys } from "warframe-public-export-plus"; const inventoryController: RequestHandler = async (request: Request, response: Response) => { let accountId; @@ -51,9 +50,11 @@ const inventoryController: RequestHandler = async (request: Request, response: R } if (config.unlockAllQuests) { - for (const questKey of allQuestKeys) { - if (!inventoryResponse.QuestKeys.find(quest => quest.ItemType == questKey)) { - inventoryResponse.QuestKeys.push({ ItemType: questKey }); + for (const [k, v] of Object.entries(ExportKeys)) { + if ("chainStages" in v) { + if (!inventoryResponse.QuestKeys.find(quest => quest.ItemType == k)) { + inventoryResponse.QuestKeys.push({ ItemType: k }); + } } } } diff --git a/static/fixed_responses/allQuestKeys.json b/static/fixed_responses/allQuestKeys.json deleted file mode 100644 index 6bad0a80..00000000 --- a/static/fixed_responses/allQuestKeys.json +++ /dev/null @@ -1,39 +0,0 @@ -[ - "/Lotus/Types/Keys/VorsPrize/VorsPrizeQuestKeyChain", - "/Lotus/Types/Keys/GlassQuest/GlassQuestKeyChain", - "/Lotus/Types/Keys/SolarisQuest/SolarisQuestKeyChain", - "/Lotus/Types/Keys/InfestedIntroQuest/InfestedIntroQuestKeyChain", - "/Lotus/Types/Keys/KubrowQuest/KubrowQuestKeyChain", - "/Lotus/Types/Keys/ArchwingQuest/ArchwingQuestKeyChain", - "/Lotus/Types/Keys/GetClemQuest/GetClemQuestKeyChain", - "/Lotus/Types/Keys/SpyQuestKeyChain/SpyQuestKeyChain", - "/Lotus/Types/Keys/DragonQuest/DragonQuestKeyChain", - "/Lotus/Types/Keys/LimboQuest/LimboQuestKeyChain", - "/Lotus/Types/Keys/SentientQuest/SentientQuestKeyChain", - "/Lotus/Types/Keys/OrokinMoonQuest/OrokinMoonQuestKeyChain", - "/Lotus/Types/Keys/MirageQuest/MirageQuestKeyChain", - "/Lotus/Types/Keys/WarWithinQuest/WarWithinQuestKeyChain", - "/Lotus/Types/Keys/InfestedAladVQuest/InfestedAladVQuestKeyChain", - "/Lotus/Types/Keys/GolemQuest/GolemQuestKeyChainItem", - "/Lotus/Types/Keys/BardQuest/BardQuestKeyChain", - "/Lotus/Types/Keys/FairyQuest/FairyQuestKeyChain", - "/Lotus/Types/Keys/IndexQuest/IndexQuestKeyChain", - "/Lotus/Types/Keys/PriestFrameQuest/PriestQuestKeyChain", - "/Lotus/Types/Keys/ApostasyQuest/ApostasyKeyChain", - "/Lotus/Types/Keys/SacrificeQuest/SacrificeQuestKeyChain", - "/Lotus/Types/Keys/ChimeraQuest/ChimeraKeyChain", - "/Lotus/Types/Keys/MummyQuest/MummyQuestKeyChain", - "/Lotus/Types/Keys/RailJackBuildQuest/RailjackBuildQuestKeyChain", - "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain", - "/Lotus/Types/Keys/ProteaQuest/ProteaQuestKeyChain", - "/Lotus/Types/Keys/RevenantQuest/RevenantQuestKeyChain", - "/Lotus/Types/Keys/InfestedMicroplanetQuest/InfestedMicroplanetQuestKeyChain", - "/Lotus/Types/Keys/WraithQuest/WraithQuestKeyChain", - "/Lotus/Types/Keys/YareliQuest/YareliQuestKeyChain", - "/Lotus/Types/Keys/NewWarQuest/NewWarQuestKeyChain", - "/Lotus/Types/Keys/ZarimanQuest/ZarimanQuestKeyChain", - "/Lotus/Types/Keys/KahlQuest/KahlQuestKeyChain", - "/Lotus/Types/Keys/DuviriQuest/DuviriQuestKeyChain", - "/Lotus/Types/Keys/EntratiLab/EntratiQuestKeyChain", - "/Lotus/Types/Keys/JadeShadows/JadeShadowQuestKeyChain" -]