返回提交历史
Modified
src/controllers/api/inventoryController.ts
+11
-12
Modified
static/webui/script.js
+2
-2
XFEstudio/SpaceNinjaServer
improve: don't fake XPInfo if we don't have to (#303)
c9b57005
代码差异
2 个文件
+13
-14
@@ -78,19 +78,18 @@ const inventoryController: RequestHandler = async (request: Request, response: R
78
78
}
79
79
}
80
80
81
if (
82
typeof config.spoofMasteryRank === "number" &&
83
config.spoofMasteryRank >= 0 &&
84
config.spoofMasteryRank <= 5030
85
) {
81
if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
86
82
inventoryResponse.PlayerLevel = config.spoofMasteryRank;
87
inventoryResponse.XPInfo = [];
88
let numFrames = getExpRequiredForMr(config.spoofMasteryRank) / 6000;
89
while (numFrames-- > 0) {
90
inventoryResponse.XPInfo.push({
91
ItemType: "/Lotus/Powersuits/Mag/Mag",
92
XP: 1_600_000
93
});
83
if (!("xpBasedLevelCapDisabled" in request.query)) {
84
// This client has not been patched to accept any mastery rank, need to fake the XP.
85
inventoryResponse.XPInfo = [];
86
let numFrames = getExpRequiredForMr(Math.min(config.spoofMasteryRank, 5030)) / 6000;
87
while (numFrames-- > 0) {
88
inventoryResponse.XPInfo.push({
89
ItemType: "/Lotus/Powersuits/Mag/Mag",
90
XP: 1_600_000
91
});
92
}
94
93
}
95
94
}
96
95
@@ -123,7 +123,7 @@ window.itemListPromise = new Promise(resolve => {
123
123
});
124
124
125
125
function updateInventory() {
126
const req = $.get("/api/inventory.php?" + window.authz);
126
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
127
127
req.done(data => {
128
128
window.itemListPromise.then(itemMap => {
129
129
document.getElementById("warframe-list").innerHTML = "";
@@ -539,7 +539,7 @@ function doAcquireRiven() {
539
539
})
540
540
}).done(function () {
541
541
// Get riven's assigned id
542
$.get("/api/inventory.php?" + window.authz).done(data => {
542
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(data => {
543
543
for (const rawUpgrade of data.RawUpgrades) {
544
544
if (rawUpgrade.ItemType === uniqueName) {
545
545
// Add fingerprint to riven