forked from OpenWF/SpaceNinjaServer
Compare commits
10 Commits
15aaa28a4f
...
604ae5776a
Author | SHA1 | Date | |
---|---|---|---|
604ae5776a | |||
eb594af9d8 | |||
bb8596fa87 | |||
a85539a686 | |||
ada6a4bad0 | |||
948104a9a6 | |||
7a8b12b372 | |||
26d644a982 | |||
d6750cd84b | |||
f3601ec43e |
@ -1,4 +1,4 @@
|
|||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
|
|
||||||
@ -17,7 +17,7 @@ export const claimLibraryDailyTaskRewardController: RequestHandler = async (req,
|
|||||||
}
|
}
|
||||||
syndicate.Standing += rewardStanding;
|
syndicate.Standing += rewardStanding;
|
||||||
|
|
||||||
inventory.FusionPoints += 80 * rewardQuantity;
|
addFusionPoints(inventory, 80 * rewardQuantity);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
@ -2,7 +2,7 @@ import { toMongoDate } from "@/src/helpers/inventoryHelpers";
|
|||||||
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
import { getJSONfromString } from "@/src/helpers/stringHelpers";
|
||||||
import { Guild } from "@/src/models/guildModel";
|
import { Guild } from "@/src/models/guildModel";
|
||||||
import { checkClanAscensionHasRequiredContributors } from "@/src/services/guildService";
|
import { checkClanAscensionHasRequiredContributors } from "@/src/services/guildService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
@ -36,7 +36,7 @@ export const contributeGuildClassController: RequestHandler = async (req, res) =
|
|||||||
|
|
||||||
// Either way, endo is given to the contributor.
|
// Either way, endo is given to the contributor.
|
||||||
const inventory = await getInventory(accountId, "FusionPoints");
|
const inventory = await getInventory(accountId, "FusionPoints");
|
||||||
inventory.FusionPoints += guild.CeremonyEndo!;
|
addFusionPoints(inventory, guild.CeremonyEndo!);
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
|
|
||||||
res.json({
|
res.json({
|
||||||
|
@ -21,7 +21,11 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
|
|
||||||
const myAddress = request.host.indexOf("warframe.com") == -1 ? request.host : config.myAddress;
|
const myAddress = request.host.indexOf("warframe.com") == -1 ? request.host : config.myAddress;
|
||||||
|
|
||||||
if (!account && config.autoCreateAccount && loginRequest.ClientType != "webui") {
|
if (
|
||||||
|
!account &&
|
||||||
|
((config.autoCreateAccount && loginRequest.ClientType != "webui") ||
|
||||||
|
loginRequest.ClientType == "webui-register")
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const nameFromEmail = loginRequest.email.substring(0, loginRequest.email.indexOf("@"));
|
const nameFromEmail = loginRequest.email.substring(0, loginRequest.email.indexOf("@"));
|
||||||
let name = nameFromEmail || loginRequest.email.substring(1) || "SpaceNinja";
|
let name = nameFromEmail || loginRequest.email.substring(1) || "SpaceNinja";
|
||||||
@ -37,7 +41,7 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
password: loginRequest.password,
|
password: loginRequest.password,
|
||||||
DisplayName: name,
|
DisplayName: name,
|
||||||
CountryCode: loginRequest.lang.toUpperCase(),
|
CountryCode: loginRequest.lang.toUpperCase(),
|
||||||
ClientType: loginRequest.ClientType,
|
ClientType: loginRequest.ClientType == "webui-register" ? "webui" : loginRequest.ClientType,
|
||||||
CrossPlatformAllowed: true,
|
CrossPlatformAllowed: true,
|
||||||
ForceLogoutVersion: 0,
|
ForceLogoutVersion: 0,
|
||||||
ConsentNeeded: false,
|
ConsentNeeded: false,
|
||||||
@ -59,6 +63,11 @@ export const loginController: RequestHandler = async (request, response) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (loginRequest.ClientType == "webui-register") {
|
||||||
|
response.status(400).json({ error: "account already exists" });
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!isCorrectPassword(loginRequest.password, account.password)) {
|
if (!isCorrectPassword(loginRequest.password, account.password)) {
|
||||||
response.status(400).json({ error: "incorrect login data" });
|
response.status(400).json({ error: "incorrect login data" });
|
||||||
return;
|
return;
|
||||||
|
@ -17,7 +17,7 @@ import { getDefaultUpgrades } from "@/src/services/itemDataService";
|
|||||||
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
|
import { modularWeaponTypes } from "@/src/helpers/modularWeaponHelper";
|
||||||
import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
import { IEquipmentDatabase } from "@/src/types/inventoryTypes/commonInventoryTypes";
|
||||||
import { getRandomInt } from "@/src/services/rngService";
|
import { getRandomInt } from "@/src/services/rngService";
|
||||||
import { ExportSentinels, IDefaultUpgrade } from "warframe-public-export-plus";
|
import { ExportSentinels, ExportWeapons, IDefaultUpgrade } from "warframe-public-export-plus";
|
||||||
import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { Status } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
|
|
||||||
interface IModularCraftRequest {
|
interface IModularCraftRequest {
|
||||||
@ -138,6 +138,23 @@ export const modularWeaponCraftingController: RequestHandler = async (req, res)
|
|||||||
} else {
|
} else {
|
||||||
defaultUpgrades = getDefaultUpgrades(data.Parts);
|
defaultUpgrades = getDefaultUpgrades(data.Parts);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (category == "MoaPets" && data.WeaponType.startsWith("/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPet")) {
|
||||||
|
const defaultWeaponMap = {
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetAPowerSuit":
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetMeleeWeaponIP",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetBPowerSuit":
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetMeleeWeaponIS",
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetCPowerSuit":
|
||||||
|
"/Lotus/Types/Friendly/Pets/ZanukaPets/ZanukaPetMeleeWeaponPS"
|
||||||
|
};
|
||||||
|
if (data.WeaponType in defaultWeaponMap) {
|
||||||
|
const weapon = defaultWeaponMap[data.WeaponType as keyof typeof defaultWeaponMap];
|
||||||
|
const category = ExportWeapons[weapon].productCategory;
|
||||||
|
addEquipment(inventory, category, weapon);
|
||||||
|
occupySlot(inventory, productCategoryToInventoryBin(category)!, !!data.isWebUi);
|
||||||
|
}
|
||||||
|
}
|
||||||
defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);
|
defaultOverwrites.Configs = applyDefaultUpgrades(inventory, defaultUpgrades);
|
||||||
addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites);
|
addEquipment(inventory, category, data.WeaponType, data.Parts, inventoryChanges, defaultOverwrites);
|
||||||
combineInventoryChanges(
|
combineInventoryChanges(
|
||||||
|
@ -37,6 +37,7 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) =
|
|||||||
const deco = component.Decos.find(x => x._id.equals(request.MoveId))!;
|
const deco = component.Decos.find(x => x._id.equals(request.MoveId))!;
|
||||||
deco.Pos = request.Pos;
|
deco.Pos = request.Pos;
|
||||||
deco.Rot = request.Rot;
|
deco.Rot = request.Rot;
|
||||||
|
deco.Scale = request.Scale;
|
||||||
} else {
|
} else {
|
||||||
const deco =
|
const deco =
|
||||||
component.Decos[
|
component.Decos[
|
||||||
@ -45,6 +46,7 @@ export const placeDecoInComponentController: RequestHandler = async (req, res) =
|
|||||||
Type: request.Type,
|
Type: request.Type,
|
||||||
Pos: request.Pos,
|
Pos: request.Pos,
|
||||||
Rot: request.Rot,
|
Rot: request.Rot,
|
||||||
|
Scale: request.Scale,
|
||||||
Name: request.Name,
|
Name: request.Name,
|
||||||
Sockets: request.Sockets
|
Sockets: request.Sockets
|
||||||
}) - 1
|
}) - 1
|
||||||
@ -113,9 +115,9 @@ interface IPlaceDecoInComponentRequest {
|
|||||||
Type: string;
|
Type: string;
|
||||||
Pos: number[];
|
Pos: number[];
|
||||||
Rot: number[];
|
Rot: number[];
|
||||||
|
Scale?: number;
|
||||||
Name?: string;
|
Name?: string;
|
||||||
Sockets?: number;
|
Sockets?: number;
|
||||||
Scale?: number; // only provided alongside MoveId and seems to always be 1
|
|
||||||
MoveId?: string;
|
MoveId?: string;
|
||||||
ShipDeco?: boolean;
|
ShipDeco?: boolean;
|
||||||
VaultDeco?: boolean;
|
VaultDeco?: boolean;
|
||||||
|
@ -8,7 +8,8 @@ import {
|
|||||||
addConsumables,
|
addConsumables,
|
||||||
freeUpSlot,
|
freeUpSlot,
|
||||||
combineInventoryChanges,
|
combineInventoryChanges,
|
||||||
addCrewShipRawSalvage
|
addCrewShipRawSalvage,
|
||||||
|
addFusionPoints
|
||||||
} from "@/src/services/inventoryService";
|
} from "@/src/services/inventoryService";
|
||||||
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
|
import { InventorySlot } from "@/src/types/inventoryTypes/inventoryTypes";
|
||||||
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
import { ExportDojoRecipes } from "warframe-public-export-plus";
|
||||||
@ -69,7 +70,7 @@ export const sellController: RequestHandler = async (req, res) => {
|
|||||||
if (payload.SellCurrency == "SC_RegularCredits") {
|
if (payload.SellCurrency == "SC_RegularCredits") {
|
||||||
inventory.RegularCredits += payload.SellPrice;
|
inventory.RegularCredits += payload.SellPrice;
|
||||||
} else if (payload.SellCurrency == "SC_FusionPoints") {
|
} else if (payload.SellCurrency == "SC_FusionPoints") {
|
||||||
inventory.FusionPoints += payload.SellPrice;
|
addFusionPoints(inventory, payload.SellPrice);
|
||||||
} else if (payload.SellCurrency == "SC_PrimeBucks") {
|
} else if (payload.SellCurrency == "SC_PrimeBucks") {
|
||||||
addMiscItems(inventory, [
|
addMiscItems(inventory, [
|
||||||
{
|
{
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
import { RequestHandler } from "express";
|
import { RequestHandler } from "express";
|
||||||
import { getAccountIdForRequest } from "@/src/services/loginService";
|
import { getAccountIdForRequest } from "@/src/services/loginService";
|
||||||
import { getInventory } from "@/src/services/inventoryService";
|
import { addFusionPoints, getInventory } from "@/src/services/inventoryService";
|
||||||
|
|
||||||
export const addCurrencyController: RequestHandler = async (req, res) => {
|
export const addCurrencyController: RequestHandler = async (req, res) => {
|
||||||
const accountId = await getAccountIdForRequest(req);
|
const accountId = await getAccountIdForRequest(req);
|
||||||
const inventory = await getInventory(accountId);
|
|
||||||
const request = req.body as IAddCurrencyRequest;
|
const request = req.body as IAddCurrencyRequest;
|
||||||
inventory[request.currency] += request.delta;
|
const inventory = await getInventory(accountId, request.currency);
|
||||||
|
if (request.currency == "FusionPoints") {
|
||||||
|
addFusionPoints(inventory, request.delta);
|
||||||
|
} else {
|
||||||
|
inventory[request.currency] += request.delta;
|
||||||
|
}
|
||||||
await inventory.save();
|
await inventory.save();
|
||||||
res.end();
|
res.end();
|
||||||
};
|
};
|
||||||
|
@ -115,12 +115,28 @@ const getItemListsController: RequestHandler = (req, response) => {
|
|||||||
let name = getString(item.name, lang);
|
let name = getString(item.name, lang);
|
||||||
if ("dissectionParts" in item) {
|
if ("dissectionParts" in item) {
|
||||||
name = getString("/Lotus/Language/Fish/FishDisplayName", lang).split("|FISH_NAME|").join(name);
|
name = getString("/Lotus/Language/Fish/FishDisplayName", lang).split("|FISH_NAME|").join(name);
|
||||||
if (uniqueName.indexOf("Large") != -1) {
|
if (item.syndicateTag == "CetusSyndicate") {
|
||||||
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeLargeAbbrev", lang));
|
if (uniqueName.indexOf("Large") != -1) {
|
||||||
} else if (uniqueName.indexOf("Medium") != -1) {
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeLargeAbbrev", lang));
|
||||||
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeMediumAbbrev", lang));
|
} else if (uniqueName.indexOf("Medium") != -1) {
|
||||||
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeMediumAbbrev", lang));
|
||||||
|
} else {
|
||||||
|
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
name = name.split("|FISH_SIZE|").join(getString("/Lotus/Language/Fish/FishSizeSmallAbbrev", lang));
|
if (uniqueName.indexOf("Large") != -1) {
|
||||||
|
name = name
|
||||||
|
.split("|FISH_SIZE|")
|
||||||
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryElderAbbrev", lang));
|
||||||
|
} else if (uniqueName.indexOf("Medium") != -1) {
|
||||||
|
name = name
|
||||||
|
.split("|FISH_SIZE|")
|
||||||
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryMatureAbbrev", lang));
|
||||||
|
} else {
|
||||||
|
name = name
|
||||||
|
.split("|FISH_SIZE|")
|
||||||
|
.join(getString("/Lotus/Language/SolarisVenus/RobofishAgeCategoryYoungAbbrev", lang));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
|
@ -6,6 +6,7 @@ import { logger } from "../utils/logger";
|
|||||||
import { IOid } from "../types/commonTypes";
|
import { IOid } from "../types/commonTypes";
|
||||||
import { Types } from "mongoose";
|
import { Types } from "mongoose";
|
||||||
import { addMods } from "../services/inventoryService";
|
import { addMods } from "../services/inventoryService";
|
||||||
|
import { isArchwingMission } from "../services/worldStateService";
|
||||||
|
|
||||||
export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
||||||
const infNodes = [];
|
const infNodes = [];
|
||||||
@ -22,7 +23,7 @@ export const getInfNodes = (faction: string, rank: number): IInfNode[] => {
|
|||||||
value.missionIndex != 42 && // not face off
|
value.missionIndex != 42 && // not face off
|
||||||
value.name.indexOf("1999NodeI") == -1 && // not stage defence
|
value.name.indexOf("1999NodeI") == -1 && // not stage defence
|
||||||
value.name.indexOf("1999NodeJ") == -1 && // not lich bounty
|
value.name.indexOf("1999NodeJ") == -1 && // not lich bounty
|
||||||
value.name.indexOf("Archwing") == -1
|
!isArchwingMission(value)
|
||||||
) {
|
) {
|
||||||
//console.log(dict_en[value.name]);
|
//console.log(dict_en[value.name]);
|
||||||
infNodes.push({ Node: key, Influence: 1 });
|
infNodes.push({ Node: key, Influence: 1 });
|
||||||
|
@ -23,6 +23,7 @@ const dojoDecoSchema = new Schema<IDojoDecoDatabase>({
|
|||||||
Type: String,
|
Type: String,
|
||||||
Pos: [Number],
|
Pos: [Number],
|
||||||
Rot: [Number],
|
Rot: [Number],
|
||||||
|
Scale: Number,
|
||||||
Name: String,
|
Name: String,
|
||||||
Sockets: Number,
|
Sockets: Number,
|
||||||
RegularCredits: Number,
|
RegularCredits: Number,
|
||||||
|
@ -222,6 +222,7 @@ export const getDojoClient = async (
|
|||||||
Type: deco.Type,
|
Type: deco.Type,
|
||||||
Pos: deco.Pos,
|
Pos: deco.Pos,
|
||||||
Rot: deco.Rot,
|
Rot: deco.Rot,
|
||||||
|
Scale: deco.Scale,
|
||||||
Name: deco.Name,
|
Name: deco.Name,
|
||||||
Sockets: deco.Sockets,
|
Sockets: deco.Sockets,
|
||||||
PictureFrameInfo: deco.PictureFrameInfo
|
PictureFrameInfo: deco.PictureFrameInfo
|
||||||
|
@ -532,7 +532,11 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
...inventoryChanges,
|
...inventoryChanges,
|
||||||
...occupySlot(inventory, InventorySlot.WEAPONS, premiumPurchase)
|
...occupySlot(
|
||||||
|
inventory,
|
||||||
|
productCategoryToInventoryBin(weapon.productCategory) ?? InventorySlot.WEAPONS,
|
||||||
|
premiumPurchase
|
||||||
|
)
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
// Modular weapon parts
|
// Modular weapon parts
|
||||||
@ -580,7 +584,7 @@ export const addItem = async (
|
|||||||
}
|
}
|
||||||
if (typeName in ExportFusionBundles) {
|
if (typeName in ExportFusionBundles) {
|
||||||
const fusionPointsTotal = ExportFusionBundles[typeName].fusionPoints * quantity;
|
const fusionPointsTotal = ExportFusionBundles[typeName].fusionPoints * quantity;
|
||||||
inventory.FusionPoints += fusionPointsTotal;
|
addFusionPoints(inventory, fusionPointsTotal);
|
||||||
return {
|
return {
|
||||||
FusionPoints: fusionPointsTotal
|
FusionPoints: fusionPointsTotal
|
||||||
};
|
};
|
||||||
@ -821,7 +825,8 @@ const addSentinel = (
|
|||||||
|
|
||||||
const features = premiumPurchase ? EquipmentFeatures.DOUBLE_CAPACITY : undefined;
|
const features = premiumPurchase ? EquipmentFeatures.DOUBLE_CAPACITY : undefined;
|
||||||
const sentinelIndex =
|
const sentinelIndex =
|
||||||
inventory.Sentinels.push({ ItemType: sentinelName, Configs: configs, XP: 0, Features: features }) - 1;
|
inventory.Sentinels.push({ ItemType: sentinelName, Configs: configs, XP: 0, Features: features, IsNew: true }) -
|
||||||
|
1;
|
||||||
inventoryChanges.Sentinels ??= [];
|
inventoryChanges.Sentinels ??= [];
|
||||||
inventoryChanges.Sentinels.push(inventory.Sentinels[sentinelIndex].toJSON<IEquipmentClient>());
|
inventoryChanges.Sentinels.push(inventory.Sentinels[sentinelIndex].toJSON<IEquipmentClient>());
|
||||||
|
|
||||||
@ -1069,6 +1074,15 @@ export const updateCurrency = (
|
|||||||
return currencyChanges;
|
return currencyChanges;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const addFusionPoints = (inventory: TInventoryDatabaseDocument, add: number): number => {
|
||||||
|
if (inventory.FusionPoints + add > 2147483647) {
|
||||||
|
logger.warn(`capping FusionPoints balance at 2147483647`);
|
||||||
|
add = 2147483647 - inventory.FusionPoints;
|
||||||
|
}
|
||||||
|
inventory.FusionPoints += add;
|
||||||
|
return add;
|
||||||
|
};
|
||||||
|
|
||||||
const standingLimitBinToInventoryKey: Record<
|
const standingLimitBinToInventoryKey: Record<
|
||||||
Exclude<TStandingLimitBin, "STANDING_LIMIT_BIN_NONE">,
|
Exclude<TStandingLimitBin, "STANDING_LIMIT_BIN_NONE">,
|
||||||
keyof IDailyAffiliations
|
keyof IDailyAffiliations
|
||||||
|
@ -19,6 +19,7 @@ import {
|
|||||||
addCrewShipRawSalvage,
|
addCrewShipRawSalvage,
|
||||||
addEmailItem,
|
addEmailItem,
|
||||||
addFocusXpIncreases,
|
addFocusXpIncreases,
|
||||||
|
addFusionPoints,
|
||||||
addFusionTreasures,
|
addFusionTreasures,
|
||||||
addGearExpByCategory,
|
addGearExpByCategory,
|
||||||
addItem,
|
addItem,
|
||||||
@ -287,14 +288,14 @@ export const addMissionInventoryUpdates = async (
|
|||||||
addShipDecorations(inventory, value);
|
addShipDecorations(inventory, value);
|
||||||
break;
|
break;
|
||||||
case "FusionBundles": {
|
case "FusionBundles": {
|
||||||
let fusionPoints = 0;
|
let fusionPointsDelta = 0;
|
||||||
for (const fusionBundle of value) {
|
for (const fusionBundle of value) {
|
||||||
const fusionPointsTotal =
|
fusionPointsDelta += addFusionPoints(
|
||||||
ExportFusionBundles[fusionBundle.ItemType].fusionPoints * fusionBundle.ItemCount;
|
inventory,
|
||||||
inventory.FusionPoints += fusionPointsTotal;
|
ExportFusionBundles[fusionBundle.ItemType].fusionPoints * fusionBundle.ItemCount
|
||||||
fusionPoints += fusionPointsTotal;
|
);
|
||||||
}
|
}
|
||||||
inventoryChanges.FusionPoints = fusionPoints;
|
inventoryChanges.FusionPoints = fusionPointsDelta;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "EmailItems": {
|
case "EmailItems": {
|
||||||
|
@ -1,10 +1,18 @@
|
|||||||
import staticWorldState from "@/static/fixed_responses/worldState/worldState.json";
|
import staticWorldState from "@/static/fixed_responses/worldState/worldState.json";
|
||||||
|
import sortieTilesets from "@/static/fixed_responses/worldState/sortieTilesets.json";
|
||||||
import { buildConfig } from "@/src/services/buildConfigService";
|
import { buildConfig } from "@/src/services/buildConfigService";
|
||||||
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
||||||
import { config } from "@/src/services/configService";
|
import { config } from "@/src/services/configService";
|
||||||
import { CRng } from "@/src/services/rngService";
|
import { CRng } from "@/src/services/rngService";
|
||||||
import { eMissionType, ExportNightwave, ExportRegions } from "warframe-public-export-plus";
|
import { eMissionType, ExportNightwave, ExportRegions, IRegion } from "warframe-public-export-plus";
|
||||||
import { ICalendarDay, ICalendarSeason, ILiteSortie, ISeasonChallenge, IWorldState } from "../types/worldStateTypes";
|
import {
|
||||||
|
ICalendarDay,
|
||||||
|
ICalendarSeason,
|
||||||
|
ILiteSortie,
|
||||||
|
ISeasonChallenge,
|
||||||
|
ISortieMission,
|
||||||
|
IWorldState
|
||||||
|
} from "../types/worldStateTypes";
|
||||||
|
|
||||||
const sortieBosses = [
|
const sortieBosses = [
|
||||||
"SORTIE_BOSS_HYENA",
|
"SORTIE_BOSS_HYENA",
|
||||||
@ -177,7 +185,7 @@ const pushSyndicateMissions = (
|
|||||||
const nodeOptions: string[] = [];
|
const nodeOptions: string[] = [];
|
||||||
for (const [key, value] of Object.entries(ExportRegions)) {
|
for (const [key, value] of Object.entries(ExportRegions)) {
|
||||||
if (
|
if (
|
||||||
value.name.indexOf("Archwing") == -1 && // no archwing
|
!isArchwingMission(value) &&
|
||||||
value.systemIndex != 23 && // no 1999 stuff
|
value.systemIndex != 23 && // no 1999 stuff
|
||||||
value.missionIndex != 10 && // Exclude MT_PVP (for relays)
|
value.missionIndex != 10 && // Exclude MT_PVP (for relays)
|
||||||
value.missionIndex != 23 && // no junctions
|
value.missionIndex != 23 && // no junctions
|
||||||
@ -261,9 +269,8 @@ const pushSortieIfRelevant = (worldState: IWorldState, day: number): void => {
|
|||||||
if (
|
if (
|
||||||
sortieFactionToSystemIndexes[sortieBossToFaction[boss]].includes(value.systemIndex) &&
|
sortieFactionToSystemIndexes[sortieBossToFaction[boss]].includes(value.systemIndex) &&
|
||||||
sortieFactionToFactionIndexes[sortieBossToFaction[boss]].includes(value.factionIndex!) &&
|
sortieFactionToFactionIndexes[sortieBossToFaction[boss]].includes(value.factionIndex!) &&
|
||||||
value.name.indexOf("Archwing") == -1 &&
|
!isArchwingMission(value) &&
|
||||||
value.missionIndex != 0 && // Exclude MT_ASSASSINATION
|
value.missionIndex != 0 && // Exclude MT_ASSASSINATION
|
||||||
value.missionIndex != 5 && // Exclude MT_CAPTURE
|
|
||||||
value.missionIndex != 10 && // Exclude MT_PVP (for relays)
|
value.missionIndex != 10 && // Exclude MT_PVP (for relays)
|
||||||
value.missionIndex != 21 && // Exclude MT_PURIFY
|
value.missionIndex != 21 && // Exclude MT_PURIFY
|
||||||
value.missionIndex != 22 && // Exclude MT_ARENA
|
value.missionIndex != 22 && // Exclude MT_ARENA
|
||||||
@ -278,7 +285,7 @@ const pushSortieIfRelevant = (worldState: IWorldState, day: number): void => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedNodes: { missionType: string; modifierType: string; node: string }[] = [];
|
const selectedNodes: ISortieMission[] = [];
|
||||||
const missionTypes = new Set();
|
const missionTypes = new Set();
|
||||||
|
|
||||||
for (let i = 0; i < 3; i++) {
|
for (let i = 0; i < 3; i++) {
|
||||||
@ -299,11 +306,21 @@ const pushSortieIfRelevant = (worldState: IWorldState, day: number): void => {
|
|||||||
const modifierType = rng.randomElement(filteredModifiers);
|
const modifierType = rng.randomElement(filteredModifiers);
|
||||||
|
|
||||||
if (boss == "SORTIE_BOSS_PHORID") {
|
if (boss == "SORTIE_BOSS_PHORID") {
|
||||||
selectedNodes.push({ missionType: "MT_ASSASSINATION", modifierType, node });
|
selectedNodes.push({
|
||||||
|
missionType: "MT_ASSASSINATION",
|
||||||
|
modifierType,
|
||||||
|
node,
|
||||||
|
tileset: sortieTilesets[node as keyof typeof sortieTilesets]
|
||||||
|
});
|
||||||
nodes.splice(randomIndex, 1);
|
nodes.splice(randomIndex, 1);
|
||||||
continue;
|
continue;
|
||||||
} else if (sortieBossNode[boss]) {
|
} else if (sortieBossNode[boss]) {
|
||||||
selectedNodes.push({ missionType: "MT_ASSASSINATION", modifierType, node: sortieBossNode[boss] });
|
selectedNodes.push({
|
||||||
|
missionType: "MT_ASSASSINATION",
|
||||||
|
modifierType,
|
||||||
|
node: sortieBossNode[boss],
|
||||||
|
tileset: sortieTilesets[sortieBossNode[boss] as keyof typeof sortieTilesets]
|
||||||
|
});
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -322,7 +339,12 @@ const pushSortieIfRelevant = (worldState: IWorldState, day: number): void => {
|
|||||||
|
|
||||||
const modifierType = rng.randomElement(filteredModifiers);
|
const modifierType = rng.randomElement(filteredModifiers);
|
||||||
|
|
||||||
selectedNodes.push({ missionType, modifierType, node });
|
selectedNodes.push({
|
||||||
|
missionType,
|
||||||
|
modifierType,
|
||||||
|
node,
|
||||||
|
tileset: sortieTilesets[node as keyof typeof sortieTilesets]
|
||||||
|
});
|
||||||
nodes.splice(randomIndex, 1);
|
nodes.splice(randomIndex, 1);
|
||||||
missionTypes.add(missionType);
|
missionTypes.add(missionType);
|
||||||
}
|
}
|
||||||
@ -1090,7 +1112,7 @@ export const getLiteSortie = (week: number): ILiteSortie => {
|
|||||||
value.systemIndex === systemIndex &&
|
value.systemIndex === systemIndex &&
|
||||||
value.factionIndex !== undefined &&
|
value.factionIndex !== undefined &&
|
||||||
value.factionIndex < 2 &&
|
value.factionIndex < 2 &&
|
||||||
value.name.indexOf("Archwing") == -1 &&
|
!isArchwingMission(value) &&
|
||||||
value.missionIndex != 0 // Exclude MT_ASSASSINATION
|
value.missionIndex != 0 // Exclude MT_ASSASSINATION
|
||||||
) {
|
) {
|
||||||
nodes.push(key);
|
nodes.push(key);
|
||||||
@ -1141,3 +1163,14 @@ export const getLiteSortie = (week: number): ILiteSortie => {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isArchwingMission = (node: IRegion): boolean => {
|
||||||
|
if (node.name.indexOf("Archwing") != -1) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// SettlementNode10
|
||||||
|
if (node.missionIndex == 25) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
@ -206,6 +206,7 @@ export interface IDojoDecoClient {
|
|||||||
Type: string;
|
Type: string;
|
||||||
Pos: number[];
|
Pos: number[];
|
||||||
Rot: number[];
|
Rot: number[];
|
||||||
|
Scale?: number;
|
||||||
Name?: string; // for teleporters
|
Name?: string; // for teleporters
|
||||||
Sockets?: number;
|
Sockets?: number;
|
||||||
RegularCredits?: number;
|
RegularCredits?: number;
|
||||||
|
@ -97,6 +97,13 @@ export interface ISortie {
|
|||||||
}[];
|
}[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ISortieMission {
|
||||||
|
missionType: string;
|
||||||
|
modifierType: string;
|
||||||
|
node: string;
|
||||||
|
tileset: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ILiteSortie {
|
export interface ILiteSortie {
|
||||||
_id: IOid;
|
_id: IOid;
|
||||||
Activation: IMongoDate;
|
Activation: IMongoDate;
|
||||||
|
175
static/fixed_responses/worldState/sortieTilesets.json
Normal file
175
static/fixed_responses/worldState/sortieTilesets.json
Normal file
@ -0,0 +1,175 @@
|
|||||||
|
{
|
||||||
|
"SettlementNode1": "CorpusShipTileset",
|
||||||
|
"SettlementNode11": "CorpusShipTileset",
|
||||||
|
"SettlementNode12": "CorpusShipTileset",
|
||||||
|
"SettlementNode14": "CorpusShipTileset",
|
||||||
|
"SettlementNode15": "CorpusShipTileset",
|
||||||
|
"SettlementNode2": "CorpusShipTileset",
|
||||||
|
"SettlementNode20": "CorpusShipTileset",
|
||||||
|
"SettlementNode3": "CorpusShipTileset",
|
||||||
|
"SolNode1": "CorpusOutpostTileset",
|
||||||
|
"SolNode10": "CorpusGasCityTileset",
|
||||||
|
"SolNode100": "CorpusGasCityTileset",
|
||||||
|
"SolNode101": "CorpusOutpostTileset",
|
||||||
|
"SolNode102": "CorpusShipTileset",
|
||||||
|
"SolNode103": "GrineerAsteroidTileset",
|
||||||
|
"SolNode104": "CorpusShipTileset",
|
||||||
|
"SolNode105": "GrineerOceanTilesetAnywhere",
|
||||||
|
"SolNode106": "GrineerSettlementTileset",
|
||||||
|
"SolNode107": "CorpusOutpostTileset",
|
||||||
|
"SolNode108": "GrineerAsteroidTileset",
|
||||||
|
"SolNode109": "CorpusOutpostTileset",
|
||||||
|
"SolNode11": "GrineerSettlementTileset",
|
||||||
|
"SolNode113": "GrineerSettlementTileset",
|
||||||
|
"SolNode118": "CorpusShipTileset",
|
||||||
|
"SolNode119": "GrineerAsteroidTileset",
|
||||||
|
"SolNode12": "GrineerAsteroidTileset",
|
||||||
|
"SolNode121": "CorpusGasCityTileset",
|
||||||
|
"SolNode122": "GrineerOceanTileset",
|
||||||
|
"SolNode123": "CorpusShipTileset",
|
||||||
|
"SolNode125": "CorpusGasCityTileset",
|
||||||
|
"SolNode126": "CorpusGasCityTileset",
|
||||||
|
"SolNode127": "CorpusShipTileset",
|
||||||
|
"SolNode128": "CorpusOutpostTileset",
|
||||||
|
"SolNode130": "GrineerAsteroidTileset",
|
||||||
|
"SolNode131": "GrineerShipyardsTileset",
|
||||||
|
"SolNode132": "GrineerShipyardsTileset",
|
||||||
|
"SolNode135": "GrineerGalleonTileset",
|
||||||
|
"SolNode137": "GrineerShipyardsTileset",
|
||||||
|
"SolNode138": "GrineerShipyardsTileset",
|
||||||
|
"SolNode139": "GrineerShipyardsTileset",
|
||||||
|
"SolNode14": "CorpusIcePlanetTilesetCaves",
|
||||||
|
"SolNode140": "GrineerShipyardsTileset",
|
||||||
|
"SolNode141": "GrineerShipyardsTileset",
|
||||||
|
"SolNode144": "GrineerShipyardsTileset",
|
||||||
|
"SolNode146": "GrineerAsteroidTileset",
|
||||||
|
"SolNode147": "GrineerShipyardsTileset",
|
||||||
|
"SolNode149": "GrineerShipyardsTileset",
|
||||||
|
"SolNode15": "GrineerGalleonTileset",
|
||||||
|
"SolNode16": "GrineerSettlementTileset",
|
||||||
|
"SolNode162": "InfestedCorpusShipTileset",
|
||||||
|
"SolNode164": "InfestedCorpusShipTileset",
|
||||||
|
"SolNode166": "InfestedCorpusShipTileset",
|
||||||
|
"SolNode17": "CorpusShipTileset",
|
||||||
|
"SolNode171": "InfestedCorpusShipTileset",
|
||||||
|
"SolNode172": "CorpusShipTileset",
|
||||||
|
"SolNode173": "InfestedCorpusShipTileset",
|
||||||
|
"SolNode175": "InfestedCorpusShipTileset",
|
||||||
|
"SolNode177": "GrineerGalleonTileset",
|
||||||
|
"SolNode18": "GrineerAsteroidTileset",
|
||||||
|
"SolNode181": "GrineerAsteroidTileset",
|
||||||
|
"SolNode184": "GrineerGalleonTileset",
|
||||||
|
"SolNode185": "GrineerGalleonTileset",
|
||||||
|
"SolNode187": "GrineerAsteroidTileset",
|
||||||
|
"SolNode188": "GrineerGalleonTileset",
|
||||||
|
"SolNode189": "GrineerGalleonTileset",
|
||||||
|
"SolNode19": "GrineerAsteroidTileset",
|
||||||
|
"SolNode191": "GrineerShipyardsTileset",
|
||||||
|
"SolNode193": "GrineerAsteroidTileset",
|
||||||
|
"SolNode195": "GrineerGalleonTileset",
|
||||||
|
"SolNode196": "GrineerGalleonTileset",
|
||||||
|
"SolNode2": "CorpusOutpostTileset",
|
||||||
|
"SolNode20": "GrineerGalleonTileset",
|
||||||
|
"SolNode203": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode205": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode209": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode21": "CorpusOutpostTileset",
|
||||||
|
"SolNode210": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode211": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode212": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode214": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode215": "CorpusShipTileset",
|
||||||
|
"SolNode216": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode217": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode22": "CorpusOutpostTileset",
|
||||||
|
"SolNode220": "CorpusIcePlanetTileset",
|
||||||
|
"SolNode223": "GrineerAsteroidTileset",
|
||||||
|
"SolNode224": "GrineerGalleonTileset",
|
||||||
|
"SolNode225": "GrineerGalleonTileset",
|
||||||
|
"SolNode226": "GrineerGalleonTileset",
|
||||||
|
"SolNode228": "EidolonTileset",
|
||||||
|
"SolNode23": "CorpusShipTileset",
|
||||||
|
"SolNode24": "GrineerForestTileset",
|
||||||
|
"SolNode25": "CorpusGasCityTileset",
|
||||||
|
"SolNode26": "GrineerForestTileset",
|
||||||
|
"SolNode30": "GrineerSettlementTileset",
|
||||||
|
"SolNode300": "OrokinMoonTilesetGrineer",
|
||||||
|
"SolNode301": "OrokinMoonTilesetGrineer",
|
||||||
|
"SolNode302": "OrokinMoonTilesetCorpus",
|
||||||
|
"SolNode304": "OrokinMoonTilesetCorpus",
|
||||||
|
"SolNode305": "OrokinMoonTilesetGrineer",
|
||||||
|
"SolNode306": "OrokinMoonTilesetCorpus",
|
||||||
|
"SolNode307": "OrokinMoonTilesetCorpus",
|
||||||
|
"SolNode308": "OrokinMoonTilesetCorpus",
|
||||||
|
"SolNode31": "GrineerGalleonTileset",
|
||||||
|
"SolNode32": "GrineerGalleonTileset",
|
||||||
|
"SolNode36": "GrineerSettlementTileset",
|
||||||
|
"SolNode38": "CorpusOutpostTileset",
|
||||||
|
"SolNode39": "GrineerForestTileset",
|
||||||
|
"SolNode4": "CorpusShipTileset",
|
||||||
|
"SolNode400": "OrokinVoidTileset",
|
||||||
|
"SolNode401": "OrokinVoidTileset",
|
||||||
|
"SolNode402": "OrokinVoidTileset",
|
||||||
|
"SolNode403": "OrokinVoidTileset",
|
||||||
|
"SolNode404": "OrokinVoidTileset",
|
||||||
|
"SolNode405": "OrokinVoidTileset",
|
||||||
|
"SolNode406": "OrokinVoidTileset",
|
||||||
|
"SolNode407": "OrokinVoidTileset",
|
||||||
|
"SolNode408": "OrokinVoidTileset",
|
||||||
|
"SolNode409": "OrokinVoidTileset",
|
||||||
|
"SolNode41": "GrineerSettlementTileset",
|
||||||
|
"SolNode410": "OrokinVoidTileset",
|
||||||
|
"SolNode412": "OrokinVoidTileset",
|
||||||
|
"SolNode42": "GrineerGalleonTileset",
|
||||||
|
"SolNode43": "CorpusOutpostTileset",
|
||||||
|
"SolNode45": "GrineerSettlementTileset",
|
||||||
|
"SolNode46": "GrineerSettlementTileset",
|
||||||
|
"SolNode48": "CorpusOutpostTileset",
|
||||||
|
"SolNode49": "CorpusShipTileset",
|
||||||
|
"SolNode50": "GrineerAsteroidTileset",
|
||||||
|
"SolNode51": "CorpusOutpostTileset",
|
||||||
|
"SolNode53": "CorpusGasCityTileset",
|
||||||
|
"SolNode56": "CorpusShipTileset",
|
||||||
|
"SolNode57": "CorpusOutpostTileset",
|
||||||
|
"SolNode58": "GrineerSettlementTileset",
|
||||||
|
"SolNode59": "GrineerForestTileset",
|
||||||
|
"SolNode6": "CorpusOutpostTileset",
|
||||||
|
"SolNode61": "CorpusShipTileset",
|
||||||
|
"SolNode62": "CorpusIcePlanetTilesetCaves",
|
||||||
|
"SolNode64": "GrineerOceanTileset",
|
||||||
|
"SolNode66": "CorpusOutpostTileset",
|
||||||
|
"SolNode67": "GrineerAsteroidTileset",
|
||||||
|
"SolNode68": "GrineerGalleonTileset",
|
||||||
|
"SolNode70": "GrineerGalleonTileset",
|
||||||
|
"SolNode706": "OrokinDerelictTileset",
|
||||||
|
"SolNode707": "OrokinDerelictTileset",
|
||||||
|
"SolNode708": "OrokinDerelictTileset",
|
||||||
|
"SolNode709": "OrokinDerelictTileset",
|
||||||
|
"SolNode710": "OrokinDerelictTileset",
|
||||||
|
"SolNode711": "OrokinDerelictTileset",
|
||||||
|
"SolNode712": "OrokinDerelictTileset",
|
||||||
|
"SolNode713": "OrokinDerelictTileset",
|
||||||
|
"SolNode72": "CorpusOutpostTileset",
|
||||||
|
"SolNode73": "CorpusGasCityTileset",
|
||||||
|
"SolNode74": "CorpusGasCityTileset",
|
||||||
|
"SolNode741": "GrineerFortressTileset",
|
||||||
|
"SolNode742": "GrineerFortressTileset",
|
||||||
|
"SolNode743": "GrineerFortressTileset",
|
||||||
|
"SolNode744": "GrineerFortressTileset",
|
||||||
|
"SolNode745": "GrineerFortressTileset",
|
||||||
|
"SolNode746": "GrineerFortressTileset",
|
||||||
|
"SolNode747": "GrineerFortressTileset",
|
||||||
|
"SolNode748": "GrineerFortressTileset",
|
||||||
|
"SolNode75": "GrineerForestTileset",
|
||||||
|
"SolNode76": "CorpusShipTileset",
|
||||||
|
"SolNode78": "CorpusShipTileset",
|
||||||
|
"SolNode79": "GrineerForestTileset",
|
||||||
|
"SolNode81": "CorpusShipTileset",
|
||||||
|
"SolNode82": "GrineerGalleonTileset",
|
||||||
|
"SolNode84": "CorpusIcePlanetTilesetCaves",
|
||||||
|
"SolNode88": "CorpusShipTileset",
|
||||||
|
"SolNode93": "GrineerAsteroidTileset",
|
||||||
|
"SolNode96": "GrineerGalleonTileset",
|
||||||
|
"SolNode97": "CorpusGasCityTileset",
|
||||||
|
"SolNode99": "GrineerSettlementTileset"
|
||||||
|
}
|
@ -13,6 +13,7 @@ function doLogin() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function loginFromLocalStorage() {
|
function loginFromLocalStorage() {
|
||||||
|
const isRegister = registerSubmit;
|
||||||
doLoginRequest(
|
doLoginRequest(
|
||||||
data => {
|
data => {
|
||||||
if (single.getCurrentPath() == "/webui/") {
|
if (single.getCurrentPath() == "/webui/") {
|
||||||
@ -28,7 +29,7 @@ function loginFromLocalStorage() {
|
|||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
logout();
|
logout();
|
||||||
alert("Login failed");
|
alert(isRegister ? "Registration failed. Account already exists?" : "Login failed");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -44,7 +45,7 @@ function doLoginRequest(succ_cb, fail_cb) {
|
|||||||
s: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==", // signature of some kind
|
s: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==", // signature of some kind
|
||||||
lang: "en",
|
lang: "en",
|
||||||
date: 1501230947855458660, // ???
|
date: 1501230947855458660, // ???
|
||||||
ClientType: registerSubmit ? "" : "webui",
|
ClientType: registerSubmit ? "webui-register" : "webui",
|
||||||
PS: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==" // anti-cheat data
|
PS: "W0RFXVN0ZXZlIGxpa2VzIGJpZyBidXR0cw==" // anti-cheat data
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user