forked from OpenWF/SpaceNinjaServer
		
	Compare commits
	
		
			12 Commits
		
	
	
		
			2fda5c7de5
			...
			65999b37a8
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 65999b37a8 | |||
| f5c1b83598 | |||
| 30f380f37e | |||
| 0f7a85db59 | |||
| 43bc12713a | |||
| 6022bf97b5 | |||
| 159e151dc0 | |||
| 56954260c8 | |||
| c535044af8 | |||
| f5146be129 | |||
| d38ec06ed6 | |||
| 060f65900f | 
@ -5,11 +5,23 @@ import { Guild, GuildMember } from "../../models/guildModel.ts";
 | 
				
			|||||||
import { createUniqueClanName, getGuildClient, giveClanKey } from "../../services/guildService.ts";
 | 
					import { createUniqueClanName, getGuildClient, giveClanKey } from "../../services/guildService.ts";
 | 
				
			||||||
import { getInventory } from "../../services/inventoryService.ts";
 | 
					import { getInventory } from "../../services/inventoryService.ts";
 | 
				
			||||||
import type { IInventoryChanges } from "../../types/purchaseTypes.ts";
 | 
					import type { IInventoryChanges } from "../../types/purchaseTypes.ts";
 | 
				
			||||||
 | 
					import { sendWsBroadcastTo } from "../../services/wsService.ts";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const createGuildController: RequestHandler = async (req, res) => {
 | 
					export const createGuildController: RequestHandler = async (req, res) => {
 | 
				
			||||||
    const account = await getAccountForRequest(req);
 | 
					    const account = await getAccountForRequest(req);
 | 
				
			||||||
    const payload = getJSONfromString<ICreateGuildRequest>(String(req.body));
 | 
					    const payload = getJSONfromString<ICreateGuildRequest>(String(req.body));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
 | 
				
			||||||
 | 
					    if (inventory.GuildId) {
 | 
				
			||||||
 | 
					        const guild = await Guild.findById(inventory.GuildId);
 | 
				
			||||||
 | 
					        if (guild) {
 | 
				
			||||||
 | 
					            res.json({
 | 
				
			||||||
 | 
					                ...(await getGuildClient(guild, account))
 | 
				
			||||||
 | 
					            });
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // Remove pending applications for this account
 | 
					    // Remove pending applications for this account
 | 
				
			||||||
    await GuildMember.deleteMany({ accountId: account._id, status: 1 });
 | 
					    await GuildMember.deleteMany({ accountId: account._id, status: 1 });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -27,7 +39,6 @@ export const createGuildController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        rank: 0
 | 
					        rank: 0
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const inventory = await getInventory(account._id.toString(), "GuildId LevelKeys Recipes");
 | 
					 | 
				
			||||||
    inventory.GuildId = guild._id;
 | 
					    inventory.GuildId = guild._id;
 | 
				
			||||||
    const inventoryChanges: IInventoryChanges = {};
 | 
					    const inventoryChanges: IInventoryChanges = {};
 | 
				
			||||||
    giveClanKey(inventory, inventoryChanges);
 | 
					    giveClanKey(inventory, inventoryChanges);
 | 
				
			||||||
@ -37,6 +48,7 @@ export const createGuildController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        ...(await getGuildClient(guild, account)),
 | 
					        ...(await getGuildClient(guild, account)),
 | 
				
			||||||
        InventoryChanges: inventoryChanges
 | 
					        InventoryChanges: inventoryChanges
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					    sendWsBroadcastTo(account._id.toString(), { update_inventory: true });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface ICreateGuildRequest {
 | 
					interface ICreateGuildRequest {
 | 
				
			||||||
 | 
				
			|||||||
@ -461,6 +461,9 @@ export const getInventoryResponse = async (
 | 
				
			|||||||
                        toLegacyOid(id);
 | 
					                        toLegacyOid(id);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
 | 
					                if (inventoryResponse.GuildId) {
 | 
				
			||||||
 | 
					                    toLegacyOid(inventoryResponse.GuildId);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
				
			|||||||
@ -129,14 +129,22 @@ export const missionInventoryUpdateController: RequestHandler = async (req, res)
 | 
				
			|||||||
        res.json(deltas);
 | 
					        res.json(deltas);
 | 
				
			||||||
    } else if (missionReport.RewardInfo) {
 | 
					    } else if (missionReport.RewardInfo) {
 | 
				
			||||||
        logger.debug(`classic mission completion, sending everything`);
 | 
					        logger.debug(`classic mission completion, sending everything`);
 | 
				
			||||||
        const inventoryResponse = await getInventoryResponse(inventory, true, account.BuildLabel);
 | 
					        const inventoryResponse = await getInventoryResponse(
 | 
				
			||||||
 | 
					            inventory,
 | 
				
			||||||
 | 
					            "xpBasedLevelCapDisabled" in req.query,
 | 
				
			||||||
 | 
					            account.BuildLabel
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
        res.json({
 | 
					        res.json({
 | 
				
			||||||
            InventoryJson: JSON.stringify(inventoryResponse),
 | 
					            InventoryJson: JSON.stringify(inventoryResponse),
 | 
				
			||||||
            ...deltas
 | 
					            ...deltas
 | 
				
			||||||
        } satisfies IMissionInventoryUpdateResponse);
 | 
					        } satisfies IMissionInventoryUpdateResponse);
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
        logger.debug(`no reward info, assuming this wasn't a mission completion and we should just sync inventory`);
 | 
					        logger.debug(`no reward info, assuming this wasn't a mission completion and we should just sync inventory`);
 | 
				
			||||||
        const inventoryResponse = await getInventoryResponse(inventory, true, account.BuildLabel);
 | 
					        const inventoryResponse = await getInventoryResponse(
 | 
				
			||||||
 | 
					            inventory,
 | 
				
			||||||
 | 
					            "xpBasedLevelCapDisabled" in req.query,
 | 
				
			||||||
 | 
					            account.BuildLabel
 | 
				
			||||||
 | 
					        );
 | 
				
			||||||
        res.json({
 | 
					        res.json({
 | 
				
			||||||
            InventoryJson: JSON.stringify(inventoryResponse)
 | 
					            InventoryJson: JSON.stringify(inventoryResponse)
 | 
				
			||||||
        } satisfies IMissionInventoryUpdateResponseBackToDryDock);
 | 
					        } satisfies IMissionInventoryUpdateResponseBackToDryDock);
 | 
				
			||||||
 | 
				
			|||||||
@ -310,6 +310,17 @@ export const nemesisController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        res.json({
 | 
					        res.json({
 | 
				
			||||||
            target: inventory.toJSON().Nemesis
 | 
					            target: inventory.toJSON().Nemesis
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
 | 
					    } else if ((req.query.mode as string) == "d") {
 | 
				
			||||||
 | 
					        const inventory = await getInventory(account._id.toString(), "NemesisHistory");
 | 
				
			||||||
 | 
					        const body = getJSONfromString<IRelinquishAdversariesRequest>(String(req.body));
 | 
				
			||||||
 | 
					        for (const fp of body.nemesisFingerprints) {
 | 
				
			||||||
 | 
					            const index = inventory.NemesisHistory!.findIndex(x => x.fp == fp);
 | 
				
			||||||
 | 
					            if (index != -1) {
 | 
				
			||||||
 | 
					                inventory.NemesisHistory!.splice(index, 1);
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        await inventory.save();
 | 
				
			||||||
 | 
					        res.json(body);
 | 
				
			||||||
    } else if ((req.query.mode as string) == "w") {
 | 
					    } else if ((req.query.mode as string) == "w") {
 | 
				
			||||||
        const inventory = await getInventory(account._id.toString(), "Nemesis");
 | 
					        const inventory = await getInventory(account._id.toString(), "Nemesis");
 | 
				
			||||||
        //const body = getJSONfromString<INemesisWeakenRequest>(String(req.body));
 | 
					        //const body = getJSONfromString<INemesisWeakenRequest>(String(req.body));
 | 
				
			||||||
@ -447,3 +458,7 @@ const consumeModCharge = (
 | 
				
			|||||||
        response.UpgradeNew.push(true);
 | 
					        response.UpgradeNew.push(true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					interface IRelinquishAdversariesRequest {
 | 
				
			||||||
 | 
					    nemesisFingerprints: (bigint | number)[];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -10,6 +10,7 @@ import {
 | 
				
			|||||||
import { createMessage } from "../../services/inboxService.ts";
 | 
					import { createMessage } from "../../services/inboxService.ts";
 | 
				
			||||||
import { getInventory } from "../../services/inventoryService.ts";
 | 
					import { getInventory } from "../../services/inventoryService.ts";
 | 
				
			||||||
import { getAccountForRequest, getSuffixedName } from "../../services/loginService.ts";
 | 
					import { getAccountForRequest, getSuffixedName } from "../../services/loginService.ts";
 | 
				
			||||||
 | 
					import { sendWsBroadcastTo } from "../../services/wsService.ts";
 | 
				
			||||||
import { GuildPermission } from "../../types/guildTypes.ts";
 | 
					import { GuildPermission } from "../../types/guildTypes.ts";
 | 
				
			||||||
import type { RequestHandler } from "express";
 | 
					import type { RequestHandler } from "express";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -85,6 +86,7 @@ export const removeFromGuildController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
        ItemToRemove: "/Lotus/Types/Keys/DojoKey",
 | 
					        ItemToRemove: "/Lotus/Types/Keys/DojoKey",
 | 
				
			||||||
        RecipeToRemove: "/Lotus/Types/Keys/DojoKeyBlueprint"
 | 
					        RecipeToRemove: "/Lotus/Types/Keys/DojoKeyBlueprint"
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 | 
					    sendWsBroadcastTo(payload.userId, { update_inventory: true });
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface IRemoveFromGuildRequest {
 | 
					interface IRemoveFromGuildRequest {
 | 
				
			||||||
 | 
				
			|||||||
@ -13,6 +13,7 @@ import { Types } from "mongoose";
 | 
				
			|||||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
 | 
					import { ExportDojoRecipes } from "warframe-public-export-plus";
 | 
				
			||||||
import { getAccountForRequest } from "../../services/loginService.ts";
 | 
					import { getAccountForRequest } from "../../services/loginService.ts";
 | 
				
			||||||
import { getInventory } from "../../services/inventoryService.ts";
 | 
					import { getInventory } from "../../services/inventoryService.ts";
 | 
				
			||||||
 | 
					import { fromOid } from "../../helpers/inventoryHelpers.ts";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
interface IStartDojoRecipeRequest {
 | 
					interface IStartDojoRecipeRequest {
 | 
				
			||||||
    PlacedComponent: IDojoComponentClient;
 | 
					    PlacedComponent: IDojoComponentClient;
 | 
				
			||||||
@ -50,7 +51,7 @@ export const startDojoRecipeController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
                _id: componentId,
 | 
					                _id: componentId,
 | 
				
			||||||
                pf: request.PlacedComponent.pf,
 | 
					                pf: request.PlacedComponent.pf,
 | 
				
			||||||
                ppf: request.PlacedComponent.ppf,
 | 
					                ppf: request.PlacedComponent.ppf,
 | 
				
			||||||
                pi: new Types.ObjectId(request.PlacedComponent.pi!.$oid),
 | 
					                pi: new Types.ObjectId(fromOid(request.PlacedComponent.pi!)),
 | 
				
			||||||
                op: request.PlacedComponent.op,
 | 
					                op: request.PlacedComponent.op,
 | 
				
			||||||
                pp: request.PlacedComponent.pp,
 | 
					                pp: request.PlacedComponent.pp,
 | 
				
			||||||
                DecoCapacity: room?.decoCapacity
 | 
					                DecoCapacity: room?.decoCapacity
 | 
				
			||||||
 | 
				
			|||||||
@ -1,6 +1,6 @@
 | 
				
			|||||||
import { getInventory } from "../../services/inventoryService.ts";
 | 
					import { getInventory } from "../../services/inventoryService.ts";
 | 
				
			||||||
import { getAccountIdForRequest } from "../../services/loginService.ts";
 | 
					import { getAccountIdForRequest } from "../../services/loginService.ts";
 | 
				
			||||||
import { sendWsBroadcastTo } from "../../services/wsService.ts";
 | 
					import { sendWsBroadcastEx, sendWsBroadcastTo } from "../../services/wsService.ts";
 | 
				
			||||||
import type { IAccountCheats } from "../../types/inventoryTypes/inventoryTypes.ts";
 | 
					import type { IAccountCheats } from "../../types/inventoryTypes/inventoryTypes.ts";
 | 
				
			||||||
import type { RequestHandler } from "express";
 | 
					import type { RequestHandler } from "express";
 | 
				
			||||||
import { logger } from "../../utils/logger.ts";
 | 
					import { logger } from "../../utils/logger.ts";
 | 
				
			||||||
@ -20,6 +20,8 @@ export const setAccountCheatController: RequestHandler = async (req, res) => {
 | 
				
			|||||||
    res.end();
 | 
					    res.end();
 | 
				
			||||||
    if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(payload.key) != -1) {
 | 
					    if (["infiniteCredits", "infinitePlatinum", "infiniteEndo", "infiniteRegalAya"].indexOf(payload.key) != -1) {
 | 
				
			||||||
        sendWsBroadcastTo(accountId, { update_inventory: true, sync_inventory: true });
 | 
					        sendWsBroadcastTo(accountId, { update_inventory: true, sync_inventory: true });
 | 
				
			||||||
 | 
					    } else {
 | 
				
			||||||
 | 
					        sendWsBroadcastEx({ update_inventory: true }, accountId, parseInt(String(req.query.wsid)));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -22,7 +22,7 @@ import type {
 | 
				
			|||||||
    ITechProjectDatabase
 | 
					    ITechProjectDatabase
 | 
				
			||||||
} from "../types/guildTypes.ts";
 | 
					} from "../types/guildTypes.ts";
 | 
				
			||||||
import { GuildPermission } from "../types/guildTypes.ts";
 | 
					import { GuildPermission } from "../types/guildTypes.ts";
 | 
				
			||||||
import { toMongoDate, toOid, toOid2 } from "../helpers/inventoryHelpers.ts";
 | 
					import { toMongoDate, toOid, toOid2, version_compare } from "../helpers/inventoryHelpers.ts";
 | 
				
			||||||
import type { Types } from "mongoose";
 | 
					import type { Types } from "mongoose";
 | 
				
			||||||
import type { IDojoBuild, IDojoResearch } from "warframe-public-export-plus";
 | 
					import type { IDojoBuild, IDojoResearch } from "warframe-public-export-plus";
 | 
				
			||||||
import { ExportDojoRecipes, ExportResources } from "warframe-public-export-plus";
 | 
					import { ExportDojoRecipes, ExportResources } from "warframe-public-export-plus";
 | 
				
			||||||
@ -68,9 +68,15 @@ export const getGuildClient = async (
 | 
				
			|||||||
    let missingEntry = true;
 | 
					    let missingEntry = true;
 | 
				
			||||||
    const dataFillInPromises: Promise<void>[] = [];
 | 
					    const dataFillInPromises: Promise<void>[] = [];
 | 
				
			||||||
    for (const guildMember of guildMembers) {
 | 
					    for (const guildMember of guildMembers) {
 | 
				
			||||||
 | 
					        // Use 1-based indexing for clan ranks for versions before U24. In my testing, 2018.06.14.23.21 and below used 1-based indexing and 2019.04.04.21.31 and above used 0-based indexing. I didn't narrow it down further, but I think U24 is a good spot for them to have changed it.
 | 
				
			||||||
 | 
					        let rankBase = 0;
 | 
				
			||||||
 | 
					        if (account.BuildLabel && version_compare(account.BuildLabel, "2018.11.08.14.45") < 0) {
 | 
				
			||||||
 | 
					            rankBase += 1;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const member: IGuildMemberClient = {
 | 
					        const member: IGuildMemberClient = {
 | 
				
			||||||
            _id: toOid2(guildMember.accountId, account.BuildLabel),
 | 
					            _id: toOid2(guildMember.accountId, account.BuildLabel),
 | 
				
			||||||
            Rank: guildMember.rank,
 | 
					            Rank: guildMember.rank + rankBase,
 | 
				
			||||||
            Status: guildMember.status,
 | 
					            Status: guildMember.status,
 | 
				
			||||||
            Note: guildMember.RequestMsg,
 | 
					            Note: guildMember.RequestMsg,
 | 
				
			||||||
            RequestExpiry: guildMember.RequestExpiry ? toMongoDate(guildMember.RequestExpiry) : undefined
 | 
					            RequestExpiry: guildMember.RequestExpiry ? toMongoDate(guildMember.RequestExpiry) : undefined
 | 
				
			||||||
 | 
				
			|||||||
@ -309,9 +309,6 @@ export const addMissionInventoryUpdates = async (
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            case "Missions":
 | 
					 | 
				
			||||||
                addMissionComplete(inventory, value);
 | 
					 | 
				
			||||||
                break;
 | 
					 | 
				
			||||||
            case "LastRegionPlayed":
 | 
					            case "LastRegionPlayed":
 | 
				
			||||||
                if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) {
 | 
					                if (!(config.unfaithfulBugFixes?.ignore1999LastRegionPlayed && value === "1999MapName")) {
 | 
				
			||||||
                    inventory.LastRegionPlayed = value;
 | 
					                    inventory.LastRegionPlayed = value;
 | 
				
			||||||
@ -1229,6 +1226,9 @@ export const addMissionRewards = async (
 | 
				
			|||||||
    if (missions && missions.Tag in ExportRegions) {
 | 
					    if (missions && missions.Tag in ExportRegions) {
 | 
				
			||||||
        const node = ExportRegions[missions.Tag];
 | 
					        const node = ExportRegions[missions.Tag];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // cannot add this with normal updates because { Tier: 1 } would mark the SP node as completed even on a failure
 | 
				
			||||||
 | 
					        addMissionComplete(inventory, missions);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //node based credit rewards for mission completion
 | 
					        //node based credit rewards for mission completion
 | 
				
			||||||
        if (isEligibleForCreditReward(rewardInfo, missions, node)) {
 | 
					        if (isEligibleForCreditReward(rewardInfo, missions, node)) {
 | 
				
			||||||
            const levelCreditReward = getLevelCreditRewards(node);
 | 
					            const levelCreditReward = getLevelCreditRewards(node);
 | 
				
			||||||
 | 
				
			|||||||
@ -1202,7 +1202,7 @@ function updateInventory() {
 | 
				
			|||||||
                        a.href = "#";
 | 
					                        a.href = "#";
 | 
				
			||||||
                        a.onclick = function (event) {
 | 
					                        a.onclick = function (event) {
 | 
				
			||||||
                            event.preventDefault();
 | 
					                            event.preventDefault();
 | 
				
			||||||
                            doQuestUpdate("setInactive", item.ItemType);
 | 
					                            debounce(doQuestUpdate, "setInactive", item.ItemType);
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                        a.title = loc("code_setInactive");
 | 
					                        a.title = loc("code_setInactive");
 | 
				
			||||||
                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm192-96l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"/></svg>`;
 | 
					                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm192-96l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"/></svg>`;
 | 
				
			||||||
@ -1213,7 +1213,7 @@ function updateInventory() {
 | 
				
			|||||||
                        a.href = "#";
 | 
					                        a.href = "#";
 | 
				
			||||||
                        a.onclick = function (event) {
 | 
					                        a.onclick = function (event) {
 | 
				
			||||||
                            event.preventDefault();
 | 
					                            event.preventDefault();
 | 
				
			||||||
                            doQuestUpdate("resetKey", item.ItemType);
 | 
					                            debounce(doQuestUpdate, "resetKey", item.ItemType);
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                        a.title = loc("code_reset");
 | 
					                        a.title = loc("code_reset");
 | 
				
			||||||
                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"/></svg>`;
 | 
					                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"/></svg>`;
 | 
				
			||||||
@ -1224,7 +1224,7 @@ function updateInventory() {
 | 
				
			|||||||
                        a.href = "#";
 | 
					                        a.href = "#";
 | 
				
			||||||
                        a.onclick = function (event) {
 | 
					                        a.onclick = function (event) {
 | 
				
			||||||
                            event.preventDefault();
 | 
					                            event.preventDefault();
 | 
				
			||||||
                            doQuestUpdate("completeKey", item.ItemType);
 | 
					                            debounce(doQuestUpdate, "completeKey", item.ItemType);
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                        a.title = loc("code_complete");
 | 
					                        a.title = loc("code_complete");
 | 
				
			||||||
                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>`;
 | 
					                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>`;
 | 
				
			||||||
@ -1235,7 +1235,7 @@ function updateInventory() {
 | 
				
			|||||||
                        a.href = "#";
 | 
					                        a.href = "#";
 | 
				
			||||||
                        a.onclick = function (event) {
 | 
					                        a.onclick = function (event) {
 | 
				
			||||||
                            event.preventDefault();
 | 
					                            event.preventDefault();
 | 
				
			||||||
                            doQuestUpdate("prevStage", item.ItemType);
 | 
					                            debounce(doQuestUpdate, "prevStage", item.ItemType);
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                        a.title = loc("code_prevStage");
 | 
					                        a.title = loc("code_prevStage");
 | 
				
			||||||
                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg>`;
 | 
					                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M41.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 256 246.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"/></svg>`;
 | 
				
			||||||
@ -1250,7 +1250,7 @@ function updateInventory() {
 | 
				
			|||||||
                        a.href = "#";
 | 
					                        a.href = "#";
 | 
				
			||||||
                        a.onclick = function (event) {
 | 
					                        a.onclick = function (event) {
 | 
				
			||||||
                            event.preventDefault();
 | 
					                            event.preventDefault();
 | 
				
			||||||
                            doQuestUpdate("nextStage", item.ItemType);
 | 
					                            debounce(doQuestUpdate, "nextStage", item.ItemType);
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                        a.title = loc("code_nextStage");
 | 
					                        a.title = loc("code_nextStage");
 | 
				
			||||||
                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg>`;
 | 
					                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z"/></svg>`;
 | 
				
			||||||
@ -1262,7 +1262,7 @@ function updateInventory() {
 | 
				
			|||||||
                        a.onclick = function (event) {
 | 
					                        a.onclick = function (event) {
 | 
				
			||||||
                            event.preventDefault();
 | 
					                            event.preventDefault();
 | 
				
			||||||
                            reAddToItemList(itemMap, "QuestKeys", item.ItemType);
 | 
					                            reAddToItemList(itemMap, "QuestKeys", item.ItemType);
 | 
				
			||||||
                            doQuestUpdate("deleteKey", item.ItemType);
 | 
					                            debounce(doQuestUpdate, "deleteKey", item.ItemType);
 | 
				
			||||||
                        };
 | 
					                        };
 | 
				
			||||||
                        a.title = loc("code_remove");
 | 
					                        a.title = loc("code_remove");
 | 
				
			||||||
                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>`;
 | 
					                        a.innerHTML = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M135.2 17.7L128 32H32C14.3 32 0 46.3 0 64S14.3 96 32 96H416c17.7 0 32-14.3 32-32s-14.3-32-32-32H320l-7.2-14.3C307.4 6.8 296.3 0 284.2 0H163.8c-12.1 0-23.2 6.8-28.6 17.7zM416 128H32L53.2 467c1.6 25.3 22.6 45 47.9 45H346.9c25.3 0 46.3-19.7 47.9-45L416 128z"/></svg>`;
 | 
				
			||||||
@ -3195,13 +3195,16 @@ function doIntrinsicsUnlockAll() {
 | 
				
			|||||||
document.querySelectorAll("#account-cheats input[type=checkbox]").forEach(elm => {
 | 
					document.querySelectorAll("#account-cheats input[type=checkbox]").forEach(elm => {
 | 
				
			||||||
    elm.onchange = function () {
 | 
					    elm.onchange = function () {
 | 
				
			||||||
        revalidateAuthz().then(() => {
 | 
					        revalidateAuthz().then(() => {
 | 
				
			||||||
 | 
					            const value = elm.checked;
 | 
				
			||||||
            $.post({
 | 
					            $.post({
 | 
				
			||||||
                url: "/custom/setAccountCheat?" + window.authz,
 | 
					                url: "/custom/setAccountCheat?" + window.authz,
 | 
				
			||||||
                contentType: "application/json",
 | 
					                contentType: "application/json",
 | 
				
			||||||
                data: JSON.stringify({
 | 
					                data: JSON.stringify({
 | 
				
			||||||
                    key: elm.id,
 | 
					                    key: elm.id,
 | 
				
			||||||
                    value: elm.checked
 | 
					                    value: value
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
 | 
					            }).done(() => {
 | 
				
			||||||
 | 
					                elm.checked = value;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@ -3237,6 +3240,8 @@ document.querySelectorAll("#account-cheats .input-group").forEach(grp => {
 | 
				
			|||||||
                    key: input.id,
 | 
					                    key: input.id,
 | 
				
			||||||
                    value: parseInt(value)
 | 
					                    value: parseInt(value)
 | 
				
			||||||
                })
 | 
					                })
 | 
				
			||||||
 | 
					            }).done(() => {
 | 
				
			||||||
 | 
					                btn.value = value;
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user