chore: use creditBundles map from PE+ #1008

Merged
Sainan merged 1 commits from credit-bundles into main 2025-02-24 21:46:21 -08:00
5 changed files with 11 additions and 32 deletions

8
package-lock.json generated
View File

@ -12,7 +12,7 @@
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"express": "^5", "express": "^5",
"mongoose": "^8.9.4", "mongoose": "^8.9.4",
"warframe-public-export-plus": "^0.5.35", "warframe-public-export-plus": "^0.5.36",
"warframe-riven-info": "^0.1.2", "warframe-riven-info": "^0.1.2",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"
@ -4093,9 +4093,9 @@
} }
}, },
"node_modules/warframe-public-export-plus": { "node_modules/warframe-public-export-plus": {
"version": "0.5.35", "version": "0.5.36",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.35.tgz", "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.36.tgz",
"integrity": "sha512-YLQP1n5sOV+PS5hfC4Kuoapa9gsqOy5Qy/E4EYfRV/xJBruFl3tPhbdbgFn3HhL2OBrgRJ8yzT5bjIvaHKhOCw==" "integrity": "sha512-FYZECqBSnynl6lQvcQyEqpnGW9l84wzusekhtwKjvg3280CYdn7g5x0Q9tOMhj1jpc/1tuY+akHtHa94sPtqKw=="
}, },
"node_modules/warframe-riven-info": { "node_modules/warframe-riven-info": {
"version": "0.1.2", "version": "0.1.2",

View File

@ -17,7 +17,7 @@
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"express": "^5", "express": "^5",
"mongoose": "^8.9.4", "mongoose": "^8.9.4",
"warframe-public-export-plus": "^0.5.35", "warframe-public-export-plus": "^0.5.36",
"warframe-riven-info": "^0.1.2", "warframe-riven-info": "^0.1.2",
"winston": "^3.17.0", "winston": "^3.17.0",
"winston-daily-rotate-file": "^5.0.0" "winston-daily-rotate-file": "^5.0.0"

View File

@ -44,6 +44,7 @@ import {
ExportFusionBundles, ExportFusionBundles,
ExportGear, ExportGear,
ExportKeys, ExportKeys,
ExportMisc,
ExportRecipes, ExportRecipes,
ExportResources, ExportResources,
ExportSentinels, ExportSentinels,
@ -53,7 +54,6 @@ import {
TStandingLimitBin TStandingLimitBin
} from "warframe-public-export-plus"; } from "warframe-public-export-plus";
import { createShip } from "./shipService"; import { createShip } from "./shipService";
import { creditBundles } from "@/src/services/missionInventoryUpdateService";
import { IKeyChainRequest } from "@/src/controllers/api/giveKeyChainTriggeredItemsController"; import { IKeyChainRequest } from "@/src/controllers/api/giveKeyChainTriggeredItemsController";
import { toOid } from "../helpers/inventoryHelpers"; import { toOid } from "../helpers/inventoryHelpers";
import { generateRewardSeed } from "@/src/controllers/api/getNewRewardSeedController"; import { generateRewardSeed } from "@/src/controllers/api/getNewRewardSeedController";
@ -307,8 +307,8 @@ export const addItem = async (
}; };
} }
} }
if (typeName in creditBundles) { if (typeName in ExportMisc.creditBundles) {
const creditsTotal = creditBundles[typeName] * quantity; const creditsTotal = ExportMisc.creditBundles[typeName] * quantity;
inventory.RegularCredits += creditsTotal; inventory.RegularCredits += creditsTotal;
return { return {
InventoryChanges: { InventoryChanges: {

View File

@ -51,27 +51,6 @@ const getRandomRewardByChance = (pool: IReward[]): IRngResult | undefined => {
return getRandomReward(pool as IRngResult[]); return getRandomReward(pool as IRngResult[]);
}; };
export const creditBundles: Record<string, number> = {
"/Lotus/Types/PickUps/Credits/1500Credits": 1500,
"/Lotus/Types/PickUps/Credits/2000Credits": 2000,
"/Lotus/Types/PickUps/Credits/2500Credits": 2500,
"/Lotus/Types/PickUps/Credits/3000Credits": 3000,
"/Lotus/Types/PickUps/Credits/4000Credits": 4000,
"/Lotus/Types/PickUps/Credits/5000Credits": 5000,
"/Lotus/Types/PickUps/Credits/7500Credits": 7500,
"/Lotus/Types/PickUps/Credits/10000Credits": 10000,
"/Lotus/Types/PickUps/Credits/5000Hollars": 5000,
"/Lotus/Types/PickUps/Credits/7500Hollars": 7500,
"/Lotus/Types/PickUps/Credits/10000Hollars": 10000,
"/Lotus/Types/PickUps/Credits/CorpusArenaCreditRewards/CorpusArenaRewardOneHard": 105000,
"/Lotus/Types/PickUps/Credits/CorpusArenaCreditRewards/CorpusArenaRewardTwoHard": 175000,
"/Lotus/Types/PickUps/Credits/CorpusArenaCreditRewards/CorpusArenaRewardThreeHard": 250000,
"/Lotus/Types/StoreItems/CreditBundles/Zariman/TableACreditsCommon": 15000,
"/Lotus/Types/StoreItems/CreditBundles/Zariman/TableACreditsUncommon": 30000,
"/Lotus/Types/StoreItems/CreditBundles/CreditBundleA": 50000,
"/Lotus/Types/StoreItems/CreditBundles/CreditBundleC": 175000
};
//type TMissionInventoryUpdateKeys = keyof IMissionInventoryUpdateRequest; //type TMissionInventoryUpdateKeys = keyof IMissionInventoryUpdateRequest;
//const ignoredInventoryUpdateKeys = ["FpsAvg", "FpsMax", "FpsMin", "FpsSamples"] satisfies TMissionInventoryUpdateKeys[]; // for keys with no meaning for this server //const ignoredInventoryUpdateKeys = ["FpsAvg", "FpsMax", "FpsMin", "FpsSamples"] satisfies TMissionInventoryUpdateKeys[]; // for keys with no meaning for this server
//type TignoredInventoryUpdateKeys = (typeof ignoredInventoryUpdateKeys)[number]; //type TignoredInventoryUpdateKeys = (typeof ignoredInventoryUpdateKeys)[number];

View File

@ -18,6 +18,7 @@ import {
ExportBoosterPacks, ExportBoosterPacks,
ExportBundles, ExportBundles,
ExportGear, ExportGear,
ExportMisc,
ExportResources, ExportResources,
ExportSyndicates, ExportSyndicates,
ExportVendors, ExportVendors,
@ -25,7 +26,6 @@ import {
} from "warframe-public-export-plus"; } from "warframe-public-export-plus";
import { config } from "./configService"; import { config } from "./configService";
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel"; import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
import { creditBundles } from "./missionInventoryUpdateService";
export const getStoreItemCategory = (storeItem: string): string => { export const getStoreItemCategory = (storeItem: string): string => {
const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/"); const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
@ -335,8 +335,8 @@ const handleCreditBundlePurchase = async (
typeName: string, typeName: string,
inventory: TInventoryDatabaseDocument inventory: TInventoryDatabaseDocument
): Promise<IPurchaseResponse> => { ): Promise<IPurchaseResponse> => {
if (typeName && typeName in creditBundles) { if (typeName && typeName in ExportMisc.creditBundles) {
const creditsAmount = creditBundles[typeName]; const creditsAmount = ExportMisc.creditBundles[typeName];
inventory.RegularCredits += creditsAmount; inventory.RegularCredits += creditsAmount;
await inventory.save(); await inventory.save();