From 66dae6d3f867ae736014356cec619b4261573464 Mon Sep 17 00:00:00 2001 From: hxedcl Date: Wed, 16 Apr 2025 09:28:40 -0700 Subject: [PATCH 1/5] chore(webui): update Spanish translation (#1681) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1681 Co-authored-by: hxedcl Co-committed-by: hxedcl --- static/webui/translations/es.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/webui/translations/es.js b/static/webui/translations/es.js index e2ea40ec..c979bddc 100644 --- a/static/webui/translations/es.js +++ b/static/webui/translations/es.js @@ -134,7 +134,7 @@ dict = { cheats_unlockExilusEverywhere: `Adaptadores Exilus en todas partes`, cheats_unlockArcanesEverywhere: `Adaptadores de Arcanos en todas partes`, cheats_noDailyStandingLimits: `Sin límite diario de reputación`, - cheats_noDailyFocusLimit: `[UNTRANSLATED] No Daily Focus Limits`, + cheats_noDailyFocusLimit: `Límites diarios de enfoque desactivados`, cheats_noArgonCrystalDecay: `Sin descomposición de cristal de Argón`, cheats_noMasteryRankUpCooldown: `Sin tiempo de espera para rango de maestría`, cheats_noVendorPurchaseLimits: `Sin límite de compras de vendedores`, From 850a07359423d8ce5454c31c13fb088b3fda7b9c Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:37:40 -0700 Subject: [PATCH 2/5] fix: don't set IsNew on CrewShipWeapons (#1682) this indicator doesn't fully work for them as it seems the client doesn't clear it, so I assume they're not supposed to have it Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1682 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/services/inventoryService.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index d3e86bfd..391f40ae 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -1066,7 +1066,7 @@ export const addEquipment = ( Configs: [], XP: 0, ModularParts: modularParts, - IsNew: true + IsNew: category != "CrewShipWeapons" ? true : undefined }, defaultOverwrites ); From 16e850e7eeac52d450b14147dad09d13b6a3a613 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:38:27 -0700 Subject: [PATCH 3/5] fix: provide a SubroutineIndex when identifying applicable components (#1683) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1683 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- .../api/crewShipIdentifySalvageController.ts | 19 +++++++++++++------ src/types/inventoryTypes/inventoryTypes.ts | 4 ++++ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/controllers/api/crewShipIdentifySalvageController.ts b/src/controllers/api/crewShipIdentifySalvageController.ts index c40f78c5..d9d09b75 100644 --- a/src/controllers/api/crewShipIdentifySalvageController.ts +++ b/src/controllers/api/crewShipIdentifySalvageController.ts @@ -1,25 +1,32 @@ import { addCrewShipSalvagedWeaponSkin, addCrewShipRawSalvage, getInventory } from "@/src/services/inventoryService"; import { getAccountIdForRequest } from "@/src/services/loginService"; import { RequestHandler } from "express"; -import { IInnateDamageFingerprint } from "@/src/types/inventoryTypes/inventoryTypes"; +import { ICrewShipComponentFingerprint } from "@/src/types/inventoryTypes/inventoryTypes"; import { ExportCustoms } from "warframe-public-export-plus"; -import { IFingerprintStat } from "@/src/helpers/rivenHelper"; import { getJSONfromString } from "@/src/helpers/stringHelpers"; import { IInventoryChanges } from "@/src/types/purchaseTypes"; +import { getRandomInt } from "@/src/services/rngService"; export const crewShipIdentifySalvageController: RequestHandler = async (req, res) => { const accountId = await getAccountIdForRequest(req); const inventory = await getInventory(accountId, "CrewShipSalvagedWeaponSkins CrewShipRawSalvage"); const payload = getJSONfromString(String(req.body)); - const buffs: IFingerprintStat[] = []; - for (const upgrade of ExportCustoms[payload.ItemType].randomisedUpgrades!) { - buffs.push({ Tag: upgrade.tag, Value: Math.trunc(Math.random() * 0x40000000) }); + const meta = ExportCustoms[payload.ItemType]; + let upgradeFingerprint: ICrewShipComponentFingerprint = { compat: payload.ItemType, buffs: [] }; + if (meta.subroutines) { + upgradeFingerprint = { + SubroutineIndex: getRandomInt(0, meta.subroutines.length - 1), + ...upgradeFingerprint + }; + } + for (const upgrade of meta.randomisedUpgrades!) { + upgradeFingerprint.buffs.push({ Tag: upgrade.tag, Value: Math.trunc(Math.random() * 0x40000000) }); } const inventoryChanges: IInventoryChanges = addCrewShipSalvagedWeaponSkin( inventory, payload.ItemType, - JSON.stringify({ compat: payload.ItemType, buffs } satisfies IInnateDamageFingerprint) + JSON.stringify(upgradeFingerprint) ); inventoryChanges.CrewShipRawSalvage = [ diff --git a/src/types/inventoryTypes/inventoryTypes.ts b/src/types/inventoryTypes/inventoryTypes.ts index 73156437..d6e2ab34 100644 --- a/src/types/inventoryTypes/inventoryTypes.ts +++ b/src/types/inventoryTypes/inventoryTypes.ts @@ -907,6 +907,10 @@ export interface IInnateDamageFingerprint { buffs: IFingerprintStat[]; } +export interface ICrewShipComponentFingerprint extends IInnateDamageFingerprint { + SubroutineIndex?: number; +} + export enum GettingSlotOrderInfo { Empty = "", LotusUpgradesModsRandomizedPlayerMeleeWeaponRandomModRare0 = "/Lotus/Upgrades/Mods/Randomized/PlayerMeleeWeaponRandomModRare:0", From ed217bae3358b612ae04fb670393ee59c13bb402 Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:38:53 -0700 Subject: [PATCH 4/5] feat: cancel personal tech project (#1679) Closes #1665 Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1679 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- src/controllers/api/guildTechController.ts | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/controllers/api/guildTechController.ts b/src/controllers/api/guildTechController.ts index 257434fb..57370d75 100644 --- a/src/controllers/api/guildTechController.ts +++ b/src/controllers/api/guildTechController.ts @@ -28,7 +28,7 @@ import { IInventoryChanges } from "@/src/types/purchaseTypes"; import { config } from "@/src/services/configService"; import { GuildPermission, ITechProjectClient } from "@/src/types/guildTypes"; import { GuildMember } from "@/src/models/guildModel"; -import { toMongoDate } from "@/src/helpers/inventoryHelpers"; +import { toMongoDate, toOid } from "@/src/helpers/inventoryHelpers"; import { logger } from "@/src/utils/logger"; import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel"; @@ -305,6 +305,38 @@ export const guildTechController: RequestHandler = async (req, res) => { guild.ActiveDojoColorResearch = data.RecipeType; await guild.save(); res.end(); + } else if (data.Action == "Cancel" && data.CategoryItemId) { + const personalTechProjectIndex = inventory.PersonalTechProjects.findIndex(x => + x.CategoryItemId?.equals(data.CategoryItemId) + ); + const personalTechProject = inventory.PersonalTechProjects[personalTechProjectIndex]; + inventory.PersonalTechProjects.splice(personalTechProjectIndex, 1); + + const meta = ExportDojoRecipes.research[personalTechProject.ItemType]; + const contributedCredits = meta.price - personalTechProject.ReqCredits; + const inventoryChanges = updateCurrency(inventory, contributedCredits * -1, false); + inventoryChanges.MiscItems = []; + for (const ingredient of meta.ingredients) { + const reqItem = personalTechProject.ReqItems.find(x => x.ItemType == ingredient.ItemType); + if (reqItem) { + const contributedItems = ingredient.ItemCount - reqItem.ItemCount; + inventoryChanges.MiscItems.push({ + ItemType: ingredient.ItemType, + ItemCount: contributedItems + }); + } + } + addMiscItems(inventory, inventoryChanges.MiscItems); + + await inventory.save(); + res.json({ + action: "Cancel", + isPersonal: true, + inventoryChanges: inventoryChanges, + personalTech: { + ItemId: toOid(personalTechProject._id) + } + }); } else if (data.Action == "Rush" && data.CategoryItemId) { const inventoryChanges: IInventoryChanges = { ...updateCurrency(inventory, 20, true), From 9940024a0130f6eebe24d76f03c066a8eac74d8d Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Wed, 16 Apr 2025 10:39:01 -0700 Subject: [PATCH 5/5] fix: put acquired house version railjack armaments into raw salvage (#1685) Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/1685 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com> --- package-lock.json | 8 ++++---- package.json | 2 +- src/services/inventoryService.ts | 25 +++++++++++++++++++++---- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index e84d1c57..081c89a6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "morgan": "^1.10.0", "ncp": "^2.0.0", "typescript": "^5.5", - "warframe-public-export-plus": "^0.5.55", + "warframe-public-export-plus": "^0.5.56", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" @@ -3789,9 +3789,9 @@ } }, "node_modules/warframe-public-export-plus": { - "version": "0.5.55", - "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.55.tgz", - "integrity": "sha512-Gnd4FCBVuxm2xWGfu8xxxqPIPSnnTqiEWlpP3rsFpVlQs09RNFnW2PEX9rCZt0f3SvHBv5ssDDrFlzgBHS1yrA==" + "version": "0.5.56", + "resolved": "https://registry.npmjs.org/warframe-public-export-plus/-/warframe-public-export-plus-0.5.56.tgz", + "integrity": "sha512-px+J7tUm6fkSzwKkvL73ySQReDq9oM1UrHSLM3vbYGBvELM892iBgPYG45okIhScCSdwmmXTiWZTf4x/I4qiNQ==" }, "node_modules/warframe-riven-info": { "version": "0.1.2", diff --git a/package.json b/package.json index 58b231d3..afcbe580 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "morgan": "^1.10.0", "ncp": "^2.0.0", "typescript": "^5.5", - "warframe-public-export-plus": "^0.5.55", + "warframe-public-export-plus": "^0.5.56", "warframe-riven-info": "^0.1.2", "winston": "^3.17.0", "winston-daily-rotate-file": "^5.0.0" diff --git a/src/services/inventoryService.ts b/src/services/inventoryService.ts index 391f40ae..71dfa9d1 100644 --- a/src/services/inventoryService.ts +++ b/src/services/inventoryService.ts @@ -539,10 +539,27 @@ export const addItem = async ( } } if (typeName in ExportRailjackWeapons) { - return { - ...addEquipment(inventory, ExportRailjackWeapons[typeName].productCategory, typeName), - ...occupySlot(inventory, InventorySlot.RJ_COMPONENT_AND_ARMAMENTS, premiumPurchase) - }; + const meta = ExportRailjackWeapons[typeName]; + if (meta.defaultUpgrades?.length) { + // House versions need to be identified to get stats so put them into raw salvage first. + const rawSalvageChanges = [ + { + ItemType: typeName, + ItemCount: quantity + } + ]; + addCrewShipRawSalvage(inventory, rawSalvageChanges); + return { CrewShipRawSalvage: rawSalvageChanges }; + } else { + // Sigma versions can be added directly. + if (quantity != 1) { + throw new Error(`unexpected acquisition quantity of CrewShipWeapon: got ${quantity}, expected 1`); + } + return { + ...addEquipment(inventory, meta.productCategory, typeName), + ...occupySlot(inventory, InventorySlot.RJ_COMPONENT_AND_ARMAMENTS, premiumPurchase) + }; + } } if (typeName in ExportMisc.creditBundles) { const creditsTotal = ExportMisc.creditBundles[typeName] * quantity;