feat: mods in pre-U18.18 builds + equipment features in pre-U24.4 builds #3040
Reference in New Issue
Block a user
Delete Branch "VoltPrime/SpaceNinjaServer:mods-equipmentfeatures-legacy"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.
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.
@@ -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;Can be simplified to
upgrade.ItemCount ?? 1@@ -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") {Typings-wise, this condition seems redundant, unless you mean that the
$idhere could be an empty string? In that case please do an explicit!= "".@@ -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) {This should be the default case so
!account.BuildLabel || ...@@ -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));fromOid@@ -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))) {Upgrades.idshould be more efficient thanfind@@ -484,0 +488,4 @@}if (!clientUpgrade.ItemCount) {// U11 and below also don't initialize ItemCount since RawUpgrade doesn't exist in themclientUpgrade.ItemCount = 1;No need for conditionals here, just
??=(UpgradeFingerprint & ItemCount)@@ -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) {Can merge these ifs using
&&