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], OperatorLoadOuts: [operatorConfigSchema],
//Drifter //Drifter
AdultOperatorLoadOuts: [operatorConfigSchema], AdultOperatorLoadOuts: [operatorConfigSchema],
// Kahl
KahlLoadOuts: [operatorConfigSchema],
//LandingCraft like Liset //LandingCraft like Liset
Ships: { type: [Schema.Types.ObjectId], ref: "Ships" }, Ships: { type: [Schema.Types.ObjectId], ref: "Ships" },
@ -1111,7 +1113,6 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
//Unknown and system //Unknown and system
DuviriInfo: DuviriInfoSchema, DuviriInfo: DuviriInfoSchema,
Mailbox: MailboxSchema, Mailbox: MailboxSchema,
KahlLoadOuts: [Schema.Types.Mixed],
HandlerPoints: Number, HandlerPoints: Number,
ChallengesFixVersion: Number, ChallengesFixVersion: Number,
PlayedParkourTutorial: Boolean, PlayedParkourTutorial: Boolean,
@ -1177,6 +1178,7 @@ export type InventoryDocumentProps = {
Boosters: Types.DocumentArray<IBooster>; Boosters: Types.DocumentArray<IBooster>;
OperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>; OperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>; AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
KahlLoadOuts: Types.DocumentArray<IOperatorConfigDatabase>;
PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>; PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>; WeaponSkins: Types.DocumentArray<IWeaponSkinDatabase>;
} & { [K in TEquipmentKey]: Types.DocumentArray<IEquipmentDatabase> }; } & { [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) { if (client[key] !== undefined) {
replaceArray<IOperatorConfigDatabase>(db[key], client[key].map(convertOperatorConfig)); 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...) // non-empty is a change in loadout(or suit...)
switch (equipmentName) { switch (equipmentName) {
case "AdultOperatorLoadOuts":
case "OperatorLoadOuts": case "OperatorLoadOuts":
case "AdultOperatorLoadOuts": { case "KahlLoadOuts": {
const operatorConfig = equipment as IOperatorConfigEntry; const operatorConfig = equipment as IOperatorConfigEntry;
const operatorLoadout = inventory[equipmentName]; const operatorLoadout = inventory[equipmentName];
logger.debug(`operator loadout received ${equipmentName} `, operatorConfig); 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(); await inventory.save();

View File

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

View File

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