返回提交历史
Modified
src/controllers/api/nemesisController.ts
+15
-0
XFEstudio/XFESpaceNinjaServer
feat: nemesis mode d (#2860)
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2860 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
6022bf97
代码差异
1 个文件
+15
-0
@@ -310,6 +310,17 @@ export const nemesisController: RequestHandler = async (req, res) => {
310
310
res.json({
311
311
target: inventory.toJSON().Nemesis
312
312
});
313
} else if ((req.query.mode as string) == "d") {
314
const inventory = await getInventory(account._id.toString(), "NemesisHistory");
315
const body = getJSONfromString<IRelinquishAdversariesRequest>(String(req.body));
316
for (const fp of body.nemesisFingerprints) {
317
const index = inventory.NemesisHistory!.findIndex(x => x.fp == fp);
318
if (index != -1) {
319
inventory.NemesisHistory!.splice(index, 1);
320
}
321
}
322
await inventory.save();
323
res.json(body);
313
324
} else if ((req.query.mode as string) == "w") {
314
325
const inventory = await getInventory(account._id.toString(), "Nemesis");
315
326
//const body = getJSONfromString<INemesisWeakenRequest>(String(req.body));
@@ -447,3 +458,7 @@ const consumeModCharge = (
447
458
response.UpgradeNew.push(true);
448
459
}
449
460
};
461
462
interface IRelinquishAdversariesRequest {
463
nemesisFingerprints: (bigint | number)[];
464
}