From 7710e7c13fe3bf4a1c7e8d8bdbea7782c0b665ef Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Mon, 29 Sep 2025 02:00:05 -0700 Subject: [PATCH] feat: inbox message for relics cracked during an unfinished mission (#2823) Closes #2821 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2823 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/loginController.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/controllers/api/loginController.ts b/src/controllers/api/loginController.ts index beac741e..3a703b7b 100644 --- a/src/controllers/api/loginController.ts +++ b/src/controllers/api/loginController.ts @@ -9,6 +9,9 @@ import type { IDatabaseAccountJson, ILoginRequest, ILoginResponse } from "../../ import { logger } from "../../utils/logger.ts"; import { version_compare } from "../../helpers/inventoryHelpers.ts"; import { handleNonceInvalidation } from "../../services/wsService.ts"; +import { getInventory } from "../../services/inventoryService.ts"; +import { createMessage } from "../../services/inboxService.ts"; +import { fromStoreItem } from "../../services/itemDataService.ts"; export const loginController: RequestHandler = async (request, response) => { const loginRequest = JSON.parse(String(request.body)) as ILoginRequest; // parse octet stream of json data to json object @@ -76,6 +79,24 @@ export const loginController: RequestHandler = async (request, response) => { handleNonceInvalidation(account._id.toString()); + // If the client crashed during an endless fissure mission, discharge rewards to an inbox message. (https://www.reddit.com/r/Warframe/comments/5uwwjm/til_if_you_crash_during_a_fissure_you_keep_any/) + const inventory = await getInventory(account._id.toString(), "MissionRelicRewards"); + if (inventory.MissionRelicRewards) { + await createMessage(account._id, [ + { + sndr: "/Lotus/Language/Bosses/Ordis", + msg: "/Lotus/Language/Menu/VoidProjectionItemsMessage", + sub: "/Lotus/Language/Menu/VoidProjectionItemsSubject", + icon: "/Lotus/Interface/Icons/Npcs/Ordis.png", + countedAtt: inventory.MissionRelicRewards.map(x => ({ ...x, ItemType: fromStoreItem(x.ItemType) })), + attVisualOnly: true, + highPriority: true // TOVERIFY + } + ]); + inventory.MissionRelicRewards = undefined; + await inventory.save(); + } + response.json(createLoginResponse(myAddress, myUrlBase, account.toJSON(), buildLabel)); };