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

SpaceNinjaServer

A simple server for a small space ninja game

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

XFEstudio/SpaceNinjaServer

chore(webui): refresh inventory when crafting/buying/gilding kitguns (#2486)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2486 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: Animan8000 <animan8000@noreply.localhost> Co-committed-by: Animan8000 <animan8000@noreply.localhost>

f6cb8414
Animan8000 <animan8000@noreply.localhost>
提交于

代码差异

3 个文件 +6 -0
Modified src/controllers/api/gildWeaponController.ts +2 -0
@@ -1,5 +1,6 @@
1 1 import { RequestHandler } from "express";
2 2 import { getAccountIdForRequest } from "@/src/services/loginService";
3 import { sendWsBroadcastTo } from "@/src/services/wsService";
3 4 import { getJSONfromString } from "@/src/helpers/stringHelpers";
4 5 import { addMiscItems, getInventory } from "@/src/services/inventoryService";
5 6 import { TEquipmentKey } from "@/src/types/inventoryTypes/inventoryTypes";
@@ -73,4 +74,5 @@ export const gildWeaponController: RequestHandler = async (req, res) => {
73 74 InventoryChanges: inventoryChanges,
74 75 AffiliationMods: affiliationMods
75 76 });
77 sendWsBroadcastTo(accountId, { update_inventory: true });
76 78 };
Modified src/controllers/api/modularWeaponCraftingController.ts +2 -0
@@ -1,5 +1,6 @@
1 1 import { RequestHandler } from "express";
2 2 import { getAccountIdForRequest } from "@/src/services/loginService";
3 import { sendWsBroadcastTo } from "@/src/services/wsService";
3 4 import { getJSONfromString } from "@/src/helpers/stringHelpers";
4 5 import {
5 6 getInventory,
@@ -194,4 +195,5 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
194 195 MiscItems: miscItemChanges
195 196 }
196 197 });
198 sendWsBroadcastTo(accountId, { update_inventory: true });
197 199 };
Modified src/controllers/api/modularWeaponSaleController.ts +2 -0
@@ -15,6 +15,7 @@ import {
15 15 } from "@/src/services/inventoryService";
16 16 import { getDefaultUpgrades } from "@/src/services/itemDataService";
17 17 import { getAccountIdForRequest } from "@/src/services/loginService";
18 import { sendWsBroadcastTo } from "@/src/services/wsService";
18 19 import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
19 20 import { IInventoryChanges } from "@/src/types/purchaseTypes";
20 21 import { EquipmentFeatures } from "@/src/types/equipmentTypes";
@@ -68,6 +69,7 @@ export const modularWeaponSaleController: RequestHandler = async (req, res) => {
68 69 res.json({
69 70 InventoryChanges: inventoryChanges
70 71 });
72 sendWsBroadcastTo(accountId, { update_inventory: true });
71 73 } else {
72 74 throw new Error(`unknown modularWeaponSale op: ${String(req.query.op)}`);
73 75 }