forked from OpenWF/SpaceNinjaServer
		
	fix: handle purchaseQuantity for resources (#609)
This commit is contained in:
		
							parent
							
								
									ba7da656a8
								
							
						
					
					
						commit
						68335aa91b
					
				
							
								
								
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -12,7 +12,7 @@
 | 
				
			|||||||
        "copyfiles": "^2.4.1",
 | 
					        "copyfiles": "^2.4.1",
 | 
				
			||||||
        "express": "^5",
 | 
					        "express": "^5",
 | 
				
			||||||
        "mongoose": "^8.9.2",
 | 
					        "mongoose": "^8.9.2",
 | 
				
			||||||
        "warframe-public-export-plus": "^0.5.10",
 | 
					        "warframe-public-export-plus": "^0.5.11",
 | 
				
			||||||
        "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"
 | 
				
			||||||
@ -3877,9 +3877,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/warframe-public-export-plus": {
 | 
					    "node_modules/warframe-public-export-plus": {
 | 
				
			||||||
      "version": "0.5.10",
 | 
					      "version": "0.5.11",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.10.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.11.tgz",
 | 
				
			||||||
      "integrity": "sha512-6RtWkQDMouMXoUePohkAsYYG/wGW9b/WjSIcrxCb80pWpwrMWr5lr7kzDKPMRkq1Ju8uh9sJirp/5oyeiJbyyQ=="
 | 
					      "integrity": "sha512-NJx5l6FsC8rwh9KcWrvu3Owvxtw6DFuk1ZEfsCXl5OGhnyqdd/9U0K9kDY+5T8aIoad7/7ftU1PmbVu4KOKGTA=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node_modules/warframe-riven-info": {
 | 
					    "node_modules/warframe-riven-info": {
 | 
				
			||||||
      "version": "0.1.2",
 | 
					      "version": "0.1.2",
 | 
				
			||||||
 | 
				
			|||||||
@ -16,7 +16,7 @@
 | 
				
			|||||||
    "copyfiles": "^2.4.1",
 | 
					    "copyfiles": "^2.4.1",
 | 
				
			||||||
    "express": "^5",
 | 
					    "express": "^5",
 | 
				
			||||||
    "mongoose": "^8.9.2",
 | 
					    "mongoose": "^8.9.2",
 | 
				
			||||||
    "warframe-public-export-plus": "^0.5.10",
 | 
					    "warframe-public-export-plus": "^0.5.11",
 | 
				
			||||||
    "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"
 | 
				
			||||||
 | 
				
			|||||||
@ -14,7 +14,14 @@ import { IMiscItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
				
			|||||||
import { IPurchaseRequest, IPurchaseResponse, SlotPurchase, IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
					import { IPurchaseRequest, IPurchaseResponse, SlotPurchase, IInventoryChanges } from "@/src/types/purchaseTypes";
 | 
				
			||||||
import { logger } from "@/src/utils/logger";
 | 
					import { logger } from "@/src/utils/logger";
 | 
				
			||||||
import worldState from "@/static/fixed_responses/worldState.json";
 | 
					import worldState from "@/static/fixed_responses/worldState.json";
 | 
				
			||||||
import { ExportBundles, ExportGear, ExportSyndicates, ExportVendors, TRarity } from "warframe-public-export-plus";
 | 
					import {
 | 
				
			||||||
 | 
					    ExportBundles,
 | 
				
			||||||
 | 
					    ExportGear,
 | 
				
			||||||
 | 
					    ExportResources,
 | 
				
			||||||
 | 
					    ExportSyndicates,
 | 
				
			||||||
 | 
					    ExportVendors,
 | 
				
			||||||
 | 
					    TRarity
 | 
				
			||||||
 | 
					} from "warframe-public-export-plus";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const getStoreItemCategory = (storeItem: string) => {
 | 
					export const getStoreItemCategory = (storeItem: string) => {
 | 
				
			||||||
    const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
 | 
					    const storeItemString = getSubstringFromKeyword(storeItem, "StoreItems/");
 | 
				
			||||||
@ -188,6 +195,8 @@ const handleStoreItemAcquisition = async (
 | 
				
			|||||||
        if (!ignorePurchaseQuantity) {
 | 
					        if (!ignorePurchaseQuantity) {
 | 
				
			||||||
            if (internalName in ExportGear) {
 | 
					            if (internalName in ExportGear) {
 | 
				
			||||||
                quantity *= ExportGear[internalName].purchaseQuantity || 1;
 | 
					                quantity *= ExportGear[internalName].purchaseQuantity || 1;
 | 
				
			||||||
 | 
					            } else if (internalName in ExportResources) {
 | 
				
			||||||
 | 
					                quantity *= ExportResources[internalName].purchaseQuantity || 1;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        switch (storeCategory) {
 | 
					        switch (storeCategory) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user