make sure all webui options trigger respective inventory syncs
This commit is contained in:
parent
7b99502cf8
commit
ed48e251f0
@ -3,6 +3,7 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import type { IInventoryClient, IUpgradeClient } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { IInventoryClient, IUpgradeClient } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
import { addMods, getInventory } from "../../services/inventoryService.ts";
|
import { addMods, getInventory } from "../../services/inventoryService.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const artifactsController: RequestHandler = async (req, res) => {
|
export const artifactsController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -57,6 +58,7 @@ export const artifactsController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.send(itemId);
|
res.send(itemId);
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IArtifactsRequest {
|
interface IArtifactsRequest {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
||||||
import { addMiscItems, getInventory } from "../../services/inventoryService.ts";
|
import { addMiscItems, getInventory } from "../../services/inventoryService.ts";
|
||||||
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
@ -75,5 +75,5 @@ export const gildWeaponController: RequestHandler = async (req, res) => {
|
|||||||
InventoryChanges: inventoryChanges,
|
InventoryChanges: inventoryChanges,
|
||||||
AffiliationMods: affiliationMods
|
AffiliationMods: affiliationMods
|
||||||
});
|
});
|
||||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import {
|
|||||||
applyCheatsToInfestedFoundry,
|
applyCheatsToInfestedFoundry,
|
||||||
handleSubsumeCompletion
|
handleSubsumeCompletion
|
||||||
} from "../../services/infestedFoundryService.ts";
|
} from "../../services/infestedFoundryService.ts";
|
||||||
|
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const infestedFoundryController: RequestHandler = async (req, res) => {
|
export const infestedFoundryController: RequestHandler = async (req, res) => {
|
||||||
const account = await getAccountForRequest(req);
|
const account = await getAccountForRequest(req);
|
||||||
@ -363,6 +364,7 @@ export const infestedFoundryController: RequestHandler = async (req, res) => {
|
|||||||
);
|
);
|
||||||
addRecipes(inventory, recipeChanges);
|
addRecipes(inventory, recipeChanges);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
sendWsBroadcastTo(account._id.toString(), { sync_inventory: true });
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const maturePetController: RequestHandler = async (req, res) => {
|
export const maturePetController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -19,6 +20,7 @@ export const maturePetController: RequestHandler = async (req, res) => {
|
|||||||
: [details.DominantTraits.FurPattern, details.DominantTraits.FurPattern, details.DominantTraits.FurPattern],
|
: [details.DominantTraits.FurPattern, details.DominantTraits.FurPattern, details.DominantTraits.FurPattern],
|
||||||
unmature: data.revert
|
unmature: data.revert
|
||||||
});
|
});
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IMaturePetRequest {
|
interface IMaturePetRequest {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
||||||
import {
|
import {
|
||||||
getInventory,
|
getInventory,
|
||||||
@ -197,5 +197,5 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
|
|||||||
MiscItems: miscItemChanges
|
MiscItems: miscItemChanges
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
|
|||||||
import { getInventory, updateCurrency } from "../../services/inventoryService.ts";
|
import { getInventory, updateCurrency } from "../../services/inventoryService.ts";
|
||||||
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
||||||
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
interface INameWeaponRequest {
|
interface INameWeaponRequest {
|
||||||
ItemName: string;
|
ItemName: string;
|
||||||
@ -28,5 +28,5 @@ export const nameWeaponController: RequestHandler = async (req, res) => {
|
|||||||
res.json({
|
res.json({
|
||||||
InventoryChanges: currencyChanges
|
InventoryChanges: currencyChanges
|
||||||
});
|
});
|
||||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
||||||
import { getInventory, updateCurrency } from "../../services/inventoryService.ts";
|
import { getInventory, updateCurrency } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
|
||||||
export const releasePetController: RequestHandler = async (req, res) => {
|
export const releasePetController: RequestHandler = async (req, res) => {
|
||||||
@ -20,7 +20,7 @@ export const releasePetController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({ inventoryChanges }); // Not a mistake; it's "inventoryChanges" here.
|
res.json({ inventoryChanges }); // Not a mistake; it's "inventoryChanges" here.
|
||||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IReleasePetRequest {
|
interface IReleasePetRequest {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
import { getJSONfromString } from "../../helpers/stringHelpers.ts";
|
||||||
import { getInventory, updateCurrency } from "../../services/inventoryService.ts";
|
import { getInventory, updateCurrency } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import type { IInventoryChanges } from "../../types/purchaseTypes.ts";
|
import type { IInventoryChanges } from "../../types/purchaseTypes.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ export const renamePetController: RequestHandler = async (req, res) => {
|
|||||||
...data,
|
...data,
|
||||||
inventoryChanges: inventoryChanges
|
inventoryChanges: inventoryChanges
|
||||||
});
|
});
|
||||||
sendWsBroadcastTo(accountId, { update_inventory: true });
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IRenamePetRequest {
|
interface IRenamePetRequest {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { Inventory } from "../../models/inventoryModels/inventoryModel.ts";
|
import { Inventory } from "../../models/inventoryModels/inventoryModel.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
|
export const setSupportedSyndicateController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -15,4 +16,5 @@ export const setSupportedSyndicateController: RequestHandler = async (req, res)
|
|||||||
);
|
);
|
||||||
|
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
|
||||||
@ -19,6 +20,7 @@ export const abilityOverrideController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IAbilityOverrideRequest {
|
interface IAbilityOverrideRequest {
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
|
|||||||
import { addFusionPoints, getInventory } from "../../services/inventoryService.ts";
|
import { addFusionPoints, getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getGuildForRequestEx, hasGuildPermission } from "../../services/guildService.ts";
|
import { getGuildForRequestEx, hasGuildPermission } from "../../services/guildService.ts";
|
||||||
import { GuildPermission } from "../../types/guildTypes.ts";
|
import { GuildPermission } from "../../types/guildTypes.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const addCurrencyController: RequestHandler = async (req, res) => {
|
export const addCurrencyController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -24,6 +25,7 @@ export const addCurrencyController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
if (!request.currency.startsWith("Vault")) {
|
if (!request.currency.startsWith("Vault")) {
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { getInventory, addItem } from "../../services/inventoryService.ts";
|
import { getInventory, addItem } from "../../services/inventoryService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const addItemsController: RequestHandler = async (req, res) => {
|
export const addItemsController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -10,9 +10,9 @@ export const addItemsController: RequestHandler = async (req, res) => {
|
|||||||
for (const request of requests) {
|
for (const request of requests) {
|
||||||
await addItem(inventory, request.ItemType, request.ItemCount, true, undefined, request.Fingerprint, true);
|
await addItem(inventory, request.ItemType, request.ItemCount, true, undefined, request.Fingerprint, true);
|
||||||
}
|
}
|
||||||
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IAddItemRequest {
|
interface IAddItemRequest {
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
|
|||||||
import { getInventory, addRecipes } from "../../services/inventoryService.ts";
|
import { getInventory, addRecipes } from "../../services/inventoryService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { ExportRecipes } from "warframe-public-export-plus";
|
import { ExportRecipes } from "warframe-public-export-plus";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const addMissingHelminthBlueprintsController: RequestHandler = async (req, res) => {
|
export const addMissingHelminthBlueprintsController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -21,4 +22,5 @@ export const addMissingHelminthBlueprintsController: RequestHandler = async (req
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { getInventory } from "../../services/inventoryService.ts";
|
|||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { ExportArcanes, ExportUpgrades } from "warframe-public-export-plus";
|
import { ExportArcanes, ExportUpgrades } from "warframe-public-export-plus";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const addMissingMaxRankModsController: RequestHandler = async (req, res) => {
|
export const addMissingMaxRankModsController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -41,4 +42,5 @@ export const addMissingMaxRankModsController: RequestHandler = async (req, res)
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { applyClientEquipmentUpdates, getInventory } from "../../services/inventoryService.ts";
|
import { applyClientEquipmentUpdates, getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import type { IOid } from "../../types/commonTypes.ts";
|
import type { IOid } from "../../types/commonTypes.ts";
|
||||||
import type { IEquipmentClient } from "../../types/equipmentTypes.ts";
|
import type { IEquipmentClient } from "../../types/equipmentTypes.ts";
|
||||||
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
@ -24,9 +24,9 @@ export const addXpController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
applyClientEquipmentUpdates(inventory, gear, category as TEquipmentKey);
|
applyClientEquipmentUpdates(inventory, gear, category as TEquipmentKey);
|
||||||
}
|
}
|
||||||
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
type IAddXpRequest = {
|
type IAddXpRequest = {
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
|
||||||
@ -20,6 +21,7 @@ export const changeModularPartsController: RequestHandler = async (req, res) =>
|
|||||||
await inventory.save();
|
await inventory.save();
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IUpdateFingerPrintRequest {
|
interface IUpdateFingerPrintRequest {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
const DEFAULT_UPGRADE_EXPIRY_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
|
const DEFAULT_UPGRADE_EXPIRY_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
|
||||||
|
|
||||||
@ -31,4 +32,5 @@ export const editSuitInvigorationUpgradeController: RequestHandler = async (req,
|
|||||||
}
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import { getInventory } from "../../services/inventoryService.ts";
|
|||||||
import { getLoadout } from "../../services/loadoutService.ts";
|
import { getLoadout } from "../../services/loadoutService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { getPersonalRooms } from "../../services/personalRoomsService.ts";
|
import { getPersonalRooms } from "../../services/personalRoomsService.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
import type { IInventoryClient } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { IInventoryClient } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
import type { IGetShipResponse } from "../../types/personalRoomsTypes.ts";
|
import type { IGetShipResponse } from "../../types/personalRoomsTypes.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
@ -32,6 +33,7 @@ export const importController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IImportRequest {
|
interface IImportRequest {
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import {
|
|||||||
import { logger } from "../../utils/logger.ts";
|
import { logger } from "../../utils/logger.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { ExportKeys } from "warframe-public-export-plus";
|
import { ExportKeys } from "warframe-public-export-plus";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const manageQuestsController: RequestHandler = async (req, res) => {
|
export const manageQuestsController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -157,4 +158,5 @@ export const manageQuestsController: RequestHandler = async (req, res) => {
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.status(200).end();
|
res.status(200).end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const popArchonCrystalUpgradeController: RequestHandler = async (req, res) => {
|
export const popArchonCrystalUpgradeController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -12,6 +13,7 @@ export const popArchonCrystalUpgradeController: RequestHandler = async (req, res
|
|||||||
);
|
);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
res.status(400).end();
|
res.status(400).end();
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const pushArchonCrystalUpgradeController: RequestHandler = async (req, res) => {
|
export const pushArchonCrystalUpgradeController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -15,6 +16,7 @@ export const pushArchonCrystalUpgradeController: RequestHandler = async (req, re
|
|||||||
}
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { getAccountIdForRequest } from "../../services/loginService.ts";
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { ExportBoosters } from "warframe-public-export-plus";
|
import { ExportBoosters } from "warframe-public-export-plus";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
const I32_MAX = 0x7fffffff;
|
const I32_MAX = 0x7fffffff;
|
||||||
|
|
||||||
@ -42,4 +43,5 @@ export const setBoosterController: RequestHandler = async (req, res) => {
|
|||||||
}
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const setEvolutionProgressController: RequestHandler = async (req, res) => {
|
export const setEvolutionProgressController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -25,6 +26,7 @@ export const setEvolutionProgressController: RequestHandler = async (req, res) =
|
|||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
type ISetEvolutionProgressRequest = {
|
type ISetEvolutionProgressRequest = {
|
||||||
|
|||||||
@ -2,19 +2,25 @@ import type { RequestHandler } from "express";
|
|||||||
import { ExportResources, ExportVirtuals } from "warframe-public-export-plus";
|
import { ExportResources, ExportVirtuals } from "warframe-public-export-plus";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { addItem, getInventory } from "../../services/inventoryService.ts";
|
import { addItem, getInventory } from "../../services/inventoryService.ts";
|
||||||
|
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const unlockAllCapturaScenesController: RequestHandler = async (req, res) => {
|
export const unlockAllCapturaScenesController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId);
|
const inventory = await getInventory(accountId);
|
||||||
|
|
||||||
|
let needSync = false;
|
||||||
for (const uniqueName of Object.keys(ExportResources)) {
|
for (const uniqueName of Object.keys(ExportResources)) {
|
||||||
if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) {
|
if (resourceInheritsFrom(uniqueName, "/Lotus/Types/Items/MiscItems/PhotoboothTile")) {
|
||||||
await addItem(inventory, uniqueName, 1);
|
await addItem(inventory, uniqueName, 1);
|
||||||
|
needSync = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
if (needSync) {
|
||||||
|
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => {
|
const resourceInheritsFrom = (resourceName: string, targetName: string): boolean => {
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const unlockAllIntrinsicsController: RequestHandler = async (req, res) => {
|
export const unlockAllIntrinsicsController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -16,4 +17,5 @@ export const unlockAllIntrinsicsController: RequestHandler = async (req, res) =>
|
|||||||
inventory.PlayerSkills.LPS_DRIFT_ENDURANCE = 10;
|
inventory.PlayerSkills.LPS_DRIFT_ENDURANCE = 10;
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||||
|
|
||||||
const allEudicoHeistJobs = [
|
const allEudicoHeistJobs = [
|
||||||
"/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyOne",
|
"/Lotus/Types/Gameplay/Venus/Jobs/Heists/HeistProfitTakerBountyOne",
|
||||||
@ -21,4 +22,5 @@ export const unlockAllProfitTakerStagesController: RequestHandler = async (req,
|
|||||||
}
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
|
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const unlockAllSimarisResearchEntriesController: RequestHandler = async (req, res) => {
|
export const unlockAllSimarisResearchEntriesController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -17,4 +18,5 @@ export const unlockAllSimarisResearchEntriesController: RequestHandler = async (
|
|||||||
].map(type => ({ TargetType: type, Scans: 10, Completed: true }));
|
].map(type => ({ TargetType: type, Scans: 10, Completed: true }));
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
|
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
||||||
};
|
};
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { getInventory } from "../../services/inventoryService.ts";
|
|||||||
import type { WeaponTypeInternal } from "../../services/itemDataService.ts";
|
import type { WeaponTypeInternal } from "../../services/itemDataService.ts";
|
||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
import { getAccountIdForRequest } from "../../services/loginService.ts";
|
||||||
import type { RequestHandler } from "express";
|
import type { RequestHandler } from "express";
|
||||||
|
import { sendWsBroadcastTo } from "../../services/wsService.ts";
|
||||||
|
|
||||||
export const updateFingerprintController: RequestHandler = async (req, res) => {
|
export const updateFingerprintController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
@ -22,6 +23,7 @@ export const updateFingerprintController: RequestHandler = async (req, res) => {
|
|||||||
await inventory.save();
|
await inventory.save();
|
||||||
}
|
}
|
||||||
res.end();
|
res.end();
|
||||||
|
sendWsBroadcastTo(accountId, { sync_inventory: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IUpdateFingerPrintRequest {
|
interface IUpdateFingerPrintRequest {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user