Compare commits
	
		
			1 Commits
		
	
	
		
			1fe473951a
			...
			77b12d2209
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 77b12d2209 | 
@ -1,4 +1,4 @@
 | 
				
			|||||||
import { fromDbOid, toMongoDate, version_compare } from "../../helpers/inventoryHelpers.ts";
 | 
					import { fromDbOid, version_compare } from "../../helpers/inventoryHelpers.ts";
 | 
				
			||||||
import type { IKnifeResponse } from "../../helpers/nemesisHelpers.ts";
 | 
					import type { IKnifeResponse } from "../../helpers/nemesisHelpers.ts";
 | 
				
			||||||
import {
 | 
					import {
 | 
				
			||||||
    antivirusMods,
 | 
					    antivirusMods,
 | 
				
			||||||
@ -310,15 +310,6 @@ export const nemesisController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        res.json({
 | 
					        res.json({
 | 
				
			||||||
            target: inventory.toJSON().Nemesis
 | 
					            target: inventory.toJSON().Nemesis
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    } else if ((req.query.mode as string) == "t") {
 | 
					 | 
				
			||||||
        const inventory = await getInventory(account._id.toString(), "LastNemesisAllySpawnTime");
 | 
					 | 
				
			||||||
        //const body = getJSONfromString<IUpdateAllySpawnTimeRequest>(String(req.body));
 | 
					 | 
				
			||||||
        const now = new Date(Math.trunc(Date.now() / 1000) * 1000);
 | 
					 | 
				
			||||||
        inventory.LastNemesisAllySpawnTime = now;
 | 
					 | 
				
			||||||
        await inventory.save();
 | 
					 | 
				
			||||||
        res.json({
 | 
					 | 
				
			||||||
            NewTime: toMongoDate(now)
 | 
					 | 
				
			||||||
        } satisfies IUpdateAllySpawnTimeResponse);
 | 
					 | 
				
			||||||
    } else if ((req.query.mode as string) == "d") {
 | 
					    } else if ((req.query.mode as string) == "d") {
 | 
				
			||||||
        const inventory = await getInventory(account._id.toString(), "NemesisHistory");
 | 
					        const inventory = await getInventory(account._id.toString(), "NemesisHistory");
 | 
				
			||||||
        const body = getJSONfromString<IRelinquishAdversariesRequest>(String(req.body));
 | 
					        const body = getJSONfromString<IRelinquishAdversariesRequest>(String(req.body));
 | 
				
			||||||
@ -471,11 +462,3 @@ const consumeModCharge = (
 | 
				
			|||||||
interface IRelinquishAdversariesRequest {
 | 
					interface IRelinquishAdversariesRequest {
 | 
				
			||||||
    nemesisFingerprints: (bigint | number)[];
 | 
					    nemesisFingerprints: (bigint | number)[];
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
// interface IUpdateAllySpawnTimeRequest {
 | 
					 | 
				
			||||||
//     LastSpawnTime: IMongoDate;
 | 
					 | 
				
			||||||
// }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
interface IUpdateAllySpawnTimeResponse {
 | 
					 | 
				
			||||||
    NewTime: IMongoDate;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
				
			|||||||
@ -1743,7 +1743,7 @@ const inventorySchema = new Schema<IInventoryDatabase, InventoryDocumentProps>(
 | 
				
			|||||||
        NemesisAbandonedRewards: { type: [String], default: [] },
 | 
					        NemesisAbandonedRewards: { type: [String], default: [] },
 | 
				
			||||||
        Nemesis: nemesisSchema,
 | 
					        Nemesis: nemesisSchema,
 | 
				
			||||||
        NemesisHistory: { type: [nemesisSchema], default: undefined },
 | 
					        NemesisHistory: { type: [nemesisSchema], default: undefined },
 | 
				
			||||||
        LastNemesisAllySpawnTime: { type: Date, default: undefined },
 | 
					        //LastNemesisAllySpawnTime: Schema.Types.Mixed,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //TradingRulesConfirmed,ShowFriendInvNotifications(Option->Social)
 | 
					        //TradingRulesConfirmed,ShowFriendInvNotifications(Option->Social)
 | 
				
			||||||
        Settings: settingsSchema,
 | 
					        Settings: settingsSchema,
 | 
				
			||||||
@ -1864,9 +1864,6 @@ inventorySchema.set("toJSON", {
 | 
				
			|||||||
        if (inventoryDatabase.BlessingCooldown) {
 | 
					        if (inventoryDatabase.BlessingCooldown) {
 | 
				
			||||||
            inventoryResponse.BlessingCooldown = toMongoDate(inventoryDatabase.BlessingCooldown);
 | 
					            inventoryResponse.BlessingCooldown = toMongoDate(inventoryDatabase.BlessingCooldown);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (inventoryDatabase.LastNemesisAllySpawnTime) {
 | 
					 | 
				
			||||||
            inventoryResponse.LastNemesisAllySpawnTime = toMongoDate(inventoryDatabase.LastNemesisAllySpawnTime);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        if (inventoryDatabase.NextRefill) {
 | 
					        if (inventoryDatabase.NextRefill) {
 | 
				
			||||||
            inventoryResponse.NextRefill = toMongoDate(inventoryDatabase.NextRefill);
 | 
					            inventoryResponse.NextRefill = toMongoDate(inventoryDatabase.NextRefill);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -73,7 +73,6 @@ import type {
 | 
				
			|||||||
    ITailorShop,
 | 
					    ITailorShop,
 | 
				
			||||||
    ITailorShopDatabase
 | 
					    ITailorShopDatabase
 | 
				
			||||||
} from "../types/personalRoomsTypes.ts";
 | 
					} from "../types/personalRoomsTypes.ts";
 | 
				
			||||||
import { fromMongoDate } from "../helpers/inventoryHelpers.ts";
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
const convertDate = (value: IMongoDate): Date => {
 | 
					const convertDate = (value: IMongoDate): Date => {
 | 
				
			||||||
    return new Date(parseInt(value.$date.$numberLong));
 | 
					    return new Date(parseInt(value.$date.$numberLong));
 | 
				
			||||||
@ -363,28 +362,12 @@ export const importInventory = (db: TInventoryDatabaseDocument, client: Partial<
 | 
				
			|||||||
        "NodeIntrosCompleted",
 | 
					        "NodeIntrosCompleted",
 | 
				
			||||||
        "DeathMarks",
 | 
					        "DeathMarks",
 | 
				
			||||||
        "Wishlist",
 | 
					        "Wishlist",
 | 
				
			||||||
        "NemesisAbandonedRewards",
 | 
					        "NemesisAbandonedRewards"
 | 
				
			||||||
        "EntratiLabConquestActiveFrameVariants",
 | 
					 | 
				
			||||||
        "EchoesHexConquestActiveFrameVariants",
 | 
					 | 
				
			||||||
        "EchoesHexConquestActiveStickers"
 | 
					 | 
				
			||||||
    ] as const) {
 | 
					    ] as const) {
 | 
				
			||||||
        if (client[key] !== undefined) {
 | 
					        if (client[key] !== undefined) {
 | 
				
			||||||
            db[key] = client[key];
 | 
					            db[key] = client[key];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    // IMongoDate
 | 
					 | 
				
			||||||
    for (const key of [
 | 
					 | 
				
			||||||
        "Created",
 | 
					 | 
				
			||||||
        "TrainingDate",
 | 
					 | 
				
			||||||
        "BlessingCooldown",
 | 
					 | 
				
			||||||
        "LastNemesisAllySpawnTime",
 | 
					 | 
				
			||||||
        "NextRefill",
 | 
					 | 
				
			||||||
        "EntratiVaultCountResetDate"
 | 
					 | 
				
			||||||
    ] as const) {
 | 
					 | 
				
			||||||
        if (client[key] !== undefined) {
 | 
					 | 
				
			||||||
            db[key] = fromMongoDate(client[key]);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
    // IRewardAtten[]
 | 
					    // IRewardAtten[]
 | 
				
			||||||
    for (const key of ["SortieRewardAttenuation", "SpecialItemRewardAttenuation"] as const) {
 | 
					    for (const key of ["SortieRewardAttenuation", "SpecialItemRewardAttenuation"] as const) {
 | 
				
			||||||
        if (client[key] !== undefined) {
 | 
					        if (client[key] !== undefined) {
 | 
				
			||||||
 | 
				
			|||||||
@ -92,7 +92,6 @@ export interface IInventoryDatabase
 | 
				
			|||||||
            | "NextRefill"
 | 
					            | "NextRefill"
 | 
				
			||||||
            | "Nemesis"
 | 
					            | "Nemesis"
 | 
				
			||||||
            | "NemesisHistory"
 | 
					            | "NemesisHistory"
 | 
				
			||||||
            | "LastNemesisAllySpawnTime"
 | 
					 | 
				
			||||||
            | "EntratiVaultCountResetDate"
 | 
					            | "EntratiVaultCountResetDate"
 | 
				
			||||||
            | "BrandedSuits"
 | 
					            | "BrandedSuits"
 | 
				
			||||||
            | "LockedWeaponGroup"
 | 
					            | "LockedWeaponGroup"
 | 
				
			||||||
@ -137,7 +136,6 @@ export interface IInventoryDatabase
 | 
				
			|||||||
    NextRefill?: Date;
 | 
					    NextRefill?: Date;
 | 
				
			||||||
    Nemesis?: INemesisDatabase;
 | 
					    Nemesis?: INemesisDatabase;
 | 
				
			||||||
    NemesisHistory?: INemesisBaseDatabase[];
 | 
					    NemesisHistory?: INemesisBaseDatabase[];
 | 
				
			||||||
    LastNemesisAllySpawnTime?: Date;
 | 
					 | 
				
			||||||
    EntratiVaultCountResetDate?: Date;
 | 
					    EntratiVaultCountResetDate?: Date;
 | 
				
			||||||
    BrandedSuits?: Types.ObjectId[];
 | 
					    BrandedSuits?: Types.ObjectId[];
 | 
				
			||||||
    LockedWeaponGroup?: ILockedWeaponGroupDatabase;
 | 
					    LockedWeaponGroup?: ILockedWeaponGroupDatabase;
 | 
				
			||||||
@ -374,7 +372,7 @@ export interface IInventoryClient extends IDailyAffiliations, InventoryClientEqu
 | 
				
			|||||||
    //InvasionChainProgress: IInvasionChainProgress[];
 | 
					    //InvasionChainProgress: IInvasionChainProgress[];
 | 
				
			||||||
    Nemesis?: INemesisClient;
 | 
					    Nemesis?: INemesisClient;
 | 
				
			||||||
    NemesisHistory?: INemesisBaseClient[];
 | 
					    NemesisHistory?: INemesisBaseClient[];
 | 
				
			||||||
    LastNemesisAllySpawnTime?: IMongoDate;
 | 
					    //LastNemesisAllySpawnTime?: IMongoDate;
 | 
				
			||||||
    Settings?: ISettings;
 | 
					    Settings?: ISettings;
 | 
				
			||||||
    PersonalTechProjects: IPersonalTechProjectClient[];
 | 
					    PersonalTechProjects: IPersonalTechProjectClient[];
 | 
				
			||||||
    PlayerSkills: IPlayerSkills;
 | 
					    PlayerSkills: IPlayerSkills;
 | 
				
			||||||
 | 
				
			|||||||
@ -2844,8 +2844,8 @@ function removeCountItems(uniqueName, count) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
function addItemByItemType() {
 | 
					function addItemByItemType() {
 | 
				
			||||||
    const ItemType = document.getElementById("typeName-type").value;
 | 
					    const ItemType = document.getElementById("typeName-type").value;
 | 
				
			||||||
    // Must start with "/Lotus/", contain only letters A–Z, digits 0–9, no "//", and not end with "/"
 | 
					    // Must start with "/Lotus/", contain only A–Z letters, no "//", and not end with "/"
 | 
				
			||||||
    if (!ItemType || !/^\/Lotus\/(?:[A-Za-z0-9]+(?:\/[A-Za-z0-9]+)*)$/.test(ItemType)) {
 | 
					    if (!ItemType || !/^\/Lotus\/(?:[A-Za-z]+(?:\/[A-Za-z]+)*)$/.test(ItemType)) {
 | 
				
			||||||
        $("#typeName-type").addClass("is-invalid").focus();
 | 
					        $("#typeName-type").addClass("is-invalid").focus();
 | 
				
			||||||
        return;
 | 
					        return;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user