XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFESpaceNinjaServer

A simple server for a small space ninja game

公开
关注 0 Fork 0 Star 0
返回提交历史

XFEstudio/XFESpaceNinjaServer

feat(webui): ensure forma count of at least 5 when max ranking item (#893)

Closes #889 Reviewed-on: http://209.141.38.3/OpenWF/SpaceNinjaServer/pulls/893

c1fcd304
Sainan <sainan@calamity.inc>
提交于

代码差异

1 个文件 +11 -0
Modified src/controllers/custom/addXpController.ts +11 -0
@@ -3,12 +3,23 @@ import { getAccountIdForRequest } from "@/src/services/loginService";
3 3 import { IEquipmentClient } from "@/src/types/inventoryTypes/commonInventoryTypes";
4 4 import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
5 5 import { RequestHandler } from "express";
6 import { ExportMisc } from "warframe-public-export-plus";
6 7
7 8 export const addXpController: RequestHandler = async (req, res) => {
8 9 const accountId = await getAccountIdForRequest(req);
9 10 const inventory = await getInventory(accountId);
10 11 const request = req.body as IAddXpRequest;
11 12 for (const [category, gear] of Object.entries(request)) {
13 for (const clientItem of gear) {
14 const dbItem = inventory[category as TEquipmentKey].id(clientItem.ItemId.$oid);
15 if (dbItem) {
16 if (dbItem.ItemType in ExportMisc.uniqueLevelCaps) {
17 if ((dbItem.Polarized ?? 0) < 5) {
18 dbItem.Polarized = 5;
19 }
20 }
21 }
22 }
12 23 addGearExpByCategory(inventory, gear, category as TEquipmentKey);
13 24 }
14 25 await inventory.save();