Compare commits

..

9 Commits

Author SHA1 Message Date
0a3f9549a9 fix: include currency changes in purchase response (#2740)
Closes #2739

Reviewed-on: OpenWF/SpaceNinjaServer#2740
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-09-02 20:22:56 -07:00
2cfb21b98e chore: buttonify unlockAllScans, unlockAllShipFeatures, unlockAllCapturaScenes (#2738)
Re #2361. Mostly done via ChatGPT Codex.

Reviewed-on: OpenWF/SpaceNinjaServer#2738
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-09-02 20:22:47 -07:00
3fedc701f1 fix(webui): properly deselect active focus school so unlocking is free (#2737)
Reviewed-on: OpenWF/SpaceNinjaServer#2737
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-09-01 20:30:11 -07:00
ed596aa3f3 chore: respond to hub request with reflexive address (#2736)
Reviewed-on: OpenWF/SpaceNinjaServer#2736
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-09-01 20:30:03 -07:00
e2349b361e chore: add noDojoDecoBuildStage to default config (#2734)
Reviewed-on: OpenWF/SpaceNinjaServer#2734
Co-authored-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
Co-committed-by: AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
2025-08-31 18:50:08 -07:00
9221178522 fix(webui): switching routes resets active tab for "add items" (#2733)
Reviewed-on: OpenWF/SpaceNinjaServer#2733
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-08-31 18:49:55 -07:00
9a5c2ab4a4 chore: remove NRS config (#2732)
Reviewed-on: OpenWF/SpaceNinjaServer#2732
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-08-31 18:49:48 -07:00
d4c477769a fix: don't attempt to subtract a cost of 0 for unlocking focus school (#2731)
Closes #2730

Reviewed-on: OpenWF/SpaceNinjaServer#2731
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
2025-08-31 18:47:14 -07:00
6de9f0dcdb fixup: remove unlockAllSimarisResearchEntries from config-vanilla.json 2025-08-31 18:35:24 +02:00
15 changed files with 146 additions and 107 deletions

View File

@ -7,25 +7,20 @@
"myAddress": "localhost",
"httpPort": 80,
"httpsPort": 443,
"NRS": ["localhost"],
"administratorNames": [],
"autoCreateAccount": true,
"skipTutorial": false,
"unlockAllScans": false,
"unlockAllShipFeatures": false,
"unlockAllShipDecorations": false,
"unlockAllFlavourItems": false,
"unlockAllSkins": false,
"unlockAllCapturaScenes": false,
"fullyStockedVendors": false,
"skipClanKeyCrafting": false,
"noDojoRoomBuildStage": false,
"noDecoBuildStage": false,
"noDojoDecoBuildStage": false,
"fastDojoRoomDestruction": false,
"noDojoResearchCosts": false,
"noDojoResearchTime": false,
"fastClanAscension": false,
"unlockAllSimarisResearchEntries": false,
"spoofMasteryRank": -1,
"relicRewardItemCountMultiplier": 1,
"nightwaveStandingMultiplier": 1,

View File

@ -38,12 +38,12 @@ export const focusController: RequestHandler = async (req, res) => {
case FocusOperation.UnlockWay: {
const focusType = (JSON.parse(String(req.body)) as IWayRequest).FocusType;
const focusPolarity = focusTypeToPolarity(focusType);
const inventory = await getInventory(accountId);
const inventory = await getInventory(accountId, "FocusAbility FocusUpgrades FocusXP");
const cost = inventory.FocusAbility ? 50_000 : 0;
inventory.FocusAbility ??= focusType;
inventory.FocusUpgrades.push({ ItemType: focusType });
if (inventory.FocusXP) {
inventory.FocusXP[focusPolarity]! -= cost;
if (cost) {
inventory.FocusXP![focusPolarity]! -= cost;
}
await inventory.save();
res.json({

View File

@ -1,6 +1,4 @@
import type { RequestHandler } from "express";
import { config } from "../../services/configService.ts";
import allShipFeatures from "../../../static/fixed_responses/allShipFeatures.json" with { type: "json" };
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { createGarden, getPersonalRooms } from "../../services/personalRoomsService.ts";
import type { IGetShipResponse, IPersonalRoomsClient } from "../../types/personalRoomsTypes.ts";
@ -31,9 +29,5 @@ export const getShipController: RequestHandler = async (req, res) => {
TailorShop: personalRooms.TailorShop
};
if (config.unlockAllShipFeatures) {
getShipResponse.Ship.Features = allShipFeatures;
}
res.json(getShipResponse);
};

View File

@ -1,7 +1,7 @@
import type { RequestHandler } from "express";
import { getReflexiveAddress } from "../../services/configService.ts";
const hubController: RequestHandler = (_req, res) => {
res.json("hub 127.0.0.1:6952");
export const hubController: RequestHandler = (req, res) => {
const { myAddress } = getReflexiveAddress(req);
res.json(`hub ${myAddress}:6952`);
};
export { hubController };

View File

@ -10,7 +10,7 @@ import { equipmentKeys } from "../../types/inventoryTypes/inventoryTypes.ts";
import type { IPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts";
import { ArtifactPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts";
import type { ICountedItem } from "warframe-public-export-plus";
import { eFaction, ExportCustoms, ExportFlavour, ExportResources, ExportVirtuals } from "warframe-public-export-plus";
import { eFaction, ExportCustoms, ExportFlavour, ExportResources } from "warframe-public-export-plus";
import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "../../services/infestedFoundryService.ts";
import {
addEmailItem,
@ -358,17 +358,6 @@ export const getInventoryResponse = async (
}
}
if (config.unlockAllCapturaScenes) {
for (const uniqueName of Object.keys(ExportResources)) {
if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) {
inventoryResponse.MiscItems.push({
ItemType: uniqueName,
ItemCount: 1
});
}
}
}
if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
inventoryResponse.PlayerLevel = config.spoofMasteryRank;
if (!xpBasedLevelCapDisabled) {
@ -495,21 +484,3 @@ const getExpRequiredForMr = (rank: number): number => {
}
return 2_250_000 + 147_500 * (rank - 30);
};
const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => {
let parentName = resourceGetParent(resourceName);
for (; parentName != undefined; parentName = resourceGetParent(parentName)) {
if (parentName == targetName) {
return true;
}
}
return false;
};
const resourceGetParent = (resourceName: string): string | undefined => {
if (resourceName in ExportResources) {
return ExportResources[resourceName].parentName;
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
return ExportVirtuals[resourceName]?.parentName;
};

View File

@ -1,6 +1,6 @@
import type { RequestHandler } from "express";
import { config } from "../../services/configService.ts";
import { config, getReflexiveAddress } from "../../services/configService.ts";
import { buildConfig } from "../../services/buildConfigService.ts";
import { Account } from "../../models/loginModel.ts";
@ -20,21 +20,7 @@ export const loginController: RequestHandler = async (request, response) => {
? request.query.buildLabel.split(" ").join("+")
: buildConfig.buildLabel;
let myAddress: string;
let myUrlBase: string = request.protocol + "://";
if (request.host.indexOf("warframe.com") == -1) {
// Client request was redirected cleanly, so we know it can reach us how it's reaching us now.
myAddress = request.hostname;
myUrlBase += request.host;
} else {
// Don't know how the client reached us, hoping the config does.
myAddress = config.myAddress;
myUrlBase += myAddress;
const port: number = request.protocol == "http" ? config.httpPort || 80 : config.httpsPort || 443;
if (port != (request.protocol == "http" ? 80 : 443)) {
myUrlBase += ":" + port;
}
}
const { myAddress, myUrlBase } = getReflexiveAddress(request);
if (
!account &&
@ -109,7 +95,7 @@ const createLoginResponse = (
BuildLabel: buildLabel
};
if (version_compare(buildLabel, "2015.02.13.10.41") >= 0) {
resp.NRS = config.NRS;
resp.NRS = [myAddress];
}
if (version_compare(buildLabel, "2015.05.14.16.29") >= 0) {
// U17 and up

View File

@ -0,0 +1,36 @@
import type { RequestHandler } from "express";
import { ExportResources, ExportVirtuals } from "warframe-public-export-plus";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { addItem, getInventory } from "../../services/inventoryService.ts";
export const unlockAllCapturaScenesController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const inventory = await getInventory(accountId);
for (const uniqueName of Object.keys(ExportResources)) {
if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) {
await addItem(inventory, uniqueName, 1);
}
}
await inventory.save();
res.end();
};
const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => {
let parentName = resourceGetParent(resourceName);
for (; parentName != undefined; parentName = resourceGetParent(parentName)) {
if (parentName == targetName) {
return true;
}
}
return false;
};
const resourceGetParent = (resourceName: string): string | undefined => {
if (resourceName in ExportResources) {
return ExportResources[resourceName].parentName;
}
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
return ExportVirtuals[resourceName]?.parentName;
};

View File

@ -0,0 +1,23 @@
import type { RequestHandler } from "express";
import allScans from "../../../static/fixed_responses/allScans.json" with { type: "json" };
import { ExportEnemies } from "warframe-public-export-plus";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { getStats } from "../../services/statsService.ts";
export const unlockAllScansController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const stats = await getStats(accountId);
const scanTypes = new Set<string>(allScans);
for (const type of Object.keys(ExportEnemies.avatars)) {
scanTypes.add(type);
}
stats.Scans = [];
for (const type of scanTypes) {
stats.Scans.push({ type, scans: 9999 });
}
await stats.save();
res.end();
};

View File

@ -0,0 +1,19 @@
import type { RequestHandler } from "express";
import allShipFeatures from "../../../static/fixed_responses/allShipFeatures.json" with { type: "json" };
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { getPersonalRooms } from "../../services/personalRoomsService.ts";
export const unlockAllShipFeaturesController: RequestHandler = async (req, res) => {
const accountId = await getAccountIdForRequest(req);
const personalRooms = await getPersonalRooms(accountId);
const featureSet = new Set(personalRooms.Ship.Features);
for (const feature of allShipFeatures) {
if (!featureSet.has(feature)) {
personalRooms.Ship.Features.push(feature);
}
}
await personalRooms.save();
res.end();
};

View File

@ -1,8 +1,5 @@
import type { RequestHandler } from "express";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { config } from "../../services/configService.ts";
import allScans from "../../../static/fixed_responses/allScans.json" with { type: "json" };
import { ExportEnemies } from "warframe-public-export-plus";
import { getInventory } from "../../services/inventoryService.ts";
import { getStats } from "../../services/statsService.ts";
import type { IStatsClient } from "../../types/statTypes.ts";
@ -12,7 +9,7 @@ const viewController: RequestHandler = async (req, res) => {
const inventory = await getInventory(accountId, "XPInfo");
const playerStats = await getStats(accountId);
const responseJson = playerStats.toJSON() as IStatsClient;
const responseJson = playerStats.toJSON<IStatsClient>();
responseJson.Weapons ??= [];
for (const item of inventory.XPInfo) {
const weaponIndex = responseJson.Weapons.findIndex(element => element.type == item.ItemType);
@ -22,24 +19,6 @@ const viewController: RequestHandler = async (req, res) => {
responseJson.Weapons.push({ type: item.ItemType, xp: item.XP });
}
}
if (config.unlockAllScans) {
const scans = new Set(allScans);
for (const type of Object.keys(ExportEnemies.avatars)) {
if (!scans.has(type)) scans.add(type);
}
// Take any existing scans and also set them to 9999
if (responseJson.Scans) {
for (const scan of responseJson.Scans) {
scans.add(scan.type);
}
}
responseJson.Scans = [];
for (const type of scans) {
responseJson.Scans.push({ type: type, scans: 9999 });
}
}
res.json(responseJson);
};

View File

@ -16,6 +16,9 @@ import { completeAllMissionsController } from "../controllers/custom/completeAll
import { addMissingHelminthBlueprintsController } from "../controllers/custom/addMissingHelminthBlueprintsController.ts";
import { unlockAllProfitTakerStagesController } from "../controllers/custom/unlockAllProfitTakerStagesController.ts";
import { unlockAllSimarisResearchEntriesController } from "../controllers/custom/unlockAllSimarisResearchEntriesController.ts";
import { unlockAllScansController } from "../controllers/custom/unlockAllScansController.ts";
import { unlockAllShipFeaturesController } from "../controllers/custom/unlockAllShipFeaturesController.ts";
import { unlockAllCapturaScenesController } from "../controllers/custom/unlockAllCapturaScenesController.ts";
import { abilityOverrideController } from "../controllers/custom/abilityOverrideController.ts";
import { createAccountController } from "../controllers/custom/createAccountController.ts";
@ -52,6 +55,9 @@ customRouter.get("/completeAllMissions", completeAllMissionsController);
customRouter.get("/addMissingHelminthBlueprints", addMissingHelminthBlueprintsController);
customRouter.get("/unlockAllProfitTakerStages", unlockAllProfitTakerStagesController);
customRouter.get("/unlockAllSimarisResearchEntries", unlockAllSimarisResearchEntriesController);
customRouter.get("/unlockAllScans", unlockAllScansController);
customRouter.get("/unlockAllShipFeatures", unlockAllShipFeaturesController);
customRouter.get("/unlockAllCapturaScenes", unlockAllCapturaScenesController);
customRouter.post("/abilityOverride", abilityOverrideController);
customRouter.post("/createAccount", createAccountController);

View File

@ -3,6 +3,7 @@ import path from "path";
import { repoDir } from "../helpers/pathHelper.ts";
import { args } from "../helpers/commandLineArguments.ts";
import { Inbox } from "../models/inboxModel.ts";
import type { Request } from "express";
export interface IConfig {
mongodbUrl: string;
@ -14,16 +15,12 @@ export interface IConfig {
httpPort?: number;
httpsPort?: number;
myIrcAddresses?: string[];
NRS?: string[];
administratorNames?: string[];
autoCreateAccount?: boolean;
skipTutorial?: boolean;
unlockAllScans?: boolean;
unlockAllShipFeatures?: boolean;
unlockAllShipDecorations?: boolean;
unlockAllFlavourItems?: boolean;
unlockAllSkins?: boolean;
unlockAllCapturaScenes?: boolean;
unlockAllDecoRecipes?: boolean;
fullyStockedVendors?: boolean;
skipClanKeyCrafting?: boolean;
@ -86,6 +83,7 @@ export interface IConfig {
}
export const configRemovedOptionsKeys = [
"NRS",
"skipAllDialogue",
"infiniteCredits",
"infinitePlatinum",
@ -105,11 +103,15 @@ export const configRemovedOptionsKeys = [
"unlockArcanesEverywhere",
"unlockAllProfitTakerStages",
"unlockAllSimarisResearchEntries",
"unlockAllScans",
"unlockAllShipFeatures",
"unlockAllCapturaScenes",
"noDailyStandingLimits",
"noDailyFocusLimit",
"noArgonCrystalDecay",
"noMasteryRankUpCooldown",
"noVendorPurchaseLimits",
"noDecoBuildStage",
"noDeathMarks",
"noKimCooldowns",
"syndicateMissionsRepeatable",
@ -164,3 +166,22 @@ export const syncConfigWithDatabase = (): void => {
void Inbox.deleteMany({ goalTag: "GalleonRobbery" }).then(() => {});
}
};
export const getReflexiveAddress = (request: Request): { myAddress: string; myUrlBase: string } => {
let myAddress: string;
let myUrlBase: string = request.protocol + "://";
if (request.host.indexOf("warframe.com") == -1) {
// Client request was redirected cleanly, so we know it can reach us how it's reaching us now.
myAddress = request.hostname;
myUrlBase += request.host;
} else {
// Don't know how the client reached us, hoping the config does.
myAddress = config.myAddress;
myUrlBase += myAddress;
const port: number = request.protocol == "http" ? config.httpPort || 80 : config.httpsPort || 443;
if (port != (request.protocol == "http" ? 80 : 443)) {
myUrlBase += ":" + port;
}
}
return { myAddress, myUrlBase };
};

View File

@ -209,7 +209,7 @@ export const handlePurchase = async (
inventory,
purchaseRequest.PurchaseParams.ExpectedPrice,
purchaseRequest.PurchaseParams.UsePremium,
prePurchaseInventoryChanges
purchaseResponse.InventoryChanges
);
switch (purchaseRequest.PurchaseParams.Source) {

View File

@ -808,8 +808,11 @@
<label class="form-check-label" for="finishInvasionsInOneMission" data-loc="cheats_finishInvasionsInOneMission"></label>
</div>
<div class="mt-2 mb-2 d-flex flex-wrap gap-2">
<button class="btn btn-primary" onclick="debounce(doUnlockAllShipFeatures);" data-loc="cheats_unlockAllShipFeatures"></button>
<button class="btn btn-primary" onclick="debounce(unlockAllMissions);" data-loc="cheats_unlockAllMissions"></button>
<button class="btn btn-primary" onclick="debounce(markAllAsRead);" data-loc="cheats_markAllAsRead"></button>
<button class="btn btn-primary" onclick="debounce(doUnlockAllScans);" data-loc="cheats_unlockAllScans"></button>
<button class="btn btn-primary" onclick="debounce(doUnlockAllCapturaScenes);" data-loc="cheats_unlockAllCapturaScenes"></button>
<button class="btn btn-primary" onclick="doUnlockAllFocusSchools();" data-loc="cheats_unlockAllFocusSchools"></button>
<button class="btn btn-primary" onclick="doHelminthUnlockAll();" data-loc="cheats_helminthUnlockAll"></button>
<button class="btn btn-primary" onclick="debounce(addMissingHelminthRecipes);" data-loc="cheats_addMissingSubsumedAbilities"></button>
@ -840,14 +843,6 @@
<input class="form-check-input" type="checkbox" id="skipTutorial" />
<label class="form-check-label" for="skipTutorial" data-loc="cheats_skipTutorial"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllScans" />
<label class="form-check-label" for="unlockAllScans" data-loc="cheats_unlockAllScans"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllShipFeatures" />
<label class="form-check-label" for="unlockAllShipFeatures" data-loc="cheats_unlockAllShipFeatures"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllShipDecorations" />
<label class="form-check-label" for="unlockAllShipDecorations" data-loc="cheats_unlockAllShipDecorations"></label>
@ -860,10 +855,6 @@
<input class="form-check-input" type="checkbox" id="unlockAllSkins" />
<label class="form-check-label" for="unlockAllSkins" data-loc="cheats_unlockAllSkins"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllCapturaScenes" />
<label class="form-check-label" for="unlockAllCapturaScenes" data-loc="cheats_unlockAllCapturaScenes"></label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" id="unlockAllDecoRecipes" />
<label class="form-check-label" for="unlockAllDecoRecipes" data-loc="cheats_unlockAllDecoRecipes"></label>

View File

@ -190,7 +190,7 @@ single.on("route_load", function (event) {
$("body").removeClass("logged-in");
}
$(".nav-link").removeClass("active");
$("#sidebar .nav-link").removeClass("active");
const navLink = document.querySelector(".nav-link[href='" + event.route.paths[0] + "']");
if (navLink) {
navLink.classList.add("active");
@ -2339,7 +2339,7 @@ function unlockFocusSchool(upgradeType) {
$.post({
url: "/api/focus.php?" + window.authz + "&op=5",
contentType: "text/plain",
data: "{}"
data: JSON.stringify({ FocusType: null })
}).done(function () {
// Unlock the way now
$.post({
@ -2750,6 +2750,24 @@ async function doMaxPlexus() {
}
}
async function doUnlockAllScans() {
await revalidateAuthz();
await fetch("/custom/unlockAllScans?" + window.authz);
toast(loc("cheats_unlockSucc"));
}
async function doUnlockAllShipFeatures() {
await revalidateAuthz();
await fetch("/custom/unlockAllShipFeatures?" + window.authz);
toast(loc("cheats_unlockSucc"));
}
async function doUnlockAllCapturaScenes() {
await revalidateAuthz();
await fetch("/custom/unlockAllCapturaScenes?" + window.authz);
toast(loc("cheats_unlockSucc"));
}
async function unlockAllMissions() {
await revalidateAuthz();
await fetch("/custom/completeAllMissions?" + window.authz);