feat: mods in pre-U18.18 builds + equipment features in pre-U24.4 builds #3040

Merged
Sainan merged 10 commits from VoltPrime/SpaceNinjaServer:mods-equipmentfeatures-legacy into main 2025-11-18 00:27:12 -08:00
Contributor

This implements support for mods in pre-U18.18 (The Silver Grove) builds, as well as support for Orokin Catalysts/Reactors, Forma, Exilus Adapters, and gilding modular weapons in pre-U24.4 builds. And should also fix #3036.

  • Pre-Endo fusion system (consuming Fusion Cores and other mods to rank up the target), handles ranked Fusion Core mission drops.
  • Attaching/detaching mods in U7-U8.
  • Transmutation works but the game crashes if it rolls a mod that doesn't exist in that build.
  • Riven mods work in U19 builds when added through the WebUI, but I can't get veiled Rivens to appear in the inventory in old builds yet (they probably changed the item paths when they made them stackable) to test if activating/unveiling them works, but rerolling them works.

This is a decently large PR that should be tested for regressions before merging, I have done a lot of thorough testing myself as I've worked on it, but I may have missed an edge-case somewhere.
And if there is anything I can improve code-wise in all these changes please reach out.

This implements support for mods in pre-U18.18 (The Silver Grove) builds, as well as support for Orokin Catalysts/Reactors, Forma, Exilus Adapters, and gilding modular weapons in pre-U24.4 builds. And should also fix #3036. - Pre-Endo fusion system (consuming Fusion Cores and other mods to rank up the target), handles ranked Fusion Core mission drops. - Attaching/detaching mods in U7-U8. - Transmutation works but the game crashes if it rolls a mod that doesn't exist in that build. - Riven mods work in U19 builds when added through the WebUI, but I can't get veiled Rivens to appear in the inventory in old builds yet (they probably changed the item paths when they made them stackable) to test if activating/unveiling them works, but rerolling them works. This is a decently large PR that should be tested for regressions before merging, I have done a lot of thorough testing myself as I've worked on it, but I may have missed an edge-case somewhere. And if there is anything I can improve code-wise in all these changes please reach out.
VoltPrime added 2 commits 2025-11-17 01:40:40 -08:00
VoltPrime added 1 commit 2025-11-17 01:44:55 -08:00
Resolve errors
All checks were successful
Build / build (pull_request) Successful in 5m13s
87163d0a21
VoltPrime added 1 commit 2025-11-17 02:15:24 -08:00
Tiny cleanup
All checks were successful
Build / build (pull_request) Successful in 2m5s
eb552777fb
Sainan requested changes 2025-11-17 02:26:44 -08:00
Dismissed
@@ -59,3 +62,2 @@
const meta = ExportUpgrades[upgrade.ItemType];
counts[meta.rarity] += upgrade.ItemCount;
if (fromOid(upgrade.ItemId) != "000000000000000000000000") {
counts[meta.rarity] += upgrade.ItemCount ? upgrade.ItemCount : 1;
Owner

Can be simplified to upgrade.ItemCount ?? 1

Can be simplified to `upgrade.ItemCount ?? 1`
Sainan marked this conversation as resolved
@@ -60,2 +63,2 @@
counts[meta.rarity] += upgrade.ItemCount;
if (fromOid(upgrade.ItemId) != "000000000000000000000000") {
counts[meta.rarity] += upgrade.ItemCount ? upgrade.ItemCount : 1;
if (fromOid(upgrade.ItemId) && fromOid(upgrade.ItemId) != "000000000000000000000000") {
Owner

Typings-wise, this condition seems redundant, unless you mean that the $id here could be an empty string? In that case please do an explicit != "".

Typings-wise, this condition seems redundant, unless you mean that the `$id` here could be an empty string? In that case please do an explicit `!= ""`.
Sainan marked this conversation as resolved
@@ -19,3 +24,1 @@
const parsedUpgradeFingerprint = JSON.parse(safeUpgradeFingerprint) as { lvl: number };
parsedUpgradeFingerprint.lvl += LevelDiff;
const stringifiedUpgradeFingerprint = JSON.stringify(parsedUpgradeFingerprint);
if (account.BuildLabel && version_compare(account.BuildLabel, "2016.08.19.17.12") >= 0) {
Owner

This should be the default case so !account.BuildLabel || ...

This should be the default case so `!account.BuildLabel || ...`
Sainan marked this conversation as resolved
@@ -22,2 +31,3 @@
const stringifiedUpgradeFingerprint = JSON.stringify(parsedUpgradeFingerprint);
let itemIndex = Upgrades.findIndex(upgrade => upgrade._id.equals(ItemId.$oid));
let itemIndex = Upgrades.findIndex(upgrade => upgrade._id.equals(ItemId.$oid ?? ItemId.$id));
Owner

fromOid

`fromOid`
Sainan marked this conversation as resolved
@@ -49,0 +104,4 @@
if (Consumed && Consumed.length > 0) {
for (const upgrade of Consumed) {
// The client does not send the expected information about the mods, so we have to check if it's an Upgrade or RawUpgrade manually.
if (Upgrades.find(u => u._id.equals(upgrade.ItemId.$id))) {
Owner

Upgrades.id should be more efficient than find

`Upgrades.id` should be more efficient than `find`
Sainan marked this conversation as resolved
@@ -484,0 +488,4 @@
}
if (!clientUpgrade.ItemCount) {
// U11 and below also don't initialize ItemCount since RawUpgrade doesn't exist in them
clientUpgrade.ItemCount = 1;
Owner

No need for conditionals here, just ??= (UpgradeFingerprint & ItemCount)

No need for conditionals here, just `??=` (UpgradeFingerprint & ItemCount)
Sainan marked this conversation as resolved
@@ -199,1 +201,3 @@
inventoryItem.Configs[parseInt(configId)] = config as IItemConfig;
const c = config as IItemConfig;
if (buildLabel) {
if (version_compare(buildLabel, "2014.04.10.17.47") < 0) {
Owner

Can merge these ifs using &&

Can merge these ifs using `&&`
Sainan marked this conversation as resolved
Sainan added 1 commit 2025-11-17 02:40:52 -08:00
add IItemConfigDatabase
All checks were successful
Build / build (pull_request) Successful in 1m11s
39b19faaf7
VoltPrime added 1 commit 2025-11-17 03:06:01 -08:00
More cleanup
All checks were successful
Build / build (pull_request) Successful in 2m35s
470c3b38c0
Sainan approved these changes 2025-11-17 03:23:15 -08:00
VoltPrime added 1 commit 2025-11-17 03:55:36 -08:00
Fix mod configs not saving in U10-U11
All checks were successful
Build / build (pull_request) Successful in 1m13s
1ca5ca27c6
VoltPrime added 1 commit 2025-11-17 04:12:20 -08:00
Ensure unique ID for attached upgrades in U7-U8
Some checks failed
Build / build (pull_request) Failing after 27s
d970ce9574
VoltPrime added 1 commit 2025-11-17 04:16:22 -08:00
Addendum because I am sleep-deprived
Some checks failed
Build / build (pull_request) Failing after 24s
75673cc715
VoltPrime added 1 commit 2025-11-17 04:17:29 -08:00
I should really go to sleep now
All checks were successful
Build / build (pull_request) Successful in 1m17s
7817bd823c
Sainan merged commit 78373c134c into main 2025-11-18 00:27:12 -08:00
Sainan deleted branch mods-equipmentfeatures-legacy 2025-11-18 00:27:18 -08:00
Sign in to join this conversation.