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

fix: purchasing of augment mods (#595)

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

代码差异

1 个文件 +18 -17
Modified src/services/inventoryService.ts +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);