Fix interface names, add NodeIntro support. #51
@ -1,7 +1,30 @@
 | 
			
		||||
import { updateGeneric } from "@/src/services/inventoryService";
 | 
			
		||||
import { IGenericUpdate } from "@/src/types/genericUpdate";
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
 | 
			
		||||
const genericUpdateController: RequestHandler = (_req, res) => {
 | 
			
		||||
    res.json({});
 | 
			
		||||
// TODO: Nightwave evidence submission support is the only thing missing.
 | 
			
		||||
// TODO: Also, you might want to test this, because I definitely didn't.
 | 
			
		||||
const genericUpdateController: RequestHandler = async (request, response) => {
 | 
			
		||||
    const accountId = request.query.accountId as string;
 | 
			
		||||
 | 
			
		||||
    const [body] = String(request.body).split("\n");
 | 
			
		||||
 | 
			
		||||
    let reply = {};
 | 
			
		||||
    try {
 | 
			
		||||
        const update = JSON.parse(body) as IGenericUpdate;
 | 
			
		||||
        if (typeof update !== "object") {
 | 
			
		||||
            throw new Error("Invalid data format");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        reply = await updateGeneric(update, accountId);
 | 
			
		||||
    } catch (err) {
 | 
			
		||||
        console.error("Error parsing JSON data:", err);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Response support added for when Nightwave is supported below.
 | 
			
		||||
    // response.json(reply);
 | 
			
		||||
 | 
			
		||||
    response.json({});
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export { genericUpdateController };
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { RequestHandler } from "express";
 | 
			
		||||
import { missionInventoryUpdate } from "@/src/services/inventoryService";
 | 
			
		||||
import { MissionInventoryUpdate } from "@/src/types/missionInventoryUpdateType";
 | 
			
		||||
import { IMissionInventoryUpdate } from "@/src/types/missionInventoryUpdateType";
 | 
			
		||||
/*
 | 
			
		||||
- [ ]  crossPlaySetting
 | 
			
		||||
- [ ]  rewardsMultiplier
 | 
			
		||||
@ -25,13 +25,13 @@ import { MissionInventoryUpdate } from "@/src/types/missionInventoryUpdateType";
 | 
			
		||||
- [ ]  hosts
 | 
			
		||||
- [x]  ChallengeProgress
 | 
			
		||||
- [ ]  SeasonChallengeHistory
 | 
			
		||||
- [ ]  PS
 | 
			
		||||
- [ ]  PS (Passive anti-cheat data which includes your username, module list, process list, and system name.)
 | 
			
		||||
- [ ]  ActiveDojoColorResearch
 | 
			
		||||
- [ ]  RewardInfo
 | 
			
		||||
- [ ]  ReceivedCeremonyMsg
 | 
			
		||||
- [ ]  LastCeremonyResetDate
 | 
			
		||||
- [ ]  MissionPTS
 | 
			
		||||
- [ ]  RepHash
 | 
			
		||||
- [ ]  MissionPTS (Used to validate the mission/alive time above.)
 | 
			
		||||
- [ ]  RepHash (A hash from the replication manager/RepMgr Unknown what it does.)
 | 
			
		||||
- [ ]  EndOfMatchUpload
 | 
			
		||||
- [ ]  ObjectiveReached
 | 
			
		||||
- [ ]  FpsAvg
 | 
			
		||||
@ -42,20 +42,19 @@ import { MissionInventoryUpdate } from "@/src/types/missionInventoryUpdateType";
 | 
			
		||||
 | 
			
		||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
 | 
			
		||||
const missionInventoryUpdateController: RequestHandler = async (req, res) => {
 | 
			
		||||
    const [data] = String(req.body).split("\n");
 | 
			
		||||
    const id = req.query.accountId as string;
 | 
			
		||||
 | 
			
		||||
    // TODO - salt check
 | 
			
		||||
    const [data] = String(req.body).split("\n");
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
        const parsedData = JSON.parse(data) as MissionInventoryUpdate;
 | 
			
		||||
        if (typeof parsedData !== "object" || parsedData === null) throw new Error("Invalid data format");
 | 
			
		||||
        const parsedData = JSON.parse(data) as IMissionInventoryUpdate;
 | 
			
		||||
        if (typeof parsedData !== "object") throw new Error("Invalid data format");
 | 
			
		||||
        await missionInventoryUpdate(parsedData, id);
 | 
			
		||||
    } catch (err) {
 | 
			
		||||
        console.error("Error parsing JSON data:", err);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // TODO - get original response
 | 
			
		||||
    // TODO - Return the updated inventory the way the game does it.
 | 
			
		||||
    res.json({});
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,10 @@
 | 
			
		||||
import { Session, FindSessionRequest } from "@/src/types/session";
 | 
			
		||||
import { ISession, IFindSessionRequest } from "@/src/types/session";
 | 
			
		||||
 | 
			
		||||
const sessions: Session[] = [];
 | 
			
		||||
const sessions: ISession[] = [];
 | 
			
		||||
 | 
			
		||||
function createNewSession(sessionData: Session, Creator: string): Session {
 | 
			
		||||
function createNewSession(sessionData: ISession, Creator: string): ISession {
 | 
			
		||||
    const sessionId = getNewSessionID();
 | 
			
		||||
    const newSession: Session = {
 | 
			
		||||
    const newSession: ISession = {
 | 
			
		||||
        sessionId,
 | 
			
		||||
        creatorId: Creator,
 | 
			
		||||
        maxPlayers: sessionData.maxPlayers || 4,
 | 
			
		||||
@ -35,15 +35,15 @@ function createNewSession(sessionData: Session, Creator: string): Session {
 | 
			
		||||
    return newSession;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getAllSessions(): Session[] {
 | 
			
		||||
function getAllSessions(): ISession[] {
 | 
			
		||||
    return sessions;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getSessionByID(sessionId: string): Session | undefined {
 | 
			
		||||
function getSessionByID(sessionId: string): ISession | undefined {
 | 
			
		||||
    return sessions.find(session => session.sessionId === sessionId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
 | 
			
		||||
function getSession(sessionIdOrRequest: string | IFindSessionRequest): any[] {
 | 
			
		||||
    if (typeof sessionIdOrRequest === "string") {
 | 
			
		||||
        const session = sessions.find(session => session.sessionId === sessionIdOrRequest);
 | 
			
		||||
        if (session) {
 | 
			
		||||
@ -58,10 +58,10 @@ function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
 | 
			
		||||
        return [];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const request = sessionIdOrRequest as FindSessionRequest;
 | 
			
		||||
    const request = sessionIdOrRequest as IFindSessionRequest;
 | 
			
		||||
    const matchingSessions = sessions.filter(session => {
 | 
			
		||||
        for (const key in request) {
 | 
			
		||||
            if (key !== "eloRating" && key !== "queryId" && request[key] !== session[key as keyof Session]) {
 | 
			
		||||
            if (key !== "eloRating" && key !== "queryId" && request[key] !== session[key as keyof ISession]) {
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
@ -74,7 +74,7 @@ function getSession(sessionIdOrRequest: string | FindSessionRequest): any[] {
 | 
			
		||||
    }));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function getSessionByCreatorID(creatorId: string): Session | undefined {
 | 
			
		||||
function getSessionByCreatorID(creatorId: string): ISession | undefined {
 | 
			
		||||
    return sessions.find(session => session.creatorId === creatorId);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,12 @@
 | 
			
		||||
import { Model, Schema, Types, model } from "mongoose";
 | 
			
		||||
import { FlavourItem, RawUpgrade, MiscItem, IInventoryDatabase, Booster } from "../types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { Oid } from "../types/commonTypes";
 | 
			
		||||
import {
 | 
			
		||||
    IFlavourItem,
 | 
			
		||||
    IRawUpgrade,
 | 
			
		||||
    IMiscItem,
 | 
			
		||||
    IInventoryDatabase,
 | 
			
		||||
    IBooster
 | 
			
		||||
} from "../types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IOid } from "../types/commonTypes";
 | 
			
		||||
import { ISuitDatabase, ISuitDocument } from "@/src/types/inventoryTypes/SuitTypes";
 | 
			
		||||
import { IWeaponDatabase } from "@/src/types/inventoryTypes/weaponTypes";
 | 
			
		||||
 | 
			
		||||
@ -74,7 +80,7 @@ const BoosterSchema = new Schema({
 | 
			
		||||
WeaponSchema.set("toJSON", {
 | 
			
		||||
    transform(_document, returnedObject) {
 | 
			
		||||
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
 | 
			
		||||
        returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies Oid;
 | 
			
		||||
        returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies IOid;
 | 
			
		||||
        delete returnedObject._id;
 | 
			
		||||
        delete returnedObject.__v;
 | 
			
		||||
    }
 | 
			
		||||
@ -130,7 +136,7 @@ const suitSchema = new Schema<ISuitDatabase>({
 | 
			
		||||
suitSchema.set("toJSON", {
 | 
			
		||||
    transform(_document, returnedObject) {
 | 
			
		||||
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
 | 
			
		||||
        returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies Oid;
 | 
			
		||||
        returnedObject.ItemId = { $oid: returnedObject._id.toString() } satisfies IOid;
 | 
			
		||||
        delete returnedObject._id;
 | 
			
		||||
        delete returnedObject.__v;
 | 
			
		||||
    }
 | 
			
		||||
@ -338,10 +344,10 @@ type InventoryDocumentProps = {
 | 
			
		||||
    LongGuns: Types.DocumentArray<IWeaponDatabase>;
 | 
			
		||||
    Pistols: Types.DocumentArray<IWeaponDatabase>;
 | 
			
		||||
    Melee: Types.DocumentArray<IWeaponDatabase>;
 | 
			
		||||
    FlavourItems: Types.DocumentArray<FlavourItem>;
 | 
			
		||||
    RawUpgrades: Types.DocumentArray<RawUpgrade>;
 | 
			
		||||
    MiscItems: Types.DocumentArray<MiscItem>;
 | 
			
		||||
    Boosters: Types.DocumentArray<Booster>;
 | 
			
		||||
    FlavourItems: Types.DocumentArray<IFlavourItem>;
 | 
			
		||||
    RawUpgrades: Types.DocumentArray<IRawUpgrade>;
 | 
			
		||||
    MiscItems: Types.DocumentArray<IMiscItem>;
 | 
			
		||||
    Boosters: Types.DocumentArray<IBooster>;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
type InventoryModelType = Model<IInventoryDatabase, {}, InventoryDocumentProps>;
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,6 @@
 | 
			
		||||
import { Schema, model } from "mongoose";
 | 
			
		||||
import { IShip } from "../types/shipTypes";
 | 
			
		||||
import { Oid } from "../types/commonTypes";
 | 
			
		||||
import { IOid } from "../types/commonTypes";
 | 
			
		||||
 | 
			
		||||
const roomSchema = new Schema(
 | 
			
		||||
    {
 | 
			
		||||
@ -19,7 +19,7 @@ const shipSchema = new Schema({
 | 
			
		||||
shipSchema.set("toJSON", {
 | 
			
		||||
    transform(_document, returnedObject) {
 | 
			
		||||
        // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call
 | 
			
		||||
        returnedObject.ShipId = { $oid: returnedObject._id.toString() } satisfies Oid;
 | 
			
		||||
        returnedObject.ShipId = { $oid: returnedObject._id.toString() } satisfies IOid;
 | 
			
		||||
        delete returnedObject._id;
 | 
			
		||||
    }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
@ -5,13 +5,18 @@ import { Types } from "mongoose";
 | 
			
		||||
import { ISuitResponse } from "@/src/types/inventoryTypes/SuitTypes";
 | 
			
		||||
import { SlotType } from "@/src/types/purchaseTypes";
 | 
			
		||||
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
 | 
			
		||||
import { ChallengeProgress, FlavourItem, IInventoryDatabaseDocument } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import {
 | 
			
		||||
    MissionInventoryUpdate,
 | 
			
		||||
    MissionInventoryUpdateCard,
 | 
			
		||||
    MissionInventoryUpdateGear,
 | 
			
		||||
    MissionInventoryUpdateItem
 | 
			
		||||
    IChallengeProgress,
 | 
			
		||||
    IFlavourItem,
 | 
			
		||||
    IInventoryDatabaseDocument
 | 
			
		||||
} from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import {
 | 
			
		||||
    IMissionInventoryUpdate,
 | 
			
		||||
    IMissionInventoryUpdateCard,
 | 
			
		||||
    IMissionInventoryUpdateGear,
 | 
			
		||||
    IMissionInventoryUpdateItem
 | 
			
		||||
} from "../types/missionInventoryUpdateType";
 | 
			
		||||
import { IGenericUpdate } from "../types/genericUpdate";
 | 
			
		||||
 | 
			
		||||
const createInventory = async (accountOwnerId: Types.ObjectId) => {
 | 
			
		||||
    try {
 | 
			
		||||
@ -76,6 +81,27 @@ export const updateCurrency = async (price: number, usePremium: boolean, account
 | 
			
		||||
    return { [currencyName]: -price };
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
// TODO: AffiliationMods support (Nightwave).
 | 
			
		||||
export const updateGeneric = async (data: IGenericUpdate, accountId: string) => {
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
 | 
			
		||||
    // Make it an array for easier parsing.
 | 
			
		||||
    if (typeof data.NodeIntrosCompleted === "string") {
 | 
			
		||||
        data.NodeIntrosCompleted = [data.NodeIntrosCompleted];
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Combine the two arrays into one.
 | 
			
		||||
    data.NodeIntrosCompleted = inventory.NodeIntrosCompleted.concat(data.NodeIntrosCompleted);
 | 
			
		||||
 | 
			
		||||
    // Remove duplicate entries.
 | 
			
		||||
    const nodes = [...new Set(data.NodeIntrosCompleted)];
 | 
			
		||||
 | 
			
		||||
    inventory.NodeIntrosCompleted = nodes;
 | 
			
		||||
    await inventory.save();
 | 
			
		||||
 | 
			
		||||
    return data;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export type WeaponTypeInternal = "LongGuns" | "Pistols" | "Melee";
 | 
			
		||||
 | 
			
		||||
export const addWeapon = async (
 | 
			
		||||
@ -104,7 +130,7 @@ export const addWeapon = async (
 | 
			
		||||
    return changedInventory[weaponType][weaponIndex - 1].toJSON();
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const addCustomization = async (customizatonName: string, accountId: string): Promise<FlavourItem> => {
 | 
			
		||||
export const addCustomization = async (customizatonName: string, accountId: string): Promise<IFlavourItem> => {
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
 | 
			
		||||
    const flavourItemIndex = inventory.FlavourItems.push({ ItemType: customizatonName }) - 1;
 | 
			
		||||
@ -114,7 +140,7 @@ export const addCustomization = async (customizatonName: string, accountId: stri
 | 
			
		||||
 | 
			
		||||
const addGearExpByCategory = (
 | 
			
		||||
    inventory: IInventoryDatabaseDocument,
 | 
			
		||||
    gearArray: MissionInventoryUpdateGear[] | undefined,
 | 
			
		||||
    gearArray: IMissionInventoryUpdateGear[] | undefined,
 | 
			
		||||
    categoryName: "Pistols" | "LongGuns" | "Melee" | "Suits"
 | 
			
		||||
) => {
 | 
			
		||||
    const category = inventory[categoryName];
 | 
			
		||||
@ -132,7 +158,7 @@ const addGearExpByCategory = (
 | 
			
		||||
 | 
			
		||||
const addItemsByCategory = (
 | 
			
		||||
    inventory: IInventoryDatabaseDocument,
 | 
			
		||||
    itemsArray: (MissionInventoryUpdateItem | MissionInventoryUpdateCard)[] | undefined,
 | 
			
		||||
    itemsArray: (IMissionInventoryUpdateItem | IMissionInventoryUpdateCard)[] | undefined,
 | 
			
		||||
    categoryName: "RawUpgrades" | "MiscItems"
 | 
			
		||||
) => {
 | 
			
		||||
    const category = inventory[categoryName];
 | 
			
		||||
@ -149,7 +175,7 @@ const addItemsByCategory = (
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const addChallenges = (inventory: IInventoryDatabaseDocument, itemsArray: ChallengeProgress[] | undefined) => {
 | 
			
		||||
const addChallenges = (inventory: IInventoryDatabaseDocument, itemsArray: IChallengeProgress[] | undefined) => {
 | 
			
		||||
    const category = inventory.ChallengeProgress;
 | 
			
		||||
 | 
			
		||||
    itemsArray?.forEach(({ Name, Progress }) => {
 | 
			
		||||
@ -167,19 +193,16 @@ const addChallenges = (inventory: IInventoryDatabaseDocument, itemsArray: Challe
 | 
			
		||||
const gearKeys = ["Suits", "Pistols", "LongGuns", "Melee"] as const;
 | 
			
		||||
type GearKeysType = (typeof gearKeys)[number];
 | 
			
		||||
 | 
			
		||||
export const missionInventoryUpdate = async (data: MissionInventoryUpdate, accountId: string): Promise<void> => {
 | 
			
		||||
export const missionInventoryUpdate = async (data: IMissionInventoryUpdate, accountId: string): Promise<void> => {
 | 
			
		||||
    const { RawUpgrades, MiscItems, RegularCredits, ChallengeProgress } = data;
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
 | 
			
		||||
    // TODO - multipliers logic
 | 
			
		||||
    // credits
 | 
			
		||||
    inventory.RegularCredits += RegularCredits || 0;
 | 
			
		||||
 | 
			
		||||
    // gear exp
 | 
			
		||||
    // Gear XP
 | 
			
		||||
    gearKeys.forEach((key: GearKeysType) => addGearExpByCategory(inventory, data[key], key));
 | 
			
		||||
 | 
			
		||||
    // other
 | 
			
		||||
    addItemsByCategory(inventory, RawUpgrades, "RawUpgrades"); // TODO - check mods fusion level
 | 
			
		||||
    // Other
 | 
			
		||||
    // TODO: Ensure mods have a valid fusion level and items have a valid quantity, preferably inside of the functions themselves.
 | 
			
		||||
    addItemsByCategory(inventory, RawUpgrades, "RawUpgrades");
 | 
			
		||||
    addItemsByCategory(inventory, MiscItems, "MiscItems");
 | 
			
		||||
    addChallenges(inventory, ChallengeProgress);
 | 
			
		||||
 | 
			
		||||
@ -187,7 +210,7 @@ export const missionInventoryUpdate = async (data: MissionInventoryUpdate, accou
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const addBooster = async (ItemType: string, time: number, accountId: string): Promise<void> => {
 | 
			
		||||
    const currentTime = Math.floor(Date.now() / 1000) - 129600; // booster time getting more without 129600, probably defence logic, idk
 | 
			
		||||
    const currentTime = Math.floor(Date.now() / 1000) - 129600; // Value is wrong without 129600. Figure out why, please. :)
 | 
			
		||||
 | 
			
		||||
    const inventory = await getInventory(accountId);
 | 
			
		||||
    const { Boosters } = inventory;
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,3 @@
 | 
			
		||||
export interface Oid {
 | 
			
		||||
export interface IOid {
 | 
			
		||||
    $oid: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								src/types/genericUpdate.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								src/types/genericUpdate.ts
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,4 @@
 | 
			
		||||
export interface IGenericUpdate {
 | 
			
		||||
    NodeIntrosCompleted: string | string[];
 | 
			
		||||
    // AffiliationMods: any[];
 | 
			
		||||
}
 | 
			
		||||
@ -1,5 +1,5 @@
 | 
			
		||||
import { Oid } from "@/src/types/commonTypes";
 | 
			
		||||
import { AbilityOverride, Color, Polarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { IAbilityOverride, IColor, IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { Document, Types } from "mongoose";
 | 
			
		||||
 | 
			
		||||
// export interface ISuitDocument extends ISuitResponse, Document {}
 | 
			
		||||
@ -8,7 +8,7 @@ export interface ISuitDocument extends Document, ISuitResponse {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface ISuitResponse extends ISuitDatabase {
 | 
			
		||||
    ItemId: Oid;
 | 
			
		||||
    ItemId: IOid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface ISuitDatabase {
 | 
			
		||||
@ -18,7 +18,7 @@ export interface ISuitDatabase {
 | 
			
		||||
    XP?: number;
 | 
			
		||||
    InfestationDate?: Date;
 | 
			
		||||
    Features?: number;
 | 
			
		||||
    Polarity?: Polarity[];
 | 
			
		||||
    Polarity?: IPolarity[];
 | 
			
		||||
    Polarized?: number;
 | 
			
		||||
    ModSlotPurchases?: number;
 | 
			
		||||
    FocusLens?: string;
 | 
			
		||||
@ -28,14 +28,14 @@ export interface ISuitDatabase {
 | 
			
		||||
 | 
			
		||||
export interface SuitConfig {
 | 
			
		||||
    Skins?: string[];
 | 
			
		||||
    pricol?: Color;
 | 
			
		||||
    attcol?: Color;
 | 
			
		||||
    eyecol?: Color;
 | 
			
		||||
    sigcol?: Color;
 | 
			
		||||
    pricol?: IColor;
 | 
			
		||||
    attcol?: IColor;
 | 
			
		||||
    eyecol?: IColor;
 | 
			
		||||
    sigcol?: IColor;
 | 
			
		||||
    Upgrades?: string[];
 | 
			
		||||
    Songs?: Song[];
 | 
			
		||||
    Name?: string;
 | 
			
		||||
    AbilityOverride?: AbilityOverride;
 | 
			
		||||
    AbilityOverride?: IAbilityOverride;
 | 
			
		||||
    PvpUpgrades?: string[];
 | 
			
		||||
    ugly?: boolean;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
export interface Polarity {
 | 
			
		||||
export interface IPolarity {
 | 
			
		||||
    Slot: number;
 | 
			
		||||
    Value: FocusSchool;
 | 
			
		||||
}
 | 
			
		||||
@ -15,7 +15,7 @@ export enum FocusSchool {
 | 
			
		||||
    ApWard = "AP_WARD"
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface Color {
 | 
			
		||||
export interface IColor {
 | 
			
		||||
    t0?: number;
 | 
			
		||||
    t1?: number;
 | 
			
		||||
    t2?: number;
 | 
			
		||||
@ -26,16 +26,17 @@ export interface Color {
 | 
			
		||||
    m1?: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface AbilityOverride {
 | 
			
		||||
export interface IAbilityOverride {
 | 
			
		||||
    Ability: string;
 | 
			
		||||
    Index: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface SlotsBin {
 | 
			
		||||
export interface ISlotsBin {
 | 
			
		||||
    Slots: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface sigcol {
 | 
			
		||||
// ISigCol? IsIgCoL? ISIGCOL!
 | 
			
		||||
export interface Isigcol {
 | 
			
		||||
    t0: number;
 | 
			
		||||
    t1: number;
 | 
			
		||||
    en: number;
 | 
			
		||||
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
import { Oid } from "@/src/types/commonTypes";
 | 
			
		||||
import { Color, Polarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
import { IColor, IPolarity } from "@/src/types/inventoryTypes/commonInventoryTypes";
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
 | 
			
		||||
export interface IWeaponResponse extends IWeaponDatabase {
 | 
			
		||||
    ItemId: Oid;
 | 
			
		||||
    ItemId: IOid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IWeaponDatabase {
 | 
			
		||||
@ -13,7 +13,7 @@ export interface IWeaponDatabase {
 | 
			
		||||
    XP?: number;
 | 
			
		||||
    Features?: number;
 | 
			
		||||
    Polarized?: number;
 | 
			
		||||
    Polarity?: Polarity[];
 | 
			
		||||
    Polarity?: IPolarity[];
 | 
			
		||||
    FocusLens?: string;
 | 
			
		||||
    ModSlotPurchases?: number;
 | 
			
		||||
    UpgradeType?: string;
 | 
			
		||||
@ -26,15 +26,15 @@ export interface IWeaponDatabase {
 | 
			
		||||
 | 
			
		||||
export interface WeaponConfig {
 | 
			
		||||
    Skins?: string[];
 | 
			
		||||
    pricol?: Color;
 | 
			
		||||
    pricol?: IColor;
 | 
			
		||||
    Upgrades?: string[];
 | 
			
		||||
    attcol?: Color;
 | 
			
		||||
    eyecol?: OperatorLoadOutSigcol;
 | 
			
		||||
    attcol?: IColor;
 | 
			
		||||
    eyecol?: IOperatorLoadOutSigcol;
 | 
			
		||||
    Name?: string;
 | 
			
		||||
    PvpUpgrades?: string[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface OperatorLoadOutSigcol {
 | 
			
		||||
export interface IOperatorLoadOutSigcol {
 | 
			
		||||
    t0?: number;
 | 
			
		||||
    t1?: number;
 | 
			
		||||
    en?: number;
 | 
			
		||||
 | 
			
		||||
@ -10,7 +10,7 @@ export interface ILoginResponse extends Omit<IDatabaseAccountDocument, "email" |
 | 
			
		||||
    HUB: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
//includes virtual id
 | 
			
		||||
// Includes virtual ID
 | 
			
		||||
export interface IDatabaseAccountDocument extends IDatabaseAccount {
 | 
			
		||||
    id: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,17 +1,10 @@
 | 
			
		||||
interface MongooseId{
 | 
			
		||||
    $oid: string;
 | 
			
		||||
}
 | 
			
		||||
import { IOid } from "./commonTypes";
 | 
			
		||||
import { IDate } from "./inventoryTypes/inventoryTypes";
 | 
			
		||||
 | 
			
		||||
interface ExpireDate{
 | 
			
		||||
    $date: {
 | 
			
		||||
        $numberLong: string;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface MissionInventoryUpdateGear{
 | 
			
		||||
export interface IMissionInventoryUpdateGear {
 | 
			
		||||
    ItemType: string;
 | 
			
		||||
    ItemName: string;
 | 
			
		||||
    ItemId: MongooseId;
 | 
			
		||||
    ItemId: IOid;
 | 
			
		||||
    XP: number;
 | 
			
		||||
    UpgradeVer: number;
 | 
			
		||||
    Features: number;
 | 
			
		||||
@ -19,7 +12,7 @@ export interface MissionInventoryUpdateGear{
 | 
			
		||||
    CustomizationSlotPurchases: number;
 | 
			
		||||
    ModSlotPurchases: number;
 | 
			
		||||
    FocusLens: string;
 | 
			
		||||
    Expiry: ExpireDate;
 | 
			
		||||
    Expiry: IDate;
 | 
			
		||||
    Polarity: any[];
 | 
			
		||||
    Configs: any[];
 | 
			
		||||
    ModularParts: any[];
 | 
			
		||||
@ -28,37 +21,37 @@ export interface MissionInventoryUpdateGear{
 | 
			
		||||
    UpgradeFingerprint: string;
 | 
			
		||||
    OffensiveUpgrade: string;
 | 
			
		||||
    DefensiveUpgrade: string;
 | 
			
		||||
    UpgradesExpiry: ExpireDate;
 | 
			
		||||
    UpgradesExpiry: IDate;
 | 
			
		||||
    ArchonCrystalUpgrades: any[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface MissionInventoryUpdateItem{
 | 
			
		||||
export interface IMissionInventoryUpdateItem {
 | 
			
		||||
    ItemCount: number;
 | 
			
		||||
    ItemType: string;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface MissionInventoryUpdateCard extends MissionInventoryUpdateItem{
 | 
			
		||||
    ItemId: MongooseId;
 | 
			
		||||
export interface IMissionInventoryUpdateCard extends IMissionInventoryUpdateItem {
 | 
			
		||||
    ItemId: IOid;
 | 
			
		||||
    UpgradeFingerprint: string;
 | 
			
		||||
    PendingRerollFingerprint: string;
 | 
			
		||||
    LastAdded: MongooseId;
 | 
			
		||||
    LastAdded: IOid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
interface MissionInventoryUpdateChallange{
 | 
			
		||||
export interface IMissionInventoryUpdateChallange {
 | 
			
		||||
    Name: string;
 | 
			
		||||
    Progress: number;
 | 
			
		||||
    Completed: any[];
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface MissionInventoryUpdate{
 | 
			
		||||
export interface IMissionInventoryUpdate {
 | 
			
		||||
    rewardsMultiplier?: number;
 | 
			
		||||
    ActiveBoosters?: any[];
 | 
			
		||||
    LongGuns?: MissionInventoryUpdateGear[];
 | 
			
		||||
    Pistols?: MissionInventoryUpdateGear[];
 | 
			
		||||
    Suits?: MissionInventoryUpdateGear[];
 | 
			
		||||
    Melee?: MissionInventoryUpdateGear[];
 | 
			
		||||
    RawUpgrades?: MissionInventoryUpdateCard[];
 | 
			
		||||
    MiscItems?: MissionInventoryUpdateItem[];
 | 
			
		||||
    LongGuns?: IMissionInventoryUpdateGear[];
 | 
			
		||||
    Pistols?: IMissionInventoryUpdateGear[];
 | 
			
		||||
    Suits?: IMissionInventoryUpdateGear[];
 | 
			
		||||
    Melee?: IMissionInventoryUpdateGear[];
 | 
			
		||||
    RawUpgrades?: IMissionInventoryUpdateCard[];
 | 
			
		||||
    MiscItems?: IMissionInventoryUpdateItem[];
 | 
			
		||||
    RegularCredits?: number;
 | 
			
		||||
    ChallengeProgress?: MissionInventoryUpdateChallange[];
 | 
			
		||||
    ChallengeProgress?: IMissionInventoryUpdateChallange[];
 | 
			
		||||
}
 | 
			
		||||
@ -1,6 +1,5 @@
 | 
			
		||||
/* eslint-disable prettier/prettier */
 | 
			
		||||
import { ISuitDatabase } from "@/src/types/inventoryTypes/SuitTypes";
 | 
			
		||||
import { FlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IFlavourItem } from "@/src/types/inventoryTypes/inventoryTypes";
 | 
			
		||||
import { IWeaponResponse } from "@/src/types/inventoryTypes/weaponTypes";
 | 
			
		||||
 | 
			
		||||
export interface IPurchaseRequest {
 | 
			
		||||
@ -29,7 +28,7 @@ export interface IPurchaseResponse {
 | 
			
		||||
        Melee?: IWeaponResponse[];
 | 
			
		||||
        PremiumCredits?: number;
 | 
			
		||||
        RegularCredits?: number;
 | 
			
		||||
        FlavourItems?: FlavourItem[];
 | 
			
		||||
        FlavourItems?: IFlavourItem[];
 | 
			
		||||
    };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,4 +1,4 @@
 | 
			
		||||
export interface Session {
 | 
			
		||||
export interface ISession {
 | 
			
		||||
    sessionId: string;
 | 
			
		||||
    creatorId: string;
 | 
			
		||||
    maxPlayers: number;
 | 
			
		||||
@ -26,6 +26,6 @@ export interface Session {
 | 
			
		||||
    fullReset: number;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface FindSessionRequest {
 | 
			
		||||
export interface IFindSessionRequest {
 | 
			
		||||
    [key: string]: any;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -1,7 +1,5 @@
 | 
			
		||||
/* eslint-disable @typescript-eslint/no-explicit-any */
 | 
			
		||||
 | 
			
		||||
import { Types } from "mongoose";
 | 
			
		||||
import { Oid } from "@/src/types/commonTypes";
 | 
			
		||||
import { IOid } from "@/src/types/commonTypes";
 | 
			
		||||
 | 
			
		||||
export interface IShip {
 | 
			
		||||
    ShipOwnerId: Types.ObjectId;
 | 
			
		||||
@ -10,8 +8,9 @@ export interface IShip {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IShipClassResponse extends IShipClassDatabase {
 | 
			
		||||
    ShipId: Oid;
 | 
			
		||||
    ShipId: IOid;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export interface IShipClassDatabase {
 | 
			
		||||
    Rooms: IRoomsClass[];
 | 
			
		||||
    Features: string[];
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user