返回提交历史
Modified
src/services/inventoryService.ts
+18
-17
XFEstudio/XFESpaceNinjaServer
fix: purchasing of augment mods (#595)
c6ed013e
代码差异
1 个文件
+18
-17
@@ -36,7 +36,8 @@ import {
36
36
ExportCustoms,
37
37
ExportFlavour,
38
38
ExportRecipes,
39
ExportResources
39
ExportResources,
40
ExportUpgrades
40
41
} from "warframe-public-export-plus";
41
42
42
43
export const createInventory = async (
@@ -169,6 +170,22 @@ export const addItem = async (
169
170
}
170
171
return { InventoryChanges };
171
172
}
173
if (typeName in ExportUpgrades) {
174
const inventory = await getInventory(accountId);
175
const changes = [
176
{
177
ItemType: typeName,
178
ItemCount: quantity
179
}
180
];
181
addMods(inventory, changes);
182
await inventory.save();
183
return {
184
InventoryChanges: {
185
RawUpgrades: changes
186
}
187
};
188
}
172
189
173
190
// Path-based duck typing
174
191
switch (typeName.substr(1).split("/")[1]) {
@@ -228,22 +245,6 @@ export const addItem = async (
228
245
[weaponType]: [weapon]
229
246
}
230
247
};
231
case "Upgrades": {
232
const inventory = await getInventory(accountId);
233
const changes = [
234
{
235
ItemType: typeName,
236
ItemCount: quantity
237
}
238
];
239
addMods(inventory, changes);
240
await inventory.save();
241
return {
242
InventoryChanges: {
243
RawUpgrades: changes
244
}
245
};
246
}
247
248
case "Objects": {
248
249
// /Lotus/Objects/Tenno/Props/TnoLisetTextProjector (Note Beacon)
249
250
const inventory = await getInventory(accountId);