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: display bug when activating riven via mods console (#1034)

Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1034

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

代码差异

1 个文件 +7 -1
Modified src/controllers/api/activateRandomModController.ts +7 -1
@@ -1,3 +1,4 @@
1 import { toOid } from "@/src/helpers/inventoryHelpers";
1 2 import { getJSONfromString } from "@/src/helpers/stringHelpers";
2 3 import { addMods, getInventory } from "@/src/services/inventoryService";
3 4 import { getAccountIdForRequest } from "@/src/services/loginService";
@@ -47,8 +48,13 @@ export const activateRandomModController: RequestHandler = async (req, res) => {
47 48 UpgradeFingerprint: JSON.stringify({ challenge: fingerprintChallenge })
48 49 }) - 1;
49 50 await inventory.save();
51 // For some reason, in this response, the UpgradeFingerprint is simply a nested object and not a string
50 52 res.json({
51 NewMod: inventory.Upgrades[upgradeIndex].toJSON()
53 NewMod: {
54 UpgradeFingerprint: { challenge: fingerprintChallenge },
55 ItemType: inventory.Upgrades[upgradeIndex].ItemType,
56 ItemId: toOid(inventory.Upgrades[upgradeIndex]._id)
57 }
52 58 });
53 59 };
54 60