返回提交历史
Modified
src/controllers/api/artifactsController.ts
+5
-1
Modified
src/services/inventoryService.ts
+5
-1
Modified
static/webui/script.js
+6
-3
XFEstudio/SpaceNinjaServer
fix(webui): adding Fusion Core's and single rank mods with add maxed button (#3098)
Fixes some broken behavior with the add maxed button in the WebUI with Fusion Core's and Legendary Core's/single rank mods. Fusion Core's weren't actually being added as max rank when using the add maxed button, and Legendary Core's/single rank mods would incorrectly be added as an Upgrade when they should only ever be RawUpgrade's. Also fixes the button to upgrade a mod to max being broken if you had previously logged into the game on a pre-U18.18 build. Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/3098 Reviewed-by: Sainan <63328889+sainan@users.noreply.github.com> Co-authored-by: VoltPrime <subsonicjackal@gmail.com> Co-committed-by: VoltPrime <subsonicjackal@gmail.com>
43d54b7b
代码差异
3 个文件
+16
-5
@@ -21,7 +21,11 @@ export const artifactsController: RequestHandler = async (req, res) => {
21
21
const { Upgrades } = inventory;
22
22
const { ItemType, UpgradeFingerprint, ItemId } = Upgrade;
23
23
24
if (!account.BuildLabel || version_compare(account.BuildLabel, "2016.08.19.17.12") >= 0) {
24
if (
25
"ignoreBuildLabel" in req.query ||
26
!account.BuildLabel ||
27
version_compare(account.BuildLabel, "2016.08.19.17.12") >= 0
28
) {
25
29
const safeUpgradeFingerprint = UpgradeFingerprint || '{"lvl":0}';
26
30
const parsedUpgradeFingerprint = JSON.parse(safeUpgradeFingerprint) as { lvl: number };
27
31
parsedUpgradeFingerprint.lvl += LevelDiff;
@@ -502,7 +502,11 @@ export const addItem = async (
502
502
if (typeName in ExportFlavour) {
503
503
return addCustomization(inventory, typeName);
504
504
}
505
if (typeName in ExportUpgrades || typeName in ExportArcanes) {
505
if (
506
typeName in ExportUpgrades ||
507
typeName in ExportArcanes ||
508
typeName.startsWith("/Lotus/Upgrades/Mods/Fusers/")
509
) {
506
510
if (targetFingerprint && typeName.startsWith("/Lotus/Upgrades/Mods/Randomized/Raw")) {
507
511
logger.debug(`ignoring fingerprint for raw riven mod`);
508
512
} else if (targetFingerprint) {
@@ -3053,7 +3053,7 @@ function doAcquireRiven() {
3053
3053
if (rawUpgrade.ItemType === uniqueName) {
3054
3054
// Add fingerprint to riven
3055
3055
$.post({
3056
url: "/api/artifacts.php?" + window.authz,
3056
url: "/api/artifacts.php?" + window.authz + "&ignoreBuildLabel=1",
3057
3057
contentType: "text/plain",
3058
3058
data: JSON.stringify({
3059
3059
Upgrade: {
@@ -3084,7 +3084,7 @@ $("#addriven-fingerprint").on("input", () => {
3084
3084
function setFingerprint(ItemType, ItemId, fingerprint) {
3085
3085
revalidateAuthz().then(() => {
3086
3086
$.post({
3087
url: "/api/artifacts.php?" + window.authz,
3087
url: "/api/artifacts.php?" + window.authz + "&ignoreBuildLabel=1",
3088
3088
contentType: "text/plain",
3089
3089
data: JSON.stringify({
3090
3090
Upgrade: {
@@ -3120,7 +3120,10 @@ function doAcquireMod() {
3120
3120
{
3121
3121
ItemType: uniqueName,
3122
3122
ItemCount: count,
3123
Fingerprint: maxed ? JSON.stringify({ lvl: itemList[uniqueName].fusionLimit ?? 5 }) : undefined
3123
Fingerprint:
3124
maxed && (itemList[uniqueName].fusionLimit ?? 5) > 0
3125
? JSON.stringify({ lvl: itemList[uniqueName].fusionLimit ?? 5 })
3126
: undefined
3124
3127
}
3125
3128
])
3126
3129
}).done(function () {