Compare commits
5 Commits
c394b4da31
...
57a12bd3cc
| Author | SHA1 | Date | |
|---|---|---|---|
| 57a12bd3cc | |||
| 9c55a8a4aa | |||
| 253ae09f24 | |||
| 703e9007b0 | |||
| 3e555b1753 |
@ -31,7 +31,8 @@
|
|||||||
"no-mixed-spaces-and-tabs": "error",
|
"no-mixed-spaces-and-tabs": "error",
|
||||||
"@typescript-eslint/require-await": "error",
|
"@typescript-eslint/require-await": "error",
|
||||||
"import/no-named-as-default-member": "off",
|
"import/no-named-as-default-member": "off",
|
||||||
"import/no-cycle": "warn"
|
"import/no-cycle": "warn",
|
||||||
|
"@typescript-eslint/no-deprecated": "warn"
|
||||||
},
|
},
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
|
|||||||
@ -231,7 +231,7 @@ interface ILensInstallRequest {
|
|||||||
|
|
||||||
// Works for ways & upgrades
|
// Works for ways & upgrades
|
||||||
const focusTypeToPolarity = (type: string): TFocusPolarity => {
|
const focusTypeToPolarity = (type: string): TFocusPolarity => {
|
||||||
return ("AP_" + type.substr(1).split("/")[3].toUpperCase()) as TFocusPolarity;
|
return ("AP_" + type.substring(1).split("/")[3].toUpperCase()) as TFocusPolarity;
|
||||||
};
|
};
|
||||||
|
|
||||||
const shardValues = {
|
const shardValues = {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { equipmentKeys } from "../../types/inventoryTypes/inventoryTypes.ts";
|
|||||||
import type { IPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts";
|
import type { IPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts";
|
||||||
import { ArtifactPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts";
|
import { ArtifactPolarity } from "../../types/inventoryTypes/commonInventoryTypes.ts";
|
||||||
import type { ICountedItem } from "warframe-public-export-plus";
|
import type { ICountedItem } from "warframe-public-export-plus";
|
||||||
import { eFaction, ExportCustoms, ExportFlavour, ExportResources } from "warframe-public-export-plus";
|
import { ExportCustoms, ExportFlavour, ExportResources } from "warframe-public-export-plus";
|
||||||
import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "../../services/infestedFoundryService.ts";
|
import { applyCheatsToInfestedFoundry, handleSubsumeCompletion } from "../../services/infestedFoundryService.ts";
|
||||||
import {
|
import {
|
||||||
addEmailItem,
|
addEmailItem,
|
||||||
@ -220,7 +220,10 @@ export const inventoryController: RequestHandler = async (request, response) =>
|
|||||||
}
|
}
|
||||||
await createMessage(account._id, [
|
await createMessage(account._id, [
|
||||||
{
|
{
|
||||||
sndr: eFaction.find(x => x.tag == factionSidedWith)?.name ?? factionSidedWith, // TOVERIFY
|
sndr:
|
||||||
|
factionSidedWith == "FC_GRINEER"
|
||||||
|
? "/Lotus/Language/Menu/GrineerInvasionLeader"
|
||||||
|
: "/Lotus/Language/Menu/CorpusInvasionLeader",
|
||||||
msg: `/Lotus/Language/G1Quests/${factionSidedWith}_InvasionThankyouMessageBody`,
|
msg: `/Lotus/Language/G1Quests/${factionSidedWith}_InvasionThankyouMessageBody`,
|
||||||
sub: `/Lotus/Language/G1Quests/${factionSidedWith}_InvasionThankyouMessageSubject`,
|
sub: `/Lotus/Language/G1Quests/${factionSidedWith}_InvasionThankyouMessageSubject`,
|
||||||
countedAtt: battlePay,
|
countedAtt: battlePay,
|
||||||
|
|||||||
@ -221,7 +221,7 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
name &&
|
name &&
|
||||||
uniqueName.substr(0, 30) != "/Lotus/Types/Game/Projections/" &&
|
uniqueName.substring(0, 30) != "/Lotus/Types/Game/Projections/" &&
|
||||||
uniqueName != "/Lotus/Types/Gameplay/EntratiLab/Resources/EntratiLanthornBundle"
|
uniqueName != "/Lotus/Types/Gameplay/EntratiLab/Resources/EntratiLanthornBundle"
|
||||||
) {
|
) {
|
||||||
res.miscitems.push({
|
res.miscitems.push({
|
||||||
@ -318,7 +318,7 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
uniqueName,
|
uniqueName,
|
||||||
name: getString(arcane.name, lang)
|
name: getString(arcane.name, lang)
|
||||||
};
|
};
|
||||||
if (arcane.isFrivolous) {
|
if (arcane.excludeFromCodex) {
|
||||||
mod.badReason = "frivolous";
|
mod.badReason = "frivolous";
|
||||||
}
|
}
|
||||||
res.mods.push(mod);
|
res.mods.push(mod);
|
||||||
|
|||||||
@ -1,23 +0,0 @@
|
|||||||
import type { SlotPurchase, SlotPurchaseName } from "../types/purchaseTypes.ts";
|
|
||||||
|
|
||||||
export const slotPurchaseNameToSlotName: SlotPurchase = {
|
|
||||||
SuitSlotItem: { name: "SuitBin", purchaseQuantity: 1 },
|
|
||||||
TwoSentinelSlotItem: { name: "SentinelBin", purchaseQuantity: 2 },
|
|
||||||
TwoWeaponSlotItem: { name: "WeaponBin", purchaseQuantity: 2 },
|
|
||||||
SpaceSuitSlotItem: { name: "SpaceSuitBin", purchaseQuantity: 1 },
|
|
||||||
TwoSpaceWeaponSlotItem: { name: "SpaceWeaponBin", purchaseQuantity: 2 },
|
|
||||||
MechSlotItem: { name: "MechBin", purchaseQuantity: 1 },
|
|
||||||
TwoOperatorWeaponSlotItem: { name: "OperatorAmpBin", purchaseQuantity: 2 },
|
|
||||||
RandomModSlotItem: { name: "RandomModBin", purchaseQuantity: 3 },
|
|
||||||
TwoCrewShipSalvageSlotItem: { name: "CrewShipSalvageBin", purchaseQuantity: 2 },
|
|
||||||
CrewMemberSlotItem: { name: "CrewMemberBin", purchaseQuantity: 1 }
|
|
||||||
};
|
|
||||||
|
|
||||||
export const isSlotPurchaseName = (slotPurchaseName: string): slotPurchaseName is SlotPurchaseName => {
|
|
||||||
return slotPurchaseName in slotPurchaseNameToSlotName;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const parseSlotPurchaseName = (slotPurchaseName: string): SlotPurchaseName => {
|
|
||||||
if (!isSlotPurchaseName(slotPurchaseName)) throw new Error(`invalid slot name ${slotPurchaseName}`);
|
|
||||||
return slotPurchaseName;
|
|
||||||
};
|
|
||||||
@ -14,8 +14,8 @@ cacheRouter.get(/^\/origin\/[a-zA-Z0-9]+\/[0-9]+\/H\.Cache\.bin.*$/, (req, res)
|
|||||||
|
|
||||||
cacheRouter.get(/^\/0\/.+!.+$/, async (req, res) => {
|
cacheRouter.get(/^\/0\/.+!.+$/, async (req, res) => {
|
||||||
try {
|
try {
|
||||||
const dir = req.path.substr(0, req.path.lastIndexOf("/"));
|
const dir = req.path.substring(0, req.path.lastIndexOf("/"));
|
||||||
const file = req.path.substr(dir.length + 1);
|
const file = req.path.substring(dir.length + 1);
|
||||||
const filePath = `static/data${dir}/${file}`;
|
const filePath = `static/data${dir}/${file}`;
|
||||||
|
|
||||||
// Return file if we have it
|
// Return file if we have it
|
||||||
|
|||||||
@ -687,10 +687,10 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Path-based duck typing
|
// Path-based duck typing
|
||||||
switch (typeName.substr(1).split("/")[1]) {
|
switch (typeName.substring(1).split("/")[1]) {
|
||||||
case "Powersuits":
|
case "Powersuits":
|
||||||
if (typeName.endsWith("AugmentCard")) break;
|
if (typeName.endsWith("AugmentCard")) break;
|
||||||
switch (typeName.substr(1).split("/")[2]) {
|
switch (typeName.substring(1).split("/")[2]) {
|
||||||
default: {
|
default: {
|
||||||
return {
|
return {
|
||||||
...(await addPowerSuit(inventory, typeName, {
|
...(await addPowerSuit(inventory, typeName, {
|
||||||
@ -725,7 +725,7 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Upgrades": {
|
case "Upgrades": {
|
||||||
switch (typeName.substr(1).split("/")[2]) {
|
switch (typeName.substring(1).split("/")[2]) {
|
||||||
case "Mods": // Legendary Core
|
case "Mods": // Legendary Core
|
||||||
case "CosmeticEnhancers": // Traumatic Peculiar
|
case "CosmeticEnhancers": // Traumatic Peculiar
|
||||||
{
|
{
|
||||||
@ -782,12 +782,12 @@ export const addItem = async (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Types":
|
case "Types":
|
||||||
switch (typeName.substr(1).split("/")[2]) {
|
switch (typeName.substring(1).split("/")[2]) {
|
||||||
case "Sentinels": {
|
case "Sentinels": {
|
||||||
return addSentinel(inventory, typeName, premiumPurchase);
|
return addSentinel(inventory, typeName, premiumPurchase);
|
||||||
}
|
}
|
||||||
case "Game": {
|
case "Game": {
|
||||||
if (typeName.substr(1).split("/")[3] == "Projections") {
|
if (typeName.substring(1).split("/")[3] == "Projections") {
|
||||||
// Void Relics, e.g. /Lotus/Types/Game/Projections/T2VoidProjectionGaussPrimeDBronze
|
// Void Relics, e.g. /Lotus/Types/Game/Projections/T2VoidProjectionGaussPrimeDBronze
|
||||||
const miscItemChanges = [
|
const miscItemChanges = [
|
||||||
{
|
{
|
||||||
@ -801,8 +801,8 @@ export const addItem = async (
|
|||||||
MiscItems: miscItemChanges
|
MiscItems: miscItemChanges
|
||||||
};
|
};
|
||||||
} else if (
|
} else if (
|
||||||
typeName.substr(1).split("/")[3] == "CatbrowPet" ||
|
typeName.substring(1).split("/")[3] == "CatbrowPet" ||
|
||||||
typeName.substr(1).split("/")[3] == "KubrowPet"
|
typeName.substring(1).split("/")[3] == "KubrowPet"
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
typeName != "/Lotus/Types/Game/KubrowPet/Eggs/KubrowPetEggItem" &&
|
typeName != "/Lotus/Types/Game/KubrowPet/Eggs/KubrowPetEggItem" &&
|
||||||
@ -826,7 +826,7 @@ export const addItem = async (
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "Items": {
|
case "Items": {
|
||||||
if (typeName.substr(1).split("/")[3] == "Emotes") {
|
if (typeName.substring(1).split("/")[3] == "Emotes") {
|
||||||
return addCustomization(inventory, typeName);
|
return addCustomization(inventory, typeName);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -875,8 +875,8 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "Weapons": {
|
case "Weapons": {
|
||||||
if (typeName.substr(1).split("/")[4] == "MeleeTrees") break;
|
if (typeName.substring(1).split("/")[4] == "MeleeTrees") break;
|
||||||
const productCategory = typeName.substr(1).split("/")[3];
|
const productCategory = typeName.substring(1).split("/")[3];
|
||||||
switch (productCategory) {
|
switch (productCategory) {
|
||||||
case "Pistols":
|
case "Pistols":
|
||||||
case "LongGuns":
|
case "LongGuns":
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import { parseSlotPurchaseName, slotPurchaseNameToSlotName } from "../helpers/purchaseHelpers.ts";
|
|
||||||
import { getSubstringFromKeyword } from "../helpers/stringHelpers.ts";
|
import { getSubstringFromKeyword } from "../helpers/stringHelpers.ts";
|
||||||
import {
|
import {
|
||||||
addBooster,
|
addBooster,
|
||||||
@ -15,7 +14,8 @@ import type {
|
|||||||
IPurchaseRequest,
|
IPurchaseRequest,
|
||||||
IPurchaseResponse,
|
IPurchaseResponse,
|
||||||
IInventoryChanges,
|
IInventoryChanges,
|
||||||
IPurchaseParams
|
IPurchaseParams,
|
||||||
|
SlotNames
|
||||||
} from "../types/purchaseTypes.ts";
|
} from "../types/purchaseTypes.ts";
|
||||||
import { PurchaseSource } from "../types/purchaseTypes.ts";
|
import { PurchaseSource } from "../types/purchaseTypes.ts";
|
||||||
import { logger } from "../utils/logger.ts";
|
import { logger } from "../utils/logger.ts";
|
||||||
@ -489,6 +489,20 @@ export const handleStoreItemAcquisition = async (
|
|||||||
return purchaseResponse;
|
return purchaseResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const slotPurchaseNameToSlotName: Record<string, { name: SlotNames; purchaseQuantity: number }> = {
|
||||||
|
SuitSlotItem: { name: "SuitBin", purchaseQuantity: 1 },
|
||||||
|
TwoSentinelSlotItem: { name: "SentinelBin", purchaseQuantity: 2 },
|
||||||
|
TwoWeaponSlotItem: { name: "WeaponBin", purchaseQuantity: 2 },
|
||||||
|
SpaceSuitSlotItem: { name: "SpaceSuitBin", purchaseQuantity: 1 },
|
||||||
|
TwoSpaceWeaponSlotItem: { name: "SpaceWeaponBin", purchaseQuantity: 2 },
|
||||||
|
MechSlotItem: { name: "MechBin", purchaseQuantity: 1 },
|
||||||
|
TwoOperatorWeaponSlotItem: { name: "OperatorAmpBin", purchaseQuantity: 2 },
|
||||||
|
RandomModSlotItem: { name: "RandomModBin", purchaseQuantity: 3 },
|
||||||
|
TwoCrewShipSalvageSlotItem: { name: "CrewShipSalvageBin", purchaseQuantity: 2 },
|
||||||
|
CrewMemberSlotItem: { name: "CrewMemberBin", purchaseQuantity: 1 },
|
||||||
|
PvPLoadoutSlotItem: { name: "PvpBonusLoadoutBin", purchaseQuantity: 1 }
|
||||||
|
};
|
||||||
|
|
||||||
// // extra = everything above the base +2 slots (depending on slot type)
|
// // extra = everything above the base +2 slots (depending on slot type)
|
||||||
// // new slot above base = extra + 1 and slots +1
|
// // new slot above base = extra + 1 and slots +1
|
||||||
// // new frame = slots -1
|
// // new frame = slots -1
|
||||||
@ -500,9 +514,8 @@ const handleSlotPurchase = (
|
|||||||
ignorePurchaseQuantity: boolean
|
ignorePurchaseQuantity: boolean
|
||||||
): IPurchaseResponse => {
|
): IPurchaseResponse => {
|
||||||
logger.debug(`slot name ${slotPurchaseNameFull}`);
|
logger.debug(`slot name ${slotPurchaseNameFull}`);
|
||||||
const slotPurchaseName = parseSlotPurchaseName(
|
const slotPurchaseName = slotPurchaseNameFull.substring(slotPurchaseNameFull.lastIndexOf("/") + 1);
|
||||||
slotPurchaseNameFull.substring(slotPurchaseNameFull.lastIndexOf("/") + 1)
|
if (!(slotPurchaseName in slotPurchaseNameToSlotName)) throw new Error(`invalid slot name ${slotPurchaseName}`);
|
||||||
);
|
|
||||||
logger.debug(`slot purchase name ${slotPurchaseName}`);
|
logger.debug(`slot purchase name ${slotPurchaseName}`);
|
||||||
|
|
||||||
const slotName = slotPurchaseNameToSlotName[slotPurchaseName].name;
|
const slotName = slotPurchaseNameToSlotName[slotPurchaseName].name;
|
||||||
|
|||||||
@ -120,18 +120,6 @@ export type IBinChanges = {
|
|||||||
Extra?: number;
|
Extra?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type SlotPurchaseName =
|
|
||||||
| "SuitSlotItem"
|
|
||||||
| "TwoSentinelSlotItem"
|
|
||||||
| "TwoWeaponSlotItem"
|
|
||||||
| "SpaceSuitSlotItem"
|
|
||||||
| "TwoSpaceWeaponSlotItem"
|
|
||||||
| "MechSlotItem"
|
|
||||||
| "TwoOperatorWeaponSlotItem"
|
|
||||||
| "RandomModSlotItem"
|
|
||||||
| "TwoCrewShipSalvageSlotItem"
|
|
||||||
| "CrewMemberSlotItem";
|
|
||||||
|
|
||||||
export const slotNames = [
|
export const slotNames = [
|
||||||
"SuitBin",
|
"SuitBin",
|
||||||
"WeaponBin",
|
"WeaponBin",
|
||||||
@ -148,7 +136,3 @@ export const slotNames = [
|
|||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type SlotNames = (typeof slotNames)[number];
|
export type SlotNames = (typeof slotNames)[number];
|
||||||
|
|
||||||
export type SlotPurchase = {
|
|
||||||
[P in SlotPurchaseName]: { name: SlotNames; purchaseQuantity: number };
|
|
||||||
};
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user