From 564aa06762819c4f297531bf116f365c1b3fedb5 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Sun, 27 Jul 2025 06:29:12 -0700 Subject: [PATCH] fix: correctly apply riven cipher (#2554) The completeRandomModChallenge endpoint is only supposed to complete the challenge, what a shocker. Because we directly set a unveiled fingerprint, the game was not showing the expected UI. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2554 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- .../api/completeRandomModChallengeController.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/controllers/api/completeRandomModChallengeController.ts b/src/controllers/api/completeRandomModChallengeController.ts index a4e3cf08..0400c2b0 100644 --- a/src/controllers/api/completeRandomModChallengeController.ts +++ b/src/controllers/api/completeRandomModChallengeController.ts @@ -4,8 +4,7 @@ import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inven import { IInventoryChanges } from "@/src/types/purchaseTypes"; import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes"; import { getJSONfromString } from "@/src/helpers/stringHelpers"; -import { createUnveiledRivenFingerprint } from "@/src/helpers/rivenHelper"; -import { ExportUpgrades } from "warframe-public-export-plus"; +import { IVeiledRivenFingerprint } from "@/src/helpers/rivenHelper"; export const completeRandomModChallengeController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); @@ -27,10 +26,11 @@ export const completeRandomModChallengeController: RequestHandler = async (req, inventoryChanges.MiscItems = miscItemChanges; } - // Update riven fingerprint to a randomised unveiled state + // Complete the riven challenge const upgrade = inventory.Upgrades.id(request.ItemId)!; - const meta = ExportUpgrades[upgrade.ItemType]; - upgrade.UpgradeFingerprint = JSON.stringify(createUnveiledRivenFingerprint(meta)); + const fp = JSON.parse(upgrade.UpgradeFingerprint!) as IVeiledRivenFingerprint; + fp.challenge.Progress = fp.challenge.Required; + upgrade.UpgradeFingerprint = JSON.stringify(fp); await inventory.save();