KahlLoadOuts support

This commit is contained in:
AMelonInsideLemon 2025-01-25 14:23:16 +01:00
parent 94239676c5
commit 9dd1032128
5 changed files with 15 additions and 12 deletions

View File

@ -934,6 +934,8 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
OperatorLoadOuts: [operatorConfigSchema],
//Drifter
AdultOperatorLoadOuts: [operatorConfigSchema],
// Kahl
KahlLoadOuts: [operatorConfigSchema],
//LandingCraft like Liset
Ships: { type: [Schema.Types.ObjectId], ref: "Ships" },
@ -1111,7 +1113,6 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
//Unknown and system
DuviriInfo: DuviriInfoSchema,
Mailbox: MailboxSchema,
KahlLoadOuts: [Schema.Types.Mixed],
HandlerPoints: Number,
ChallengesFixVersion: Number,
PlayedParkourTutorial: Boolean,
@ -1177,6 +1178,7 @@ export type InventoryDocumentProps = {
Boosters: Types.DocumentArray<IBooster>;
OperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
KahlLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
} & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> };

View File

@ -172,7 +172,7 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
});
}
}
for (const key of ["OperatorLoadOuts", "AdultOperatorLoadOuts"] as const) {
for (const key of ["AdultOperatorLoadOuts", "OperatorLoadOuts", "KahlLoadOuts"] as const) {
if (client[key] !== undefined) {
replaceArray<IOperatorConfigDatabase>(db[key], client[key].map(convertOperatorConfig));
}

View File

@ -37,8 +37,9 @@ export const handleInventoryItemConfigChange = async (
}
// non-empty is a change in loadout(or suit...)
switch (equipmentName) {
case "AdultOperatorLoadOuts":
case "OperatorLoadOuts":
case "AdultOperatorLoadOuts": {
case "KahlLoadOuts": {
const operatorConfig = equipment as IOperatorConfigEntry;
const operatorLoadout = inventory[equipmentName];
logger.debug(`operator loadout received ${equipmentName} `, operatorConfig);
@ -164,7 +165,6 @@ export const handleInventoryItemConfigChange = async (
});
}
}
//case "KahlLoadOuts": not sure yet how to handle kahl: it is not sent in inventory
}
}
await inventory.save();

View File

@ -28,9 +28,9 @@ export interface IInventoryDatabase
| "Upgrades"
| "CrewShipSalvagedWeaponSkins"
| "CrewShipWeaponSkins"
| "OperatorLoadOuts"
| "AdultOperatorLoadOuts"
| "CrewShips"
| "OperatorLoadOuts"
| "KahlLoadOuts"
| "InfestedFoundry"
| "DialogueHistory"
| TEquipmentKey
@ -49,8 +49,9 @@ export interface IInventoryDatabase
Upgrades: IUpgradeDatabase[];
CrewShipSalvagedWeaponSkins: IUpgradeDatabase[];
CrewShipWeaponSkins: IUpgradeDatabase[];
OperatorLoadOuts: IOperatorConfigDatabase[];
AdultOperatorLoadOuts: IOperatorConfigDatabase[];
OperatorLoadOuts: IOperatorConfigDatabase[];
KahlLoadOuts: IOperatorConfigDatabase[];
InfestedFoundry?: IInfestedFoundryDatabase;
DialogueHistory?: IDialogueHistoryDatabase;
@ -196,10 +197,12 @@ export interface IInventoryClient extends IDailyAffiliations {
MechSuits: IEquipmentClient[];
CrewShipHarnesses: IEquipmentClient[];
KubrowPets: IEquipmentClient[];
AdultOperatorLoadOuts: IOperatorConfigClient[];
OperatorLoadOuts: IOperatorConfigClient[];
KahlLoadOuts: IOperatorConfigClient[];
DuviriInfo: IDuviriInfo;
Mailbox: IMailbox;
KahlLoadOuts: IEquipmentDatabase[];
SubscribedToEmails: number;
Created: IMongoDate;
RewardSeed: number;
@ -304,7 +307,6 @@ export interface IInventoryClient extends IDailyAffiliations {
BountyScore: number;
ChallengeInstanceStates: IChallengeInstanceState[];
LoginMilestoneRewards: string[];
OperatorLoadOuts: IOperatorConfigClient[];
RecentVendorPurchases: Array<number | string>;
NodeIntrosCompleted: string[];
GuildId?: IOid;
@ -329,7 +331,6 @@ export interface IInventoryClient extends IDailyAffiliations {
BlessingCooldown: IMongoDate;
CrewShipRawSalvage: IConsumable[];
CrewMembers: ICrewMember[];
AdultOperatorLoadOuts: IOperatorConfigClient[];
LotusCustomization: ILotusCustomization;
UseAdultOperatorLoadout?: boolean;
NemesisAbandonedRewards: string[];

View File

@ -27,9 +27,9 @@ export interface ISaveLoadoutRequest {
Horses: IItemEntry;
DrifterMelee: IItemEntry;
UpgradeVer: number;
OperatorLoadOuts: IOperatorConfigEntry;
AdultOperatorLoadOuts: IOperatorConfigEntry;
KahlLoadOuts: IItemEntry;
OperatorLoadOuts: IOperatorConfigEntry;
KahlLoadOuts: IOperatorConfigEntry;
CrewShips: IItemEntry;
CurrentLoadOutIds: IOid[];
ValidNewLoadoutId: string;