refresh inventory for infinite cheats

This commit is contained in:
Sainan 2025-09-08 05:47:47 +02:00
parent 1649c295ff
commit 922e0fb124
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,6 @@
import { getInventory } from "../../services/inventoryService.ts";
import { getAccountIdForRequest } from "../../services/loginService.ts";
import { sendWsBroadcastTo } from "../../services/wsService.ts";
import type { IAccountCheats } from "../../types/inventoryTypes/inventoryTypes.ts";
import type { RequestHandler } from "express";
@ -10,6 +11,9 @@ export const setAccountCheatController: RequestHandler = async (req, res) => {
inventory[payload.key] = payload.value;
await inventory.save();
res.end();
if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(payload.key) != -1) {
sendWsBroadcastTo(accountId, { update_inventory: true, sync_inventory: true });
}
};
interface ISetAccountCheatRequest {

View File

@ -2200,10 +2200,6 @@ for (const id of uiConfigs) {
url: "/custom/setConfig?" + window.authz,
contentType: "application/json",
data: JSON.stringify({ [id]: this.checked })
}).then(() => {
if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(id) != -1) {
updateInventory();
}
});
};
}