返回提交历史
Modified
src/controllers/api/dronesController.ts
+3
-1
XFEstudio/XFESpaceNinjaServer
chore: use projection for drones request when possible (#1231)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1231
c98d872d
代码差异
1 个文件
+3
-1
@@ -12,8 +12,8 @@ import { ExportDrones, ExportResources, ExportSystems } from "warframe-public-ex
12
12
13
13
export const dronesController: RequestHandler = async (req, res) => {
14
14
const accountId = await getAccountIdForRequest(req);
15
const inventory = await getInventory(accountId);
16
15
if ("GetActive" in req.query) {
16
const inventory = await getInventory(accountId, "Drones");
17
17
const activeDrones: IActiveDrone[] = [];
18
18
for (const drone of inventory.Drones) {
19
19
if (drone.DeployTime) {
@@ -39,6 +39,7 @@ export const dronesController: RequestHandler = async (req, res) => {
39
39
ActiveDrones: activeDrones
40
40
});
41
41
} else if ("droneId" in req.query && "systemIndex" in req.query) {
42
const inventory = await getInventory(accountId, "Drones");
42
43
const drone = inventory.Drones.id(req.query.droneId as string)!;
43
44
const droneMeta = ExportDrones[drone.ItemType];
44
45
drone.DeployTime = config.instantResourceExtractorDrones ? new Date(0) : new Date();
@@ -76,6 +77,7 @@ export const dronesController: RequestHandler = async (req, res) => {
76
77
await inventory.save();
77
78
res.json({});
78
79
} else if ("collectDroneId" in req.query) {
80
const inventory = await getInventory(accountId);
79
81
const drone = inventory.Drones.id(req.query.collectDroneId as string)!;
80
82
81
83
if (new Date() >= drone.DamageTime!) {