fix: acquisition of CrewShipWeaponSkins
All checks were successful
Build / build (22) (push) Successful in 34s
Build / build (18) (push) Successful in 1m3s
Build / build (20) (push) Successful in 1m3s
Build / build (18) (pull_request) Successful in 35s
Build / build (20) (pull_request) Successful in 1m2s
Build / build (22) (pull_request) Successful in 1m9s

This commit is contained in:
Sainan 2025-02-25 23:29:58 +01:00
parent a27f1c5e01
commit 38418a9082
4 changed files with 27 additions and 9 deletions

8
package-lock.json generated
View File

@ -12,7 +12,7 @@
"copyfiles": "^2.4.1",
"express": "^5",
"mongoose": "^8.9.4",
"warframe-public-export-plus": "^0.5.36",
"warframe-public-export-plus": "^0.5.37",
"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.36",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.36.tgz",
"integrity": "sha512-FYZECqBSnynl6lQvcQyEqpnGW9l84wzusekhtwKjvg3280CYdn7g5x0Q9tOMhj1jpc/1tuY+akHtHa94sPtqKw=="
"version": "0.5.37",
"resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.37.tgz",
"integrity": "sha512-atpTQ0IV0HF17rO2+Z+Vdv8nnnUxh5HhkcXBjc5iwY8tlvRgRWwHemq4PdA1bxR4tYFU5xoYjlgDe5D8ZfM4ew=="
},
"node_modules/warframe-riven-info": {
"version": "0.1.2",

View File

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

View File

@ -1084,7 +1084,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
//Default RailJack
CrewShipAmmo: [typeCountSchema],
CrewShipWeapons: [Schema.Types.Mixed],
CrewShipWeaponSkins: [Schema.Types.Mixed],
CrewShipWeaponSkins: [upgradeSchema],
//NPC Crew and weapon
CrewMembers: [Schema.Types.Mixed],
@ -1323,6 +1323,7 @@ export type InventoryDocumentProps = {
WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
QuestKeys: Types.DocumentArray<IQuestKeyDatabase>;
Drones: Types.DocumentArray<IDroneDatabase>;
CrewShipWeaponSkins: Types.DocumentArray<IUpgradeDatabase>;
} & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> };
// eslint-disable-next-line @typescript-eslint/ban-types

View File

@ -25,7 +25,8 @@ import {
IKubrowPetEggClient,
ILibraryAvailableDailyTaskInfo,
ICalendarProgress,
IDroneClient
IDroneClient,
IUpgradeClient
} from "@/src/types/inventoryTypes/inventoryTypes";
import { IGenericUpdate } from "../types/genericUpdate";
import {
@ -254,8 +255,11 @@ export const addItem = async (
}
}
if (typeName in ExportCustoms) {
const inventoryChanges = addSkin(inventory, typeName);
return { InventoryChanges: inventoryChanges };
if (ExportCustoms[typeName].productCategory == "CrewShipWeaponSkins") {
return { InventoryChanges: addCrewShipWeaponSkin(inventory, typeName) };
} else {
return { InventoryChanges: addSkin(inventory, typeName) };
}
}
if (typeName in ExportFlavour) {
const inventoryChanges = addCustomization(inventory, typeName);
@ -809,6 +813,19 @@ export const addSkin = (
return inventoryChanges;
};
const addCrewShipWeaponSkin = (
inventory: TInventoryDatabaseDocument,
typeName: string,
inventoryChanges: IInventoryChanges = {}
): IInventoryChanges => {
const index = inventory.CrewShipWeaponSkins.push({ ItemType: typeName }) - 1;
inventoryChanges.CrewShipWeaponSkins ??= [];
(inventoryChanges.CrewShipWeaponSkins as IUpgradeClient[]).push(
inventory.CrewShipWeaponSkins[index].toJSON<IUpgradeClient>()
);
return inventoryChanges;
};
const addCrewShip = (
inventory: TInventoryDatabaseDocument,
typeName: string,