fix(webui): quest cheats #965
@ -39,7 +39,16 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        case "completeAll": {
 | 
					        case "completeAll": {
 | 
				
			||||||
            logger.info("completing all quests..");
 | 
					            logger.info("completing all quests..");
 | 
				
			||||||
            for (const questKey of allQuestKeys) {
 | 
					            for (const questKey of allQuestKeys) {
 | 
				
			||||||
 | 
					                try {
 | 
				
			||||||
                    await completeQuest(inventory, questKey);
 | 
					                    await completeQuest(inventory, questKey);
 | 
				
			||||||
 | 
					                } catch (error) {
 | 
				
			||||||
 | 
					                    if (error instanceof Error) {
 | 
				
			||||||
 | 
					                        logger.error(
 | 
				
			||||||
 | 
					                            `Something went wrong completing quest ${questKey}, probably could not add some item`
 | 
				
			||||||
 | 
					                        );
 | 
				
			||||||
 | 
					                        logger.error(error.message);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                //Skip "Watch The Maker"
 | 
					                //Skip "Watch The Maker"
 | 
				
			||||||
                if (questKey === "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain") {
 | 
					                if (questKey === "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain") {
 | 
				
			||||||
@ -70,7 +79,16 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
            logger.info("completing all unlocked quests..");
 | 
					            logger.info("completing all unlocked quests..");
 | 
				
			||||||
            for (const questKey of inventory.QuestKeys) {
 | 
					            for (const questKey of inventory.QuestKeys) {
 | 
				
			||||||
                console.log("size of questkeys", inventory.QuestKeys.length);
 | 
					                console.log("size of questkeys", inventory.QuestKeys.length);
 | 
				
			||||||
 | 
					                try {
 | 
				
			||||||
                    await completeQuest(inventory, questKey.ItemType);
 | 
					                    await completeQuest(inventory, questKey.ItemType);
 | 
				
			||||||
 | 
					                } catch (error) {
 | 
				
			||||||
 | 
					                    if (error instanceof Error) {
 | 
				
			||||||
 | 
					                        logger.error(
 | 
				
			||||||
 | 
					                            `Something went wrong completing quest ${questKey.ItemType}, probably could not add some item`
 | 
				
			||||||
 | 
					                        );
 | 
				
			||||||
 | 
					                        logger.error(error.message);
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                //Skip "Watch The Maker"
 | 
					                //Skip "Watch The Maker"
 | 
				
			||||||
                if (questKey.ItemType === "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain") {
 | 
					                if (questKey.ItemType === "/Lotus/Types/Keys/NewWarIntroQuest/NewWarIntroKeyChain") {
 | 
				
			||||||
 | 
				
			|||||||
@ -367,7 +367,7 @@ export const addItem = async (
 | 
				
			|||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    if (typeName in ExportKeys) {
 | 
					    if (typeName in ExportKeys) {
 | 
				
			||||||
        // Note: "/Lotus/Types/Keys/" contains some EmailItems and ShipFeatureItems
 | 
					        // Note: "/Lotus/Types/Keys/" contains some EmailItems
 | 
				
			||||||
        inventory.QuestKeys.push({ ItemType: typeName });
 | 
					        inventory.QuestKeys.push({ ItemType: typeName });
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            InventoryChanges: {
 | 
					            InventoryChanges: {
 | 
				
			||||||
@ -519,9 +519,7 @@ export const addItem = async (
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            break;
 | 
					            break;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    const errorMessage = `unable to add item: ${typeName}`;
 | 
					    throw new Error(`unable to add item: ${typeName}`);
 | 
				
			||||||
    logger.error(errorMessage);
 | 
					 | 
				
			||||||
    return { InventoryChanges: { Error: [{ Error: errorMessage }] } };
 | 
					 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const addItems = async (
 | 
					export const addItems = async (
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user