improve: don't fake XPInfo if we don't have to (#303)
This commit is contained in:
parent
8f8d58ade6
commit
c9b570059e
@ -78,14 +78,12 @@ const inventoryController: RequestHandler = async (request: Request, response: R
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (typeof config.spoofMasteryRank === "number" && config.spoofMasteryRank >= 0) {
|
||||||
typeof config.spoofMasteryRank === "number" &&
|
|
||||||
config.spoofMasteryRank >= 0 &&
|
|
||||||
config.spoofMasteryRank <= 5030
|
|
||||||
) {
|
|
||||||
inventoryResponse.PlayerLevel = config.spoofMasteryRank;
|
inventoryResponse.PlayerLevel = config.spoofMasteryRank;
|
||||||
|
if (!("xpBasedLevelCapDisabled" in request.query)) {
|
||||||
|
// This client has not been patched to accept any mastery rank, need to fake the XP.
|
||||||
inventoryResponse.XPInfo = [];
|
inventoryResponse.XPInfo = [];
|
||||||
let numFrames = getExpRequiredForMr(config.spoofMasteryRank) / 6000;
|
let numFrames = getExpRequiredForMr(Math.min(config.spoofMasteryRank, 5030)) / 6000;
|
||||||
while (numFrames-- > 0) {
|
while (numFrames-- > 0) {
|
||||||
inventoryResponse.XPInfo.push({
|
inventoryResponse.XPInfo.push({
|
||||||
ItemType: "/Lotus/Powersuits/Mag/Mag",
|
ItemType: "/Lotus/Powersuits/Mag/Mag",
|
||||||
@ -93,6 +91,7 @@ const inventoryController: RequestHandler = async (request: Request, response: R
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
response.json(inventoryResponse);
|
response.json(inventoryResponse);
|
||||||
};
|
};
|
||||||
|
@ -123,7 +123,7 @@ window.itemListPromise = new Promise(resolve => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
function updateInventory() {
|
function updateInventory() {
|
||||||
const req = $.get("/api/inventory.php?" + window.authz);
|
const req = $.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1");
|
||||||
req.done(data => {
|
req.done(data => {
|
||||||
window.itemListPromise.then(itemMap => {
|
window.itemListPromise.then(itemMap => {
|
||||||
document.getElementById("warframe-list").innerHTML = "";
|
document.getElementById("warframe-list").innerHTML = "";
|
||||||
@ -539,7 +539,7 @@ function doAcquireRiven() {
|
|||||||
})
|
})
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
// Get riven's assigned id
|
// Get riven's assigned id
|
||||||
$.get("/api/inventory.php?" + window.authz).done(data => {
|
$.get("/api/inventory.php?" + window.authz + "&xpBasedLevelCapDisabled=1").done(data => {
|
||||||
for (const rawUpgrade of data.RawUpgrades) {
|
for (const rawUpgrade of data.RawUpgrades) {
|
||||||
if (rawUpgrade.ItemType === uniqueName) {
|
if (rawUpgrade.ItemType === uniqueName) {
|
||||||
// Add fingerprint to riven
|
// Add fingerprint to riven
|
||||||
|
Loading…
x
Reference in New Issue
Block a user