XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

SpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 1 Star 0
返回提交历史

XFEstudio/SpaceNinjaServer

refactor: Combine Equipment and Config Types (#289)

Co-authored-by: AMelonInsideLemon <AMelonInsideLemon@users.noreply.github.com> Co-authored-by: Ordis <134585663+OrdisPrime@users.noreply.github.com>

e2221f25
AMelonInsideLemon <166175391+AMelonInsideLemon@users.noreply.github.com>
提交于

代码差异

11 个文件 +215 -625
Modified src/controllers/api/upgradesController.ts +10 -10
@@ -1,7 +1,7 @@
1 1 import { RequestHandler } from "express";
2 2 import { IUpgradesRequest } from "@/src/types/requestTypes";
3 import { FocusSchool } from "@/src/types/inventoryTypes/commonInventoryTypes";
4 import { IGenericItemDatabase, IMiscItem, TGenericItemKey } from "@/src/types/inventoryTypes/inventoryTypes";
3 import { FocusSchool, IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
4 import { IMiscItem, IEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
5 5 import { getAccountIdForRequest } from "@/src/services/loginService";
6 6 import { addMiscItems, getInventory, updateCurrency } from "@/src/services/inventoryService";
7 7
@@ -28,7 +28,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
28 28 switch (operation.UpgradeRequirement) {
29 29 case "/Lotus/Types/Items/MiscItems/OrokinReactor":
30 30 case "/Lotus/Types/Items/MiscItems/OrokinCatalyst":
31 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
31 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
32 32 if (item._id.toString() == payload.ItemId.$oid) {
33 33 item.Features ??= 0;
34 34 item.Features |= 1;
@@ -38,7 +38,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
38 38 break;
39 39 case "/Lotus/Types/Items/MiscItems/UtilityUnlocker":
40 40 case "/Lotus/Types/Items/MiscItems/WeaponUtilityUnlocker":
41 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
41 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
42 42 if (item._id.toString() == payload.ItemId.$oid) {
43 43 item.Features ??= 0;
44 44 item.Features |= 2;
@@ -49,7 +49,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
49 49 case "/Lotus/Types/Items/MiscItems/WeaponPrimaryArcaneUnlocker":
50 50 case "/Lotus/Types/Items/MiscItems/WeaponSecondaryArcaneUnlocker":
51 51 case "/Lotus/Types/Items/MiscItems/WeaponMeleeArcaneUnlocker":
52 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
52 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
53 53 if (item._id.toString() == payload.ItemId.$oid) {
54 54 item.Features ??= 0;
55 55 item.Features |= 32;
@@ -61,7 +61,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
61 61 case "/Lotus/Types/Items/MiscItems/FormaUmbra":
62 62 case "/Lotus/Types/Items/MiscItems/FormaAura":
63 63 case "/Lotus/Types/Items/MiscItems/FormaStance":
64 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
64 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
65 65 if (item._id.toString() == payload.ItemId.$oid) {
66 66 item.XP = 0;
67 67 setSlotPolarity(item, operation.PolarizeSlot, operation.PolarizeValue);
@@ -72,7 +72,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
72 72 }
73 73 break;
74 74 case "/Lotus/Types/Items/MiscItems/ModSlotUnlocker":
75 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
75 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
76 76 if (item._id.toString() == payload.ItemId.$oid) {
77 77 item.ModSlotPurchases ??= 0;
78 78 item.ModSlotPurchases += 1;
@@ -87,7 +87,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
87 87 }
88 88 break;
89 89 case "/Lotus/Types/Items/MiscItems/CustomizationSlotUnlocker":
90 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
90 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
91 91 if (item._id.toString() == payload.ItemId.$oid) {
92 92 item.CustomizationSlotPurchases ??= 0;
93 93 item.CustomizationSlotPurchases += 1;
@@ -103,7 +103,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
103 103 break;
104 104 case "":
105 105 console.assert(operation.OperationType == "UOT_SWAP_POLARITY");
106 for (const item of inventory[payload.ItemCategory as TGenericItemKey] as IGenericItemDatabase[]) {
106 for (const item of inventory[payload.ItemCategory as IEquipmentKey] as IEquipmentDatabase[]) {
107 107 if (item._id.toString() == payload.ItemId.$oid) {
108 108 for (let i = 0; i != operation.PolarityRemap.length; ++i) {
109 109 if (operation.PolarityRemap[i].Slot != i) {
@@ -122,7 +122,7 @@ export const upgradesController: RequestHandler = async (req, res) => {
122 122 res.json({ InventoryChanges });
123 123 };
124 124
125 const setSlotPolarity = (item: IGenericItemDatabase, slot: number, polarity: FocusSchool): void => {
125 const setSlotPolarity = (item: IEquipmentDatabase, slot: number, polarity: FocusSchool): void => {
126 126 item.Polarity ??= [];
127 127 const entry = item.Polarity.find(entry => entry.Slot == slot);
128 128 if (entry) {
Modified src/models/inventoryModels/inventoryModel.ts +66 -149
@@ -8,7 +8,6 @@ import {
8 8 IBooster,
9 9 IInventoryResponse,
10 10 ISlots,
11 IGenericItem,
12 11 IMailbox,
13 12 IDuviriInfo,
14 13 IPendingRecipe as IPendingRecipeDatabase,
@@ -16,14 +15,13 @@ import {
16 15 ITypeCount,
17 16 IFocusXP,
18 17 IFocusUpgrades,
19 IGenericItem2,
20 18 ITypeXPItem,
21 19 IChallengeProgress,
22 20 IStepSequencer,
23 21 IAffiliation,
24 22 INotePacks,
25 23 ICompletedJobChain,
26 ISeasonChallengeHistory,
24 ISeasonChallenge,
27 25 IPlayerSkills,
28 26 ISettings,
29 27 IInfestedFoundry,
@@ -40,15 +38,14 @@ import {
40 38 ILoreFragmentScan
41 39 } from "../../types/inventoryTypes/inventoryTypes";
42 40 import { IOid } from "../../types/commonTypes";
43 import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
44 import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
45 41 import {
46 42 IAbilityOverride,
47 43 IColor,
48 44 IItemConfig,
49 IOperatorConfigClient,
50 45 IOperatorConfigDatabase,
51 IPolarity
46 IPolarity,
47 IEquipmentDatabase,
48 IOperatorConfigClient
52 49 } from "@/src/types/inventoryTypes/commonInventoryTypes";
53 50 import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers";
54 51
@@ -185,33 +182,35 @@ ItemConfigSchema.set("toJSON", {
185 182 }
186 183 });
187 184
188 //TODO: migrate to one schema for weapons and suits.. and possibly others
189 const WeaponSchema = new Schema<IWeaponDatabase>(
190 {
191 ItemType: String,
192 Configs: [ItemConfigSchema],
193 UpgradeVer: Number,
194 XP: Number,
195 Features: Number,
196 Polarized: Number,
197 Polarity: [polaritySchema],
198 FocusLens: String,
199 ModSlotPurchases: Number,
200 CustomizationSlotPurchases: Number,
201 UpgradeType: Schema.Types.Mixed, //todo
202 UpgradeFingerprint: String,
203 ItemName: String,
204 ModularParts: [String],
205 UnlockLevel: Number
206 },
207 { id: false }
208 );
185 const EquipmentSchema = new Schema<IEquipmentDatabase>({
186 ItemType: String,
187 Configs: [ItemConfigSchema],
188 UpgradeVer: Number,
189 XP: Number,
190 Features: Number,
191 Polarized: Number,
192 Polarity: [polaritySchema],
193 FocusLens: String,
194 ModSlotPurchases: Number,
195 CustomizationSlotPurchases: Number,
196 UpgradeType: Schema.Types.Mixed, //todo
197 UpgradeFingerprint: String,
198 ItemName: String,
199 InfestationDate: Date,
200 InfestationDays: Number,
201 InfestationType: String,
202 ModularParts: [String],
203 UnlockLevel: Number,
204 Expiry: Date,
205 SkillTree: String,
206 ArchonCrystalUpgrades: [Schema.Types.Mixed] //TODO
207 });
209 208
210 WeaponSchema.virtual("ItemId").get(function () {
209 EquipmentSchema.virtual("ItemId").get(function () {
211 210 return { $oid: this._id.toString() } satisfies IOid;
212 211 });
213 212
214 WeaponSchema.set("toJSON", {
213 EquipmentSchema.set("toJSON", {
215 214 virtuals: true,
216 215 transform(_document, returnedObject) {
217 216 delete returnedObject._id;
@@ -248,7 +247,7 @@ RawUpgrades.set("toJSON", {
248 247 });
249 248
250 249 //TODO: find out what this is
251 const upgrqadesSchema = new Schema(
250 const upgradesSchema = new Schema(
252 251 {
253 252 UpgradeFingerprint: String,
254 253 ItemType: String
@@ -256,42 +255,11 @@ const upgrqadesSchema = new Schema(
256 255 { id: false }
257 256 );
258 257
259 upgrqadesSchema.virtual("ItemId").get(function () {
258 upgradesSchema.virtual("ItemId").get(function () {
260 259 return toOid(this._id);
261 260 });
262 261
263 upgrqadesSchema.set("toJSON", {
264 virtuals: true,
265 transform(_document, returnedObject) {
266 delete returnedObject._id;
267 delete returnedObject.__v;
268 }
269 });
270
271 //TODO: reduce weapon and suit schemas to one schema if reasonable
272 const suitSchema = new Schema<ISuitDatabase>(
273 {
274 ItemType: String,
275 Configs: [ItemConfigSchema],
276 UpgradeVer: Number,
277 XP: Number,
278 InfestationDate: Date,
279 Features: Number,
280 Polarity: [polaritySchema],
281 Polarized: Number,
282 ModSlotPurchases: Number,
283 CustomizationSlotPurchases: Number,
284 FocusLens: String,
285 UnlockLevel: Number
286 },
287 { id: false }
288 );
289
290 suitSchema.virtual("ItemId").get(function () {
291 return { $oid: this._id.toString() } satisfies IOid;
292 });
293
294 suitSchema.set("toJSON", {
262 upgradesSchema.set("toJSON", {
295 263 virtuals: true,
296 264 transform(_document, returnedObject) {
297 265 delete returnedObject._id;
@@ -321,33 +289,6 @@ FlavourItemSchema.set("toJSON", {
321 289 }
322 290 });
323 291
324 const GenericItemSchema = new Schema<IGenericItem>(
325 {
326 ItemType: String,
327 Configs: [ItemConfigSchema],
328 UpgradeVer: Number,
329 XP: Number,
330 Features: Number,
331 Polarity: [polaritySchema],
332 Polarized: Number,
333 ModSlotPurchases: Number,
334 CustomizationSlotPurchases: Number
335 },
336 { id: false }
337 );
338
339 GenericItemSchema.virtual("ItemId").get(function () {
340 return { $oid: this._id.toString() } satisfies IOid;
341 });
342
343 GenericItemSchema.set("toJSON", {
344 virtuals: true,
345 transform(_document, returnedObject) {
346 delete returnedObject._id;
347 delete returnedObject.__v;
348 }
349 });
350
351 292 // "Mailbox": { "LastInboxId": { "$oid": "123456780000000000000000" } }
352 293 const MailboxSchema = new Schema<IMailbox>(
353 294 {
@@ -384,30 +325,6 @@ DuviriInfoSchema.set("toJSON", {
384 325 }
385 326 });
386 327
387 // eslint-disable-next-line @typescript-eslint/no-unused-vars
388 const GenericItemSchema2 = new Schema<IGenericItem2>({
389 ItemType: String,
390 ItemName: String,
391 XP: Number,
392 UpgradeVer: Number, //this is probably __v
393 Features: Number,
394 Polarized: Number,
395 CustomizationSlotPurchases: Number,
396 ModSlotPurchases: Number,
397 FocusLens: String,
398 Expiry: Date, //TODO: needs conversion
399 Polarity: [polaritySchema],
400 Configs: [ItemConfigSchema],
401 ModularParts: [String],
402 SkillTree: String,
403 UpgradeType: String,
404 UpgradeFingerprint: String,
405 OffensiveUpgrade: String,
406 DefensiveUpgrade: String,
407 UpgradesExpiry: Date, //TODO: needs conversion
408 ArchonCrystalUpgrades: []
409 });
410
411 328 const TypeXPItemSchema = new Schema<ITypeXPItem>(
412 329 {
413 330 ItemType: String,
@@ -475,7 +392,7 @@ const completedJobChainsSchema = new Schema<ICompletedJobChain>(
475 392 { _id: false }
476 393 );
477 394
478 const seasonChallengeHistorySchema = new Schema<ISeasonChallengeHistory>(
395 const seasonChallengeHistorySchema = new Schema<ISeasonChallenge>(
479 396 {
480 397 challenge: String,
481 398 id: String
@@ -696,31 +613,31 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
696 613 //Non Upgrade Mods Example:I have 999 item WeaponElectricityDamageMod (only "ItemCount"+"ItemType")
697 614 RawUpgrades: [RawUpgrades],
698 615 //Upgrade Mods\Riven\Arcane Example:"UpgradeFingerprint"+"ItemType"+""
699 Upgrades: [upgrqadesSchema],
616 Upgrades: [upgradesSchema],
700 617
701 618 //Warframe
702 Suits: [suitSchema],
619 Suits: [EquipmentSchema],
703 620 //Primary Weapon
704 LongGuns: [WeaponSchema],
621 LongGuns: [EquipmentSchema],
705 622 //Secondary Weapon
706 Pistols: [WeaponSchema],
623 Pistols: [EquipmentSchema],
707 624 //Melee Weapon
708 Melee: [WeaponSchema],
625 Melee: [EquipmentSchema],
709 626 //Ability Weapon like Ultimate Mech\Excalibur\Ivara etc
710 SpecialItems: [GenericItemSchema],
627 SpecialItems: [EquipmentSchema],
711 628 //The Mandachord(Octavia) is a step sequencer
712 629 StepSequencers: [StepSequencersSchema],
713 630
714 631 //Sentinel(like Helios or modular)
715 Sentinels: [Schema.Types.Mixed],
632 Sentinels: [EquipmentSchema],
716 633 //Any /Sentinels/SentinelWeapons/ (like warframe weapon)
717 SentinelWeapons: [Schema.Types.Mixed],
634 SentinelWeapons: [EquipmentSchema],
718 635 //Modular Pets
719 MoaPets: [Schema.Types.Mixed],
636 MoaPets: [EquipmentSchema],
720 637
721 638 KubrowPetEggs: [Schema.Types.Mixed],
722 639 //Like PowerSuit Cat\Kubrow or etc Pets
723 KubrowPets: [Schema.Types.Mixed],
640 KubrowPets: [EquipmentSchema],
724 641 //Prints Cat(3 Prints)\Kubrow(2 Prints) Pets
725 642 KubrowPetPrints: [Schema.Types.Mixed],
726 643
@@ -735,27 +652,27 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
735 652
736 653 //to use add SummonItem to Consumables+EquippedGear
737 654 //Archwing need Suits+Melee+Guns
738 SpaceSuits: [GenericItemSchema],
739 SpaceMelee: [GenericItemSchema],
740 SpaceGuns: [Schema.Types.Mixed],
655 SpaceSuits: [EquipmentSchema],
656 SpaceMelee: [EquipmentSchema],
657 SpaceGuns: [EquipmentSchema],
741 658 ArchwingEnabled: Boolean,
742 659 //Mech need Suits+SpaceGuns+SpecialItem
743 MechSuits: [suitSchema],
660 MechSuits: [EquipmentSchema],
744 661 ///Restoratives/HoverboardSummon (like Suit)
745 Hoverboards: [Schema.Types.Mixed],
662 Hoverboards: [EquipmentSchema],
746 663
747 664 //Use Operator\Drifter
748 665 UseAdultOperatorLoadout: Boolean,
749 666 //Operator\Drifter Weapon
750 OperatorAmps: [Schema.Types.Mixed],
667 OperatorAmps: [EquipmentSchema],
751 668 //Operator
752 669 OperatorLoadOuts: [operatorConfigSchema],
753 670 //Drifter
754 671 AdultOperatorLoadOuts: [operatorConfigSchema],
755 DrifterMelee: [GenericItemSchema],
756 DrifterGuns: [GenericItemSchema],
672 DrifterMelee: [EquipmentSchema],
673 DrifterGuns: [EquipmentSchema],
757 674 //ErsatzHorsePowerSuit
758 Horses: [GenericItemSchema],
675 Horses: [EquipmentSchema],
759 676
760 677 //LandingCraft like Liset
761 678 Ships: { type: [Schema.Types.ObjectId], ref: "Ships" },
@@ -763,7 +680,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
763 680 ShipDecorations: [typeCountSchema],
764 681
765 682 //RailJack Setting(Mods,Skin,Weapon,etc)
766 CrewShipHarnesses: [Schema.Types.Mixed],
683 CrewShipHarnesses: [EquipmentSchema],
767 684 //Railjack/Components(https://warframe.fandom.com/wiki/Railjack/Components)
768 685 CrewShipRawSalvage: [Schema.Types.Mixed],
769 686
@@ -790,7 +707,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
790 707 FlavourItems: [FlavourItemSchema],
791 708
792 709 //Lunaro Weapon
793 Scoops: [GenericItemSchema],
710 Scoops: [EquipmentSchema],
794 711
795 712 //Mastery Rank*(Need item XPInfo to rank up)
796 713 PlayerLevel: Number,
@@ -907,7 +824,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
907 824 InvasionChainProgress: [Schema.Types.Mixed],
908 825
909 826 //https://warframe.fandom.com/wiki/Parazon
910 DataKnives: [GenericItemSchema],
827 DataKnives: [EquipmentSchema],
911 828
912 829 //CorpusLich or GrineerLich
913 830 NemesisAbandonedRewards: [String],
@@ -1000,24 +917,24 @@ inventorySchema.set("toJSON", {
1000 917
1001 918 // type overwrites for subdocuments/subdocument arrays
1002 919 type InventoryDocumentProps = {
1003 Suits: Types.DocumentArray<ISuitDatabase>;
1004 LongGuns: Types.DocumentArray<IWeaponDatabase>;
1005 Pistols: Types.DocumentArray<IWeaponDatabase>;
1006 Melee: Types.DocumentArray<IWeaponDatabase>;
920 Suits: Types.DocumentArray<IEquipmentDatabase>;
921 LongGuns: Types.DocumentArray<IEquipmentDatabase>;
922 Pistols: Types.DocumentArray<IEquipmentDatabase>;
923 Melee: Types.DocumentArray<IEquipmentDatabase>;
1007 924 FlavourItems: Types.DocumentArray<IFlavourItem>;
1008 925 RawUpgrades: Types.DocumentArray<IRawUpgrade>;
1009 926 Upgrades: Types.DocumentArray<ICrewShipSalvagedWeaponSkin>;
1010 927 MiscItems: Types.DocumentArray<IMiscItem>;
1011 928 Boosters: Types.DocumentArray<IBooster>;
1012 929 OperatorLoadOuts: Types.DocumentArray<IOperatorConfigClient>;
1013 SpecialItems: Types.DocumentArray<IGenericItem>;
930 SpecialItems: Types.DocumentArray<IEquipmentDatabase>;
1014 931 AdultOperatorLoadOuts: Types.DocumentArray<IOperatorConfigClient>; //TODO: this should still contain _id
1015 MechSuits: Types.DocumentArray<ISuitDatabase>;
1016 Scoops: Types.DocumentArray<IGenericItem>;
1017 DataKnives: Types.DocumentArray<IGenericItem>;
1018 DrifterMelee: Types.DocumentArray<IGenericItem>;
1019 Sentinels: Types.DocumentArray<IWeaponDatabase>;
1020 Horses: Types.DocumentArray<IGenericItem>;
932 MechSuits: Types.DocumentArray<IEquipmentDatabase>;
933 Scoops: Types.DocumentArray<IEquipmentDatabase>;
934 DataKnives: Types.DocumentArray<IEquipmentDatabase>;
935 DrifterMelee: Types.DocumentArray<IEquipmentDatabase>;
936 Sentinels: Types.DocumentArray<IEquipmentDatabase>;
937 Horses: Types.DocumentArray<IEquipmentDatabase>;
1021 938 PendingRecipes: Types.DocumentArray<IPendingRecipeDatabase>;
1022 939 };
1023 940
Modified src/models/inventoryModels/loadoutModel.ts +2 -1
@@ -1,5 +1,6 @@
1 1 import { IOid } from "@/src/types/commonTypes";
2 import { ILoadoutConfigDatabase, ILoadoutDatabase, IEquipmentSelection } from "@/src/types/saveLoadoutTypes";
2 import { IEquipmentSelection } from "@/src/types/inventoryTypes/commonInventoryTypes";
3 import { ILoadoutConfigDatabase, ILoadoutDatabase } from "@/src/types/saveLoadoutTypes";
3 4 import { Model, Schema, Types, model } from "mongoose";
4 5
5 6 const oidSchema = new Schema<IOid>(
Modified src/services/inventoryService.ts +6 -7
@@ -2,9 +2,7 @@ import { Inventory } from "@/src/models/inventoryModels/inventoryModel";
2 2 import new_inventory from "@/static/fixed_responses/postTutorialInventory.json";
3 3 import { config } from "@/src/services/configService";
4 4 import { Types } from "mongoose";
5 import { ISuitClient } from "@/src/types/inventoryTypes/SuitTypes";
6 5 import { SlotNames } from "@/src/types/purchaseTypes";
7 import { IWeaponClient } from "@/src/types/inventoryTypes/weaponTypes";
8 6 import {
9 7 IChallengeProgress,
10 8 IConsumable,
@@ -13,7 +11,7 @@ import {
13 11 IMiscItem,
14 12 IMission,
15 13 IRawUpgrade,
16 ISeasonChallengeHistory,
14 ISeasonChallenge,
17 15 ITypeCount,
18 16 InventorySlot
19 17 } from "@/src/types/inventoryTypes/inventoryTypes";
@@ -27,6 +25,7 @@ import {
27 25 import { logger } from "@/src/utils/logger";
28 26 import { WeaponTypeInternal, getWeaponType, getExalted } from "@/src/services/itemDataService";
29 27 import { ISyndicateSacrifice, ISyndicateSacrificeResponse } from "../types/syndicateTypes";
28 import { IEquipmentClient } from "../types/inventoryTypes/commonInventoryTypes";
30 29
31 30 export const createInventory = async (
32 31 accountOwnerId: Types.ObjectId,
@@ -237,7 +236,7 @@ export const addSentinel = async (sentinelName: string, accountId: string) => {
237 236 return changedInventory.Sentinels[sentinelIndex - 1].toJSON();
238 237 };
239 238
240 export const addPowerSuit = async (powersuitName: string, accountId: string): Promise<ISuitClient> => {
239 export const addPowerSuit = async (powersuitName: string, accountId: string): Promise<IEquipmentClient> => {
241 240 const specialItems = getExalted(powersuitName);
242 241 if (specialItems != false) {
243 242 for await (const specialItem of specialItems) {
@@ -386,7 +385,7 @@ export const addWeapon = async (
386 385 weaponType: WeaponTypeInternal,
387 386 weaponName: string,
388 387 accountId: string
389 ): Promise<IWeaponClient> => {
388 ): Promise<IEquipmentClient> => {
390 389 const inventory = await getInventory(accountId);
391 390
392 391 let weaponIndex;
@@ -418,7 +417,7 @@ export const addCustomization = async (customizatonName: string, accountId: stri
418 417
419 418 const addGearExpByCategory = (
420 419 inventory: IInventoryDatabaseDocument,
421 gearArray: ISuitClient[] | IWeaponClient[] | undefined,
420 gearArray: IEquipmentClient[] | undefined,
422 421 categoryName: "Pistols" | "LongGuns" | "Melee" | "Suits"
423 422 ) => {
424 423 const category = inventory[categoryName];
@@ -534,7 +533,7 @@ export const updateChallengeProgress = async (challenges: IUpdateChallengeProgre
534 533
535 534 export const addSeasonalChallengeHistory = (
536 535 inventory: IInventoryDatabaseDocument,
537 itemsArray: ISeasonChallengeHistory[] | undefined
536 itemsArray: ISeasonChallenge[] | undefined
538 537 ) => {
539 538 const category = inventory.SeasonChallengeHistory;
540 539
Deleted src/types/inventoryTypes/SuitTypes.ts +0 -25
@@ -1,25 +0,0 @@
1 import { IOid } from "@/src/types/commonTypes";
2 import { IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
3 import { Types } from "mongoose";
4 import { IItemConfig } from "./commonInventoryTypes";
5
6 export interface ISuitClient extends Omit<ISuitDatabase, "_id"> {
7 ItemId: IOid;
8 }
9
10 export interface ISuitDatabase {
11 ItemType: string;
12 Configs: IItemConfig[];
13 UpgradeVer?: number;
14 XP?: number;
15 InfestationDate?: Date;
16 Features?: number;
17 Polarity?: IPolarity[];
18 Polarized?: number;
19 ModSlotPurchases?: number;
20 CustomizationSlotPurchases?: number;
21 FocusLens?: string;
22 UnlockLevel?: number;
23 _id: Types.ObjectId;
24 ItemId?: IOid; // only in response
25 }
Modified src/types/inventoryTypes/commonInventoryTypes.ts +42 -21
@@ -1,4 +1,4 @@
1 import { IOid } from "@/src/types/commonTypes";
1 import { IMongoDate, IOid } from "@/src/types/commonTypes";
2 2 import { Types } from "mongoose";
3 3
4 4 export interface IPolarity {
@@ -38,15 +38,8 @@ export interface ISlotsBin {
38 38 Slots: number;
39 39 }
40 40
41 // ISigCol? IsIgCoL? ISIGCOL!
42 export interface Isigcol {
43 t0: number;
44 t1: number;
45 en: number;
46 }
47
48 interface IItemConfigBase {
49 Skins: string[];
41 export interface IItemConfig {
42 Skins?: string[];
50 43 pricol?: IColor;
51 44 attcol?: IColor;
52 45 sigcol?: IColor;
@@ -56,12 +49,7 @@ interface IItemConfigBase {
56 49 cloth?: IColor;
57 50 Upgrades?: string[];
58 51 Name?: string;
59 ugly?: boolean;
60 }
61
62 //TODO: Proper names for the different config types, this should be something like
63 //IItemConfigPlayable
64 export interface IItemConfig extends IItemConfigBase {
52 OperatorAmp?: IOid;
65 53 Songs?: ISong[];
66 54 AbilityOverride?: IAbilityOverride;
67 55 PvpUpgrades?: string[];
@@ -74,14 +62,47 @@ export interface ISong {
74 62 p?: string;
75 63 s: string;
76 64 }
77
78 //TODO: Consider renaming it to loadout instead of config
79 export interface IOperatorConfigDatabase extends IItemConfigBase {
65 export interface IOperatorConfigDatabase extends IItemConfig {
80 66 _id: Types.ObjectId;
81 AbilityOverride?: IAbilityOverride; // not present in adultOperator
82 OperatorAmp?: IOid; // not present in adultOperator
83 67 }
84 68
85 69 export interface IOperatorConfigClient extends Omit<IOperatorConfigDatabase, "_id"> {
86 70 ItemId: IOid;
87 71 }
72
73 export interface IEquipmentSelection {
74 ItemId: IOid;
75 mod?: number;
76 cus?: number;
77 ItemType?: string;
78 hide?: boolean;
79 }
80
81 export interface IEquipmentClient extends Omit<IEquipmentDatabase, "_id"> {
82 ItemId: IOid;
83 }
84
85 export interface IEquipmentDatabase {
86 ItemType: string;
87 ItemName?: string;
88 Configs: IItemConfig[];
89 UpgradeVer?: number;
90 XP?: number;
91 Features?: number;
92 Polarized?: number;
93 Polarity?: IPolarity[];
94 FocusLens?: string;
95 ModSlotPurchases?: number;
96 CustomizationSlotPurchases?: number;
97 UpgradeType?: string;
98 UpgradeFingerprint?: string;
99 InfestationDate?: IMongoDate;
100 InfestationDays?: number;
101 InfestationType?: string;
102 ModularParts?: string[];
103 UnlockLevel?: number;
104 Expiry?: IMongoDate;
105 SkillTree?: string;
106 ArchonCrystalUpgrades?: []; //TODO
107 _id: Types.ObjectId;
108 }
Modified src/types/inventoryTypes/inventoryTypes.ts +74 -341
@@ -2,15 +2,13 @@
2 2 import { Document, Types } from "mongoose";
3 3 import { IOid, IMongoDate } from "../commonTypes";
4 4 import {
5 IAbilityOverride,
6 5 IColor,
7 6 FocusSchool,
8 IPolarity,
9 7 IItemConfig,
10 IOperatorConfigClient
8 IOperatorConfigClient,
9 IEquipmentSelection,
10 IEquipmentDatabase
11 11 } from "@/src/types/inventoryTypes/commonInventoryTypes";
12 import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
13 import { IOperatorLoadOutSigcol, IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
14 12
15 13 //Document extends will be deleted soon. TODO: delete and migrate uses to ...
16 14 export interface IInventoryDatabaseDocument extends IInventoryDatabase, Document {}
@@ -61,48 +59,14 @@ export interface ITypeCount {
61 59 ItemCount: number;
62 60 }
63 61
64 export interface IGenericItem2 {
65 ItemType: string;
66 ItemName: string;
67 ItemId: IOid;
68 XP: number;
69 UpgradeVer: number;
70 Features: number;
71 Polarized: number;
72 CustomizationSlotPurchases: number;
73 ModSlotPurchases: number;
74 FocusLens: string;
75 Expiry: IMongoDate;
76 Polarity: IPolarity[];
77 Configs: IItemConfig[];
78 ModularParts: string[];
79 SkillTree: string;
80 UpgradeType: string;
81 UpgradeFingerprint: string;
82 OffensiveUpgrade: string;
83 DefensiveUpgrade: string;
84 UpgradesExpiry: IMongoDate;
85 ArchonCrystalUpgrades: [];
86 }
87
88 export interface IGenericItem {
89 ItemType: string;
90 XP?: number;
91 Configs: IItemConfig[];
92 UpgradeVer: number;
93 ItemId: IOid;
94 Features?: number;
95 Polarity?: IPolarity[];
96 Polarized?: number;
97 ModSlotPurchases?: number;
98 CustomizationSlotPurchases?: number;
99 }
100
101 export interface IGenericItemDatabase extends Omit<IGenericItem, "ItemId"> {
102 _id: Types.ObjectId;
103 }
104
105 export type TGenericItemKey = "Suits" | "LongGuns" | "Pistols" | "Melee";
62 export type IEquipmentKey =
63 | "Suits"
64 | "LongGuns"
65 | "Pistols"
66 | "Melee"
67 | "SpecialItems"
68 | "Sentinels"
69 | "SentinelWeapons";
106 70
107 71 export interface IDuviriInfo {
108 72 Seed: number;
@@ -119,12 +83,12 @@ export interface IPendingRecipeResponse extends Omit<IPendingRecipe, "Completion
119 83 CompletionDate: IMongoDate;
120 84 }
121 85 export interface IInventoryResponse {
122 Horses: IGenericItem[];
123 DrifterMelee: IGenericItem[];
124 DrifterGuns: IGenericItem[];
86 Horses: IEquipmentDatabase[];
87 DrifterMelee: IEquipmentDatabase[];
88 DrifterGuns: IEquipmentDatabase[];
125 89 DuviriInfo: IDuviriInfo;
126 90 Mailbox: IMailbox;
127 KahlLoadOuts: IGenericItem[];
91 KahlLoadOuts: IEquipmentDatabase[];
128 92 SubscribedToEmails: number;
129 93 Created: IMongoDate;
130 94 RewardSeed: number;
@@ -156,19 +120,19 @@ export interface IInventoryResponse {
156 120 ChallengeProgress: IChallengeProgress[];
157 121 RawUpgrades: IRawUpgrade[];
158 122 ReceivedStartingGear: boolean;
159 Suits: ISuitDatabase[];
160 LongGuns: IWeaponDatabase[];
161 Pistols: IWeaponDatabase[];
162 Melee: IWeaponDatabase[];
123 Suits: IEquipmentDatabase[];
124 LongGuns: IEquipmentDatabase[];
125 Pistols: IEquipmentDatabase[];
126 Melee: IEquipmentDatabase[];
163 127 Ships: IShipInventory[];
164 128 QuestKeys: IQuestKeyResponse[];
165 129 FlavourItems: IFlavourItem[];
166 Scoops: IGenericItem[];
130 Scoops: IEquipmentDatabase[];
167 131 TrainingRetriesLeft: number;
168 132 LoadOutPresets: ILoadOutPresets;
169 133 CurrentLoadOutIds: Array<any[] | IOid>;
170 134 Missions: IMission[];
171 RandomUpgradesIdentified: number;
135 RandomUpgradesIdentified?: number;
172 136 LastRegionPlayed: string;
173 137 XPInfo: ITypeXPItem[];
174 138 Recipes: ITypeCount[];
@@ -198,14 +162,14 @@ export interface IInventoryResponse {
198 162 Affiliations: IAffiliation[];
199 163 QualifyingInvasions: any[];
200 164 FactionScores: number[];
201 SpaceSuits: IGenericItem[];
202 SpaceMelee: IGenericItem[];
203 SpaceGuns: ISpaceGun[];
165 SpaceSuits: IEquipmentDatabase[];
166 SpaceMelee: IEquipmentDatabase[];
167 SpaceGuns: IEquipmentDatabase[];
204 168 ArchwingEnabled: boolean;
205 169 PendingSpectreLoadouts: any[];
206 170 SpectreLoadouts: ISpectreLoadout[];
207 SentinelWeapons: IWeaponDatabase[];
208 Sentinels: IWeaponDatabase[];
171 SentinelWeapons: IEquipmentDatabase[];
172 Sentinels: IEquipmentDatabase[];
209 173 EmailItems: ITypeXPItem[];
210 174 CompletedSyndicates: string[];
211 175 FocusXP: IFocusXP;
@@ -216,7 +180,7 @@ export interface IInventoryResponse {
216 180 Drones: IDrone[];
217 181 StepSequencers: IStepSequencer[];
218 182 ActiveAvatarImageType: string;
219 KubrowPets: IKubrowPet[];
183 KubrowPets: IEquipmentDatabase[];
220 184 ShipDecorations: IConsumable[];
221 185 DailyAffiliationCetus: number;
222 186 DailyAffiliationQuills: number;
@@ -224,14 +188,14 @@ export interface IInventoryResponse {
224 188 CompletedJobs: ICompletedJob[];
225 189 FocusAbility: string;
226 190 FocusUpgrades: IFocusUpgrade[];
227 OperatorAmps: IOperatorAmp[];
228 HasContributedToDojo: boolean;
191 OperatorAmps: IEquipmentDatabase[];
192 HasContributedToDojo?: boolean;
229 193 HWIDProtectEnabled: boolean;
230 194 KubrowPetPrints: IKubrowPetPrint[];
231 195 AlignmentReplay: IAlignment;
232 196 PersonalGoalProgress: IPersonalGoalProgress[];
233 197 DailyAffiliationSolaris: number;
234 SpecialItems: IGenericItem[];
198 SpecialItems: IEquipmentDatabase[];
235 199 ThemeStyle: string;
236 200 ThemeBackground: string;
237 201 ThemeSounds: string;
@@ -242,17 +206,17 @@ export interface IInventoryResponse {
242 206 DailyAffiliationVentkids: number;
243 207 DailyAffiliationVox: number;
244 208 RecentVendorPurchases: Array<number | string>;
245 Hoverboards: IHoverboard[];
209 Hoverboards: IEquipmentDatabase[];
246 210 NodeIntrosCompleted: string[];
247 211 GuildId?: IOid;
248 212 CompletedJobChains: ICompletedJobChain[];
249 SeasonChallengeHistory: ISeasonChallengeHistory[];
250 MoaPets: IMoaPet[];
213 SeasonChallengeHistory: ISeasonChallenge[];
214 MoaPets: IEquipmentDatabase[];
251 215 EquippedInstrument: string;
252 216 InvasionChainProgress: IInvasionChainProgress[];
253 DataKnives: IGenericItem[];
217 DataKnives: IEquipmentDatabase[];
254 218 NemesisHistory: INemesisHistory[];
255 LastNemesisAllySpawnTime: IMongoDate;
219 LastNemesisAllySpawnTime?: IMongoDate;
256 220 Settings: ISettings;
257 221 PersonalTechProjects: IPersonalTechProject[];
258 222 CrewShips: ICrewShip[];
@@ -262,15 +226,15 @@ export interface IInventoryResponse {
262 226 CrewShipWeapons: ICrewShipWeapon[];
263 227 CrewShipSalvagedWeapons: ICrewShipWeapon[];
264 228 CrewShipWeaponSkins: ICrewShipSalvagedWeaponSkin[];
265 TradeBannedUntil: IMongoDate;
229 TradeBannedUntil?: IMongoDate;
266 230 PlayedParkourTutorial: boolean;
267 231 SubscribedToEmailsPersonalized: number;
268 232 DailyAffiliationEntrati: number;
269 233 DailyAffiliationNecraloid: number;
270 MechSuits: ISuitDatabase[];
234 MechSuits: IEquipmentDatabase[];
271 235 InfestedFoundry: IInfestedFoundry;
272 236 BlessingCooldown: IMongoDate;
273 CrewShipHarnesses: ICrewShipHarness[];
237 CrewShipHarnesses: IEquipmentDatabase[];
274 238 CrewShipRawSalvage: IConsumable[];
275 239 CrewMembers: ICrewMember[];
276 240 AdultOperatorLoadOuts: IOperatorConfigClient[];
@@ -297,16 +261,6 @@ export interface IInventoryResponse {
297 261 DeathSquadable: boolean;
298 262 }
299 263
300 export interface IAdultOperatorLoadOut {
301 Skins: string[];
302 attcol: IColor;
303 eyecol: IColor;
304 facial: IColor;
305 pricol: IColor;
306 Upgrades?: string[];
307 ItemId: IOid;
308 }
309
310 264 export interface IAffiliation {
311 265 Initiated?: boolean;
312 266 Standing: number;
@@ -384,14 +338,11 @@ export interface ICrewMember {
384 338 WeaponId: IOid;
385 339 XP: number;
386 340 PowersuitType: string;
387 Configs: ICrewMemberConfig[];
341 Configs: IItemConfig[];
388 342 SecondInCommand: boolean;
389 343 ItemId: IOid;
390 344 }
391 345
392 // eslint-disable-next-line @typescript-eslint/no-empty-interface
393 export interface ICrewMemberConfig {}
394
395 346 export interface ISkillEfficiency {
396 347 PILOTING: ICombat;
397 348 GUNNERY: ICombat;
@@ -404,21 +355,6 @@ export interface ICombat {
404 355 Assigned: number;
405 356 }
406 357
407 export interface ICrewShipHarness {
408 ItemType: string;
409 Configs: ICrewShipHarnessConfig[];
410 Features: number;
411 UpgradeVer: number;
412 XP: number;
413 Polarity: IPolarity[];
414 Polarized: number;
415 ItemId: IOid;
416 }
417
418 export interface ICrewShipHarnessConfig {
419 Upgrades?: string[];
420 }
421
422 358 export enum InventorySlot {
423 359 SUITS = "SuitBin",
424 360 WEAPONS = "WeaponBin",
@@ -443,25 +379,21 @@ export interface ICrewShipWeapon {
443 379 ItemType: string;
444 380 UpgradeType?: string;
445 381 UpgradeFingerprint?: string;
446 Configs?: ICrewShipHarnessConfig[];
382 Configs?: IItemConfig[];
447 383 UpgradeVer?: number;
448 384 ItemId: IOid;
449 385 }
450 386
451 387 export interface ICrewShip {
452 388 ItemType: string;
453 Configs: ICrewShipConfig[];
389 Configs: IItemConfig[];
454 390 Weapon: ICrewshipWeapon;
455 391 Customization: ICustomization;
456 392 ItemName: string;
457 393 RailjackImage: IFlavourItem;
458 394 CrewMembers: ICrewMembers;
459 395 ItemId: IOid;
460 }
461
462 export interface ICrewShipConfig {
463 Skins?: string[];
464 pricol?: IColor;
396 _id: Types.ObjectId;
465 397 }
466 398
467 399 export interface ICrewMembers {
@@ -484,16 +416,6 @@ export interface IShipExterior {
484 416 ShipAttachments?: IShipAttachments;
485 417 }
486 418
487 //TODO: check whether it makes sense to use this specifity of color.
488 export interface IShipExteriorColors {
489 t0: number;
490 t1: number;
491 t2: number;
492 t3: number;
493 m0: number;
494 en: number;
495 }
496
497 419 export interface IShipAttachments {
498 420 HOOD_ORNAMENT: string; //TODO: Others are probably possible
499 421 }
@@ -512,22 +434,12 @@ export interface ICrewshipWeapon {
512 434 PORT_GUNS: IPortGuns;
513 435 }
514 436
515 export interface IPilot {
516 PRIMARY_A: IL;
517 SECONDARY_A: IL;
518 }
519
520 // L? Bozo.
521 export interface IL {
522 ItemId?: IOid;
523 mod?: number;
524 cus?: number;
525 ItemType?: string;
526 hide?: boolean;
437 export interface IPortGuns {
438 PRIMARY_A: IEquipmentSelection;
527 439 }
528 440
529 export interface IPortGuns {
530 PRIMARY_A: IL;
441 export interface IPilot extends IPortGuns {
442 SECONDARY_A: IEquipmentSelection;
531 443 }
532 444
533 445 export interface IDiscoveredMarker {
@@ -569,38 +481,6 @@ export interface IFusionTreasure {
569 481 Sockets: number;
570 482 }
571 483
572 export interface IHoverboard {
573 ItemType: string;
574 Configs: IHoverboardConfig[];
575 ModularParts: string[];
576 ItemName?: string;
577 Polarity?: IPolarity[];
578 UpgradeVer: number;
579 XP: number;
580 Features: number;
581 ItemId: IOid;
582 }
583
584 export interface IHoverboardConfig {
585 Upgrades?: string[];
586 Skins?: IPurpleSkin[];
587 pricol?: IColor;
588 sigcol?: ISigcol;
589 attcol?: IColor;
590 }
591
592 export enum IPurpleSkin {
593 Empty = "",
594 The5Be4Af71A38E4A9306040E15 = "5be4af71a38e4a9306040e15",
595 The5C930Ac3A38E4A24Bc3Ad5De = "5c930ac3a38e4a24bc3ad5de",
596 The5C9C6F9857904A7A3B25656B = "5c9c6f9857904a7a3b25656b",
597 The5Dd8A8E3A38E4A321A45E6A0 = "5dd8a8e3a38e4a321a45e6a0"
598 }
599
600 export interface ISigcol {
601 t3: number;
602 }
603
604 484 export interface IInfestedFoundry {
605 485 Name: string;
606 486 Resources: ITypeCount[];
@@ -653,44 +533,13 @@ export interface ITraits {
653 533 Personality: string;
654 534 BodyType: string;
655 535 Head?: string;
656 Tail?: Tail;
657 }
658
659 export enum Tail {
660 Empty = "",
661 LotusTypesGameCatbrowPetTailsCatbrowTailA = "/Lotus/Types/Game/CatbrowPet/Tails/CatbrowTailA",
662 LotusTypesGameCatbrowPetTailsCatbrowTailB = "/Lotus/Types/Game/CatbrowPet/Tails/CatbrowTailB",
663 LotusTypesGameCatbrowPetTailsCatbrowTailC = "/Lotus/Types/Game/CatbrowPet/Tails/CatbrowTailC",
664 LotusTypesGameCatbrowPetTailsCatbrowTailD = "/Lotus/Types/Game/CatbrowPet/Tails/CatbrowTailD"
536 Tail?: string;
665 537 }
666 538
667 539 export enum KubrowPetPrintItemType {
668 540 LotusTypesGameKubrowPetImprintedTraitPrint = "/Lotus/Types/Game/KubrowPet/ImprintedTraitPrint"
669 541 }
670 542
671 export interface IKubrowPet {
672 ItemType: string;
673 Configs: IKubrowPetConfig[];
674 UpgradeVer: number;
675 Details: IDetails;
676 XP?: number;
677 Polarized?: number;
678 Polarity?: IPolarity[];
679 Features?: number;
680 InfestationDate?: IMongoDate;
681 InfestationDays?: number;
682 InfestationType?: string;
683 ItemId: IOid;
684 ModularParts?: string[];
685 }
686
687 export interface IKubrowPetConfig {
688 Skins?: string[];
689 pricol?: IColor;
690 attcol?: IColor;
691 Upgrades?: string[];
692 }
693
694 543 export interface IDetails {
695 544 Name: string;
696 545 IsPuppy: boolean;
@@ -733,74 +582,32 @@ export interface ILibraryPersonalProgress {
733 582
734 583 //this needs to be checked against ILoadoutDatabase
735 584 export interface ILoadOutPresets {
736 NORMAL: INormal[];
737 NORMAL_PVP: IArchwing[];
738 LUNARO: ILunaro[];
739 ARCHWING: IArchwing[];
740 SENTINEL: IArchwing[];
741 OPERATOR: IArchwing[];
742 GEAR: IGear[];
743 KDRIVE: IKdrive[];
744 DATAKNIFE: IArchwing[];
745 MECH: IMech[];
746 OPERATOR_ADULT: IArchwing[];
747 }
748
749 export interface IArchwing {
750 PresetIcon: string;
751 Favorite: boolean;
752 n?: string;
753 s: IL;
754 l?: IL;
755 m?: IL;
756 ItemId: IOid;
757 p?: IL;
758 }
759
760 export interface IGear {
761 n: string;
762 s: IL;
763 p: IL;
764 l: IL;
765 m: IL;
766 ItemId: IOid;
767 }
768
769 export interface IKdrive {
770 PresetIcon: string;
771 Favorite: boolean;
772 s: IL;
773 ItemId: IOid;
774 }
775
776 export interface ILunaro {
777 n: string;
778 s: IL;
779 m: IL;
780 ItemId: IOid;
781 }
782
783 export interface IMech {
784 PresetIcon: string;
785 Favorite: boolean;
786 s: IL;
787 h: IL;
788 a: IL;
789 ItemId: IOid;
790 }
791
792 export interface INormal {
793 FocusSchool: FocusSchool;
794 PresetIcon: string;
795 Favorite: boolean;
796 n: string;
797 s: IL;
798 p: IL;
799 l: IL;
800 m: IL;
801 h: IL;
802 a?: IL;
585 NORMAL: ILoadoutConfigClient[];
586 NORMAL_PVP: ILoadoutConfigClient[];
587 LUNARO: ILoadoutConfigClient[];
588 ARCHWING: ILoadoutConfigClient[];
589 SENTINEL: ILoadoutConfigClient[];
590 OPERATOR: ILoadoutConfigClient[];
591 GEAR: ILoadoutConfigClient[];
592 KDRIVE: ILoadoutConfigClient[];
593 DATAKNIFE: ILoadoutConfigClient[];
594 MECH: ILoadoutConfigClient[];
595 OPERATOR_ADULT: ILoadoutConfigClient[];
596 }
597
598 export interface ILoadoutConfigClient {
599 FocusSchool?: FocusSchool;
600 PresetIcon?: string;
601 Favorite?: boolean;
602 n?: string; // Loadout name
603 s?: IEquipmentSelection; // Suit
604 p?: IEquipmentSelection;
605 l?: IEquipmentSelection; // Primary weapon
606 m?: IEquipmentSelection; // Melee weapon
607 h?: IEquipmentSelection; // Gravimag weapon
608 a?: IEquipmentSelection;
803 609 ItemId: IOid;
610 Remove?: boolean; // when client wants to remove a config, it only includes ItemId & Remove.
804 611 }
805 612
806 613 export enum UpgradeType {
@@ -813,16 +620,7 @@ export interface ILoreFragmentScan {
813 620 ItemType: string;
814 621 }
815 622
816 export interface ILotusCustomization {
817 Upgrades: any[];
818 PvpUpgrades: any[];
819 Skins: string[];
820 pricol: IColor;
821 attcol: any[];
822 sigcol: any[];
823 eyecol: any[];
824 facial: any[];
825 Songs: any[];
623 export interface ILotusCustomization extends IItemConfig {
826 624 Persona: string;
827 625 }
828 626
@@ -833,18 +631,6 @@ export interface IMission {
833 631 RewardsCooldownTime?: IMongoDate;
834 632 }
835 633
836 export interface IMoaPet {
837 ItemType: string;
838 Configs: IKubrowPetConfig[];
839 UpgradeVer: number;
840 ModularParts: string[];
841 XP?: number;
842 Features?: number;
843 ItemName: string;
844 Polarity?: IPolarity[];
845 ItemId: IOid;
846 }
847
848 634 export interface INemesisHistory {
849 635 fp: number;
850 636 manifest: Manifest;
@@ -879,30 +665,6 @@ export enum Manifest {
879 665 LotusTypesGameNemesisKuvaLichKuvaLichManifestVersionTwo = "/Lotus/Types/Game/Nemesis/KuvaLich/KuvaLichManifestVersionTwo"
880 666 }
881 667
882 export interface IOperatorAmp {
883 ItemType: string;
884 Configs: IKubrowPetConfig[];
885 ModularParts?: string[];
886 XP?: number;
887 UpgradeVer?: number;
888 ItemName?: string;
889 Features?: number;
890 ItemId: IOid;
891 }
892
893 export interface IOperatorLoadOut {
894 Skins: string[];
895 pricol?: IColor;
896 attcol?: IColor;
897 eyecol: IColor;
898 facial?: IColor;
899 sigcol?: IOperatorLoadOutSigcol;
900 OperatorAmp?: IOid;
901 Upgrades?: string[];
902 AbilityOverride: IAbilityOverride;
903 ItemId: IOid;
904 }
905
906 668 export interface IPendingCoupon {
907 669 Expiry: IMongoDate;
908 670 Discount: number;
@@ -1031,12 +793,7 @@ export interface IRawUpgrade {
1031 793 LastAdded?: IOid;
1032 794 }
1033 795
1034 export interface ISeasonChallengeHistory {
1035 challenge: string;
1036 id: string;
1037 }
1038
1039 export interface ISeasonChallengeCompletions {
796 export interface ISeasonChallenge {
1040 797 challenge: string;
1041 798 id: string;
1042 799 }
@@ -1060,30 +817,6 @@ export interface IShipInventory {
1060 817 ItemId: IOid;
1061 818 }
1062 819
1063 export interface ISpaceGun {
1064 ItemType: string;
1065 Configs: ISpaceGunConfig[];
1066 XP?: number;
1067 UpgradeVer?: number;
1068 ItemId: IOid;
1069 Features?: number;
1070 Polarized?: number;
1071 Polarity?: IPolarity[];
1072 UpgradeType?: UpgradeType;
1073 UpgradeFingerprint?: string;
1074 ItemName?: string;
1075 }
1076
1077 export interface ISpaceGunConfig {
1078 Skins?: string[];
1079 pricol?: IColor;
1080 Upgrades?: string[];
1081 }
1082
1083 export interface IPurpleCol {
1084 en: number;
1085 }
1086
1087 820 export interface ISpectreLoadout {
1088 821 LongGuns: string;
1089 822 Melee: string;
Deleted src/types/inventoryTypes/weaponTypes.ts +0 -33
@@ -1,33 +0,0 @@
1 import { IOid } from "@/src/types/commonTypes";
2 import { IItemConfig } from "./commonInventoryTypes";
3 import { IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
4 import { Types } from "mongoose";
5
6 export interface IWeaponClient extends Omit<IWeaponDatabase, "_id"> {
7 ItemId: IOid;
8 }
9
10 export interface IWeaponDatabase {
11 ItemType: string;
12 Configs: IItemConfig[];
13 UpgradeVer?: number;
14 XP?: number;
15 Features?: number;
16 Polarized?: number;
17 Polarity?: IPolarity[];
18 FocusLens?: string;
19 ModSlotPurchases?: number;
20 CustomizationSlotPurchases?: number;
21 UpgradeType?: string;
22 UpgradeFingerprint?: string;
23 ItemName?: string;
24 ModularParts?: string[];
25 UnlockLevel?: number;
26 _id: Types.ObjectId;
27 }
28
29 export interface IOperatorLoadOutSigcol {
30 t0?: number;
31 t1?: number;
32 en?: number;
33 }
Modified src/types/purchaseTypes.ts +6 -7
@@ -1,6 +1,5 @@
1 import { ISuitClient } from "@/src/types/inventoryTypes/SuitTypes";
2 1 import { IFlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
3 import { IWeaponClient } from "@/src/types/inventoryTypes/weaponTypes";
2 import { IEquipmentClient } from "./inventoryTypes/commonInventoryTypes";
4 3
5 4 export interface IPurchaseRequest {
6 5 PurchaseParams: IPurchaseParams;
@@ -23,11 +22,11 @@ export interface IPurchaseResponse {
23 22 SuitBin?: IBinChanges;
24 23 WeaponBin?: IBinChanges;
25 24 MechBin?: IBinChanges;
26 MechSuits?: ISuitClient[];
27 Suits?: ISuitClient[];
28 LongGuns?: IWeaponClient[];
29 Pistols?: IWeaponClient[];
30 Melee?: IWeaponClient[];
25 MechSuits?: IEquipmentClient[];
26 Suits?: IEquipmentClient[];
27 LongGuns?: IEquipmentClient[];
28 Pistols?: IEquipmentClient[];
29 Melee?: IEquipmentClient[];
31 30 PremiumCredits?: number;
32 31 PremiumCreditsFree?: number;
33 32 RegularCredits?: number;
Modified src/types/requestTypes.ts +8 -11
@@ -1,5 +1,5 @@
1 1 import { IOid } from "./commonTypes";
2 import { IPolarity, FocusSchool } from "@/src/types/inventoryTypes/commonInventoryTypes";
2 import { IPolarity, FocusSchool, IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
3 3 import {
4 4 IBooster,
5 5 IChallengeProgress,
@@ -8,11 +8,8 @@ import {
8 8 IMiscItem,
9 9 IMission,
10 10 IRawUpgrade,
11 ISeasonChallengeCompletions,
12 ISeasonChallengeHistory
11 ISeasonChallenge
13 12 } from "./inventoryTypes/inventoryTypes";
14 import { IWeaponClient } from "./inventoryTypes/weaponTypes";
15 import { ISuitClient } from "./inventoryTypes/SuitTypes";
16 13
17 14 export interface IArtifactsRequest {
18 15 Upgrade: ICrewShipSalvagedWeaponSkin;
@@ -35,18 +32,18 @@ export interface IAffiliationChange {
35 32
36 33 export interface IUpdateChallengeProgressRequest {
37 34 ChallengeProgress: IChallengeProgress[];
38 SeasonChallengeHistory: ISeasonChallengeHistory[];
39 SeasonChallengeCompletions: ISeasonChallengeCompletions[];
35 SeasonChallengeHistory: ISeasonChallenge[];
36 SeasonChallengeCompletions: ISeasonChallenge[];
40 37 }
41 38
42 39 export interface IMissionInventoryUpdateRequest {
43 40 rewardsMultiplier?: number;
44 41 ActiveBoosters?: IBooster[];
45 42 AffiliationChanges?: IAffiliationChange[];
46 LongGuns?: IWeaponClient[];
47 Pistols?: IWeaponClient[];
48 Suits?: ISuitClient[];
49 Melee?: IWeaponClient[];
43 LongGuns?: IEquipmentClient[];
44 Pistols?: IEquipmentClient[];
45 Suits?: IEquipmentClient[];
46 Melee?: IEquipmentClient[];
50 47 RawUpgrades?: IRawUpgrade[];
51 48 MiscItems?: IMiscItem[];
52 49 Consumables?: IConsumable[];
Modified src/types/saveLoadoutTypes.ts +1 -20
@@ -1,6 +1,7 @@
1 1 import { IOid } from "@/src/types/commonTypes";
2 2 import { IItemConfig, IOperatorConfigClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
3 3 import { Types } from "mongoose";
4 import { ILoadoutConfigClient } from "./inventoryTypes/inventoryTypes";
4 5
5 6 export interface ISaveLoadoutRequest {
6 7 LoadOuts: ILoadoutClient;
@@ -72,23 +73,3 @@ export interface ILoadoutEntry {
72 73 export interface ILoadoutConfigDatabase extends Omit<ILoadoutConfigClient, "ItemId"> {
73 74 _id: Types.ObjectId;
74 75 }
75
76 // for request and response from and to client
77 export interface ILoadoutConfigClient {
78 ItemId: IOid;
79 Remove?: boolean; // when client wants to remove a config, it only includes ItemId & Remove.
80 n?: string;
81 PresetIcon?: string;
82 Favorite?: boolean;
83 s?: IEquipmentSelection;
84 p?: IEquipmentSelection;
85 l?: IEquipmentSelection;
86 m?: IEquipmentSelection;
87 }
88
89 export interface IEquipmentSelection {
90 ItemId?: IOid;
91 mod?: number;
92 cus?: number;
93 hide?: boolean;
94 }