This commit is contained in:
parent
aeb2718ccd
commit
c1e76c1317
@ -4,9 +4,9 @@ import { broadcastInventoryUpdate } from "../../services/wsService.ts";
|
|||||||
import { getInventory } from "../../services/inventoryService.ts";
|
import { getInventory } from "../../services/inventoryService.ts";
|
||||||
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
import type { TEquipmentKey } from "../../types/inventoryTypes/inventoryTypes.ts";
|
||||||
|
|
||||||
export const unlockLevelCupController: RequestHandler = async (req, res) => {
|
export const unlockLevelCapController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const data = req.body as IUnlockLevelCupRequest;
|
const data = req.body as IunlockLevelCapRequest;
|
||||||
const inventory = await getInventory(accountId, data.Category);
|
const inventory = await getInventory(accountId, data.Category);
|
||||||
const equipment = inventory[data.Category].id(data.ItemId)!;
|
const equipment = inventory[data.Category].id(data.ItemId)!;
|
||||||
|
|
||||||
@ -18,7 +18,7 @@ export const unlockLevelCupController: RequestHandler = async (req, res) => {
|
|||||||
broadcastInventoryUpdate(req);
|
broadcastInventoryUpdate(req);
|
||||||
};
|
};
|
||||||
|
|
||||||
interface IUnlockLevelCupRequest {
|
interface IunlockLevelCapRequest {
|
||||||
Category: TEquipmentKey;
|
Category: TEquipmentKey;
|
||||||
ItemId: string;
|
ItemId: string;
|
||||||
Polarized: number;
|
Polarized: number;
|
||||||
@ -41,7 +41,7 @@ import { manageQuestsController } from "../controllers/custom/manageQuestsContro
|
|||||||
import { setEvolutionProgressController } from "../controllers/custom/setEvolutionProgressController.ts";
|
import { setEvolutionProgressController } from "../controllers/custom/setEvolutionProgressController.ts";
|
||||||
import { setBoosterController } from "../controllers/custom/setBoosterController.ts";
|
import { setBoosterController } from "../controllers/custom/setBoosterController.ts";
|
||||||
import { updateFingerprintController } from "../controllers/custom/updateFingerprintController.ts";
|
import { updateFingerprintController } from "../controllers/custom/updateFingerprintController.ts";
|
||||||
import { unlockLevelCupController } from "../controllers/custom/unlockLevelCupController.ts";
|
import { unlockLevelCapController } from "../controllers/custom/unlockLevelCapController.ts";
|
||||||
import { changeModularPartsController } from "../controllers/custom/changeModularPartsController.ts";
|
import { changeModularPartsController } from "../controllers/custom/changeModularPartsController.ts";
|
||||||
import { editSuitInvigorationUpgradeController } from "../controllers/custom/editSuitInvigorationUpgradeController.ts";
|
import { editSuitInvigorationUpgradeController } from "../controllers/custom/editSuitInvigorationUpgradeController.ts";
|
||||||
import { setAccountCheatController } from "../controllers/custom/setAccountCheatController.ts";
|
import { setAccountCheatController } from "../controllers/custom/setAccountCheatController.ts";
|
||||||
@ -90,7 +90,7 @@ customRouter.post("/manageQuests", manageQuestsController);
|
|||||||
customRouter.post("/setEvolutionProgress", setEvolutionProgressController);
|
customRouter.post("/setEvolutionProgress", setEvolutionProgressController);
|
||||||
customRouter.post("/setBooster", setBoosterController);
|
customRouter.post("/setBooster", setBoosterController);
|
||||||
customRouter.post("/updateFingerprint", updateFingerprintController);
|
customRouter.post("/updateFingerprint", updateFingerprintController);
|
||||||
customRouter.post("/unlockLevelCup", unlockLevelCupController);
|
customRouter.post("/unlockLevelCap", unlockLevelCapController);
|
||||||
customRouter.post("/changeModularParts", changeModularPartsController);
|
customRouter.post("/changeModularParts", changeModularPartsController);
|
||||||
customRouter.post("/editSuitInvigorationUpgrade", editSuitInvigorationUpgradeController);
|
customRouter.post("/editSuitInvigorationUpgrade", editSuitInvigorationUpgradeController);
|
||||||
customRouter.post("/setAccountCheat", setAccountCheatController);
|
customRouter.post("/setAccountCheat", setAccountCheatController);
|
||||||
|
|||||||
@ -822,7 +822,7 @@ function updateInventory() {
|
|||||||
a.href = "#";
|
a.href = "#";
|
||||||
a.onclick = function (event) {
|
a.onclick = function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
unlockLevelCup(
|
unlockLevelCap(
|
||||||
category,
|
category,
|
||||||
item.ItemId.$oid,
|
item.ItemId.$oid,
|
||||||
(itemMap[item.ItemType].maxLevelCap - 30) / 2
|
(itemMap[item.ItemType].maxLevelCap - 30) / 2
|
||||||
@ -2774,10 +2774,10 @@ function gildEquipment(category, oid) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function unlockLevelCup(category, oid, formas) {
|
function unlockLevelCap(category, oid, formas) {
|
||||||
revalidateAuthz().then(() => {
|
revalidateAuthz().then(() => {
|
||||||
$.post({
|
$.post({
|
||||||
url: "/custom/unlockLevelCup?" + window.authz,
|
url: "/custom/unlockLevelCap?" + window.authz,
|
||||||
contentType: "application/json",
|
contentType: "application/json",
|
||||||
data: JSON.stringify({
|
data: JSON.stringify({
|
||||||
Category: category,
|
Category: category,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user