forked from OpenWF/SpaceNinjaServer
		
	chore: use creditBundles map from PE+ (#1008)
Reviewed-on: OpenWF/SpaceNinjaServer#1008
This commit is contained in:
		
							parent
							
								
									2efe0df2f2
								
							
						
					
					
						commit
						bc07978846
					
				
							
								
								
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -12,7 +12,7 @@
 | 
			
		||||
        "copyfiles": "^2.4.1",
 | 
			
		||||
        "express": "^5",
 | 
			
		||||
        "mongoose": "^8.9.4",
 | 
			
		||||
        "warframe-public-export-plus": "^0.5.35",
 | 
			
		||||
        "warframe-public-export-plus": "^0.5.36",
 | 
			
		||||
        "warframe-riven-info": "^0.1.2",
 | 
			
		||||
        "winston": "^3.17.0",
 | 
			
		||||
        "winston-daily-rotate-file": "^5.0.0"
 | 
			
		||||
@ -4093,9 +4093,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/warframe-public-export-plus": {
 | 
			
		||||
      "version": "0.5.35",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.35.tgz",
 | 
			
		||||
      "integrity": "sha512-YLQP1n5sOV+PS5hfC4Kuoapa9gsqOy5Qy/E4EYfRV/xJBruFl3tPhbdbgFn3HhL2OBrgRJ8yzT5bjIvaHKhOCw=="
 | 
			
		||||
      "version": "0.5.36",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.36.tgz",
 | 
			
		||||
      "integrity": "sha512-FYZECqBSnynl6lQvcQyEqpnGW9l84wzusekhtwKjvg3280CYdn7g5x0Q9tOMhj1jpc/1tuY+akHtHa94sPtqKw=="
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/warframe-riven-info": {
 | 
			
		||||
      "version": "0.1.2",
 | 
			
		||||
 | 
			
		||||
@ -17,7 +17,7 @@
 | 
			
		||||
    "copyfiles": "^2.4.1",
 | 
			
		||||
    "express": "^5",
 | 
			
		||||
    "mongoose": "^8.9.4",
 | 
			
		||||
    "warframe-public-export-plus": "^0.5.35",
 | 
			
		||||
    "warframe-public-export-plus": "^0.5.36",
 | 
			
		||||
    "warframe-riven-info": "^0.1.2",
 | 
			
		||||
    "winston": "^3.17.0",
 | 
			
		||||
    "winston-daily-rotate-file": "^5.0.0"
 | 
			
		||||
 | 
			
		||||
@ -44,6 +44,7 @@ import {
 | 
			
		||||
    ExportFusionBundles,
 | 
			
		||||
    ExportGear,
 | 
			
		||||
    ExportKeys,
 | 
			
		||||
    ExportMisc,
 | 
			
		||||
    ExportRecipes,
 | 
			
		||||
    ExportResources,
 | 
			
		||||
    ExportSentinels,
 | 
			
		||||
@ -53,7 +54,6 @@ import {
 | 
			
		||||
    TStandingLimitBin
 | 
			
		||||
} from "warframe-public-export-plus";
 | 
			
		||||
import { createShip } from "./shipService";
 | 
			
		||||
import { creditBundles } from "@/src/services/missionInventoryUpdateService";
 | 
			
		||||
import { IKeyChainRequest } from "@/src/controllers/api/giveKeyChainTriggeredItemsController";
 | 
			
		||||
import { toOid } from "../helpers/inventoryHelpers";
 | 
			
		||||
import { generateRewardSeed } from "@/src/controllers/api/getNewRewardSeedController";
 | 
			
		||||
@ -308,8 +308,8 @@ export const addItem = async (
 | 
			
		||||
            };
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    if (typeName in creditBundles) {
 | 
			
		||||
        const creditsTotal = creditBundles[typeName] * quantity;
 | 
			
		||||
    if (typeName in ExportMisc.creditBundles) {
 | 
			
		||||
        const creditsTotal = ExportMisc.creditBundles[typeName] * quantity;
 | 
			
		||||
        inventory.RegularCredits += creditsTotal;
 | 
			
		||||
        return {
 | 
			
		||||
            InventoryChanges: {
 | 
			
		||||
 | 
			
		||||
@ -51,27 +51,6 @@ const getRandomRewardByChance = (pool: IReward[]): IRngResult | undefined => {
 | 
			
		||||
    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;
 | 
			
		||||
//const ignoredInventoryUpdateKeys = ["FpsAvg", "FpsMax", "FpsMin", "FpsSamples"] satisfies TMissionInventoryUpdateKeys[]; // for keys with no meaning for this server
 | 
			
		||||
//type TignoredInventoryUpdateKeys = (typeof ignoredInventoryUpdateKeys)[number];
 | 
			
		||||
 | 
			
		||||
@ -18,6 +18,7 @@ import {
 | 
			
		||||
    ExportBoosterPacks,
 | 
			
		||||
    ExportBundles,
 | 
			
		||||
    ExportGear,
 | 
			
		||||
    ExportMisc,
 | 
			
		||||
    ExportResources,
 | 
			
		||||
    ExportSyndicates,
 | 
			
		||||
    ExportVendors,
 | 
			
		||||
@ -25,7 +26,6 @@ import {
 | 
			
		||||
} from "warframe-public-export-plus";
 | 
			
		||||
import { config } from "./configService";
 | 
			
		||||
import { TInventoryDatabaseDocument } from "../models/inventoryModels/inventoryModel";
 | 
			
		||||
import { creditBundles } from "./missionInventoryUpdateService";
 | 
			
		||||
 | 
			
		||||
export const getStoreItemCategory = (storeItem: string): string => {
 | 
			
		||||
    const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
 | 
			
		||||
@ -335,8 +335,8 @@ const handleCreditBundlePurchase = async (
 | 
			
		||||
    typeName: string,
 | 
			
		||||
    inventory: TInventoryDatabaseDocument
 | 
			
		||||
): Promise<IPurchaseResponse> => {
 | 
			
		||||
    if (typeName && typeName in creditBundles) {
 | 
			
		||||
        const creditsAmount = creditBundles[typeName];
 | 
			
		||||
    if (typeName && typeName in ExportMisc.creditBundles) {
 | 
			
		||||
        const creditsAmount = ExportMisc.creditBundles[typeName];
 | 
			
		||||
 | 
			
		||||
        inventory.RegularCredits += creditsAmount;
 | 
			
		||||
        await inventory.save();
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user