fix: give ChallengeProgress with unlockAllScans cheat #3020

Merged
Sainan merged 2 commits from AMelonInsideLemon/SpaceNinjaServer:fix-JSCodexScan into main 2025-11-14 01:49:49 -08:00

View File

@@ -3,10 +3,11 @@ import allScans from "../../../static/fixed_responses/allScans.json" with { type
import { ExportEnemies } from "warframe-public-export-plus";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { getStats } from "../../services/statsService.ts";
import { getInventory } from "../../services/inventoryService.ts";
export const unlockAllScansController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const stats = await getStats(accountId);
const [stats, inventory] = await Promise.all([getStats(accountId), getInventory(accountId, "ChallengeProgress")]);
const scanTypes = new Set<string>(allScans);
for (const type of Object.keys(ExportEnemies.avatars)) {
@@ -18,6 +19,17 @@ export const unlockAllScansController: RequestHandler = async (req, res) => {
stats.Scans.push({ type, scans: 9999 });
}
await stats.save();
const jsCodex = inventory.ChallengeProgress.find(x => x.Name === "JSCodexScan");
if (jsCodex) {
jsCodex.Progress = 1;
} else {
inventory.ChallengeProgress.push({
Name: "JSCodexScan",
Progress: 1
});
}
await Promise.all([stats.save(), inventory.save()]);
res.end();
};