From d9b25a49e1e51702782b6c01a4f5c74f96f36a73 Mon Sep 17 00:00:00 2001 From: PRO100KatYT <67335438+PRO100KatYT@users.noreply.github.com> Date: Sat, 3 Dec 2022 17:26:58 +0100 Subject: [PATCH] Added SetItemArchivedStatusBatch --- structure/mcp.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/structure/mcp.js b/structure/mcp.js index 553fa9c..79f5451 100644 --- a/structure/mcp.js +++ b/structure/mcp.js @@ -6292,6 +6292,57 @@ express.post("/fortnite/api/game/v2/profile/*/client/PurchaseCatalogEntry", asyn res.end(); }); +// Archive locker items +express.post("/fortnite/api/game/v2/profile/*/client/SetItemArchivedStatusBatch", async (req, res) => { + const profile = require(`./../profiles/${req.query.profileId || "athena"}.json`); + + // do not change any of these or you will end up breaking it + var ApplyProfileChanges = []; + var BaseRevision = profile.rvn || 0; + var QueryRevision = req.query.rvn || -1; + var StatChanged = false; + + if (req.body.itemIds) { + for (var i in req.body.itemIds) { + profile.items[req.body.itemIds[i]].attributes.archived = req.body.archived || false; + + ApplyProfileChanges.push({ + "changeType": "itemAttrChanged", + "itemId": req.body.itemIds[i], + "attributeName": "archived", + "attributeValue": profile.items[req.body.itemIds[i]].attributes.archived + }) + } + StatChanged = true; + } + + if (StatChanged == true) { + profile.rvn += 1; + profile.commandRevision += 1; + + fs.writeFileSync(`./profiles/${req.query.profileId || "athena"}.json`, JSON.stringify(profile, null, 2)); + } + + // this doesn't work properly on version v12.20 and above but whatever + if (QueryRevision != BaseRevision) { + ApplyProfileChanges = [{ + "changeType": "fullProfileUpdate", + "profile": profile + }]; + } + + res.json({ + "profileRevision": profile.rvn || 0, + "profileId": req.query.profileId || "athena", + "profileChangesBaseRevision": BaseRevision, + "profileChanges": ApplyProfileChanges, + "profileCommandRevision": profile.commandRevision || 0, + "serverTime": new Date().toISOString(), + "responseVersion": 1 + }) + res.end(); +}); + // Set multiple items favorite express.post("/fortnite/api/game/v2/profile/*/client/SetItemFavoriteStatusBatch", async (req, res) => { const profile = require(`./../profiles/${req.query.profileId || "athena"}.json`);