chore: use projection for drones request when possible
All checks were successful
Build / build (20) (push) Successful in 52s
Build / build (22) (push) Successful in 1m7s
Build / build (18) (push) Successful in 1m15s
Build / build (18) (pull_request) Successful in 51s
Build / build (20) (pull_request) Successful in 1m5s
Build / build (22) (pull_request) Successful in 1m11s
All checks were successful
Build / build (20) (push) Successful in 52s
Build / build (22) (push) Successful in 1m7s
Build / build (18) (push) Successful in 1m15s
Build / build (18) (pull_request) Successful in 51s
Build / build (20) (pull_request) Successful in 1m5s
Build / build (22) (pull_request) Successful in 1m11s
This commit is contained in:
parent
8728cf3abf
commit
902db44737
@ -12,8 +12,8 @@ import { ExportDrones, ExportResources, ExportSystems } from "warframe-public-ex
|
|||||||
|
|
||||||
export const dronesController: RequestHandler = async (req, res) => {
|
export const dronesController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId);
|
|
||||||
if ("GetActive" in req.query) {
|
if ("GetActive" in req.query) {
|
||||||
|
const inventory = await getInventory(accountId, "Drones");
|
||||||
const activeDrones: IActiveDrone[] = [];
|
const activeDrones: IActiveDrone[] = [];
|
||||||
for (const drone of inventory.Drones) {
|
for (const drone of inventory.Drones) {
|
||||||
if (drone.DeployTime) {
|
if (drone.DeployTime) {
|
||||||
@ -39,6 +39,7 @@ export const dronesController: RequestHandler = async (req, res) => {
|
|||||||
ActiveDrones: activeDrones
|
ActiveDrones: activeDrones
|
||||||
});
|
});
|
||||||
} else if ("droneId" in req.query && "systemIndex" in req.query) {
|
} else if ("droneId" in req.query && "systemIndex" in req.query) {
|
||||||
|
const inventory = await getInventory(accountId, "Drones");
|
||||||
const drone = inventory.Drones.id(req.query.droneId as string)!;
|
const drone = inventory.Drones.id(req.query.droneId as string)!;
|
||||||
const droneMeta = ExportDrones[drone.ItemType];
|
const droneMeta = ExportDrones[drone.ItemType];
|
||||||
drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date();
|
drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date();
|
||||||
@ -76,6 +77,7 @@ export const dronesController: RequestHandler = async (req, res) => {
|
|||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.json({});
|
res.json({});
|
||||||
} else if ("collectDroneId" in req.query) {
|
} else if ("collectDroneId" in req.query) {
|
||||||
|
const inventory = await getInventory(accountId);
|
||||||
const drone = inventory.Drones.id(req.query.collectDroneId as string)!;
|
const drone = inventory.Drones.id(req.query.collectDroneId as string)!;
|
||||||
|
|
||||||
if (new Date() >= drone.DamageTime!) {
|
if (new Date() >= drone.DamageTime!) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user