MCP Revamp! Fix 2

This commit is contained in:
Lawin0129
2021-10-23 03:38:31 +01:00
committed by GitHub
parent 62a4939e12
commit 719315c50f

View File

@@ -1363,17 +1363,17 @@ express.post("/account/api/oauth/token", async (req, res) => {
var QueryRevision = req.query.rvn || -1; var QueryRevision = req.query.rvn || -1;
var StatChanged = false; var StatChanged = false;
if (req.body.slotIndex && req.body.loadoutId) if (req.body.loadoutId)
{ {
switch(req.body.slotIndex) { switch(req.body.slotIndex) {
case 0: case 0:
profile.items[req.body.loadoutId].attributes.gadgets = [{"gadget":req.body.gadgetId || "","slot_index":0},profile.items[req.body.loadoutId].attributes.gadgets[1]]; profile.items[req.body.loadoutId].attributes.gadgets[req.body.slotIndex].gadget = req.body.gadgetId || "";
StatChanged = true; StatChanged = true;
break; break;
case 1: case 1:
profile.items[req.body.loadoutId].attributes.gadgets = [profile.items[req.body.loadoutId].attributes.gadgets[0],{"gadget":req.body.gadgetId || "","slot_index":1}]; profile.items[req.body.loadoutId].attributes.gadgets[req.body.slotIndex].gadget = req.body.gadgetId || "";
StatChanged = true; StatChanged = true;
break; break;
@@ -1880,19 +1880,21 @@ express.post("/account/api/oauth/token", async (req, res) => {
{ {
profile.rvn += 1; profile.rvn += 1;
profile.commandRevision += 1; profile.commandRevision += 1;
ApplyProfileChanges.push({ ApplyProfileChanges.push({
"changeType": "statModified", "changeType": "itemAttrChanged",
"name": "banner_icon", "itemId": req.body.lockerItem,
"value": profile.stats.attributes.banner_icon "attributeName": "banner_icon_template",
"attributeValue": profile.items[req.body.lockerItem].attributes.banner_icon_template
}) })
ApplyProfileChanges.push({ ApplyProfileChanges.push({
"changeType": "statModified", "changeType": "itemAttrChanged",
"name": "banner_color", "itemId": req.body.lockerItem,
"value": profile.stats.attributes.banner_color "attributeName": "banner_color_template",
"attributeValue": profile.items[req.body.lockerItem].attributes.banner_color_template
}) })
fs.writeFileSync(`./profiles/${req.query.profileId || "athena"}.json`, JSON.stringify(profile, null, 2), function(err) { fs.writeFileSync(`./profiles/${req.query.profileId || "athena"}.json`, JSON.stringify(profile, null, 2), function(err) {
if (err) if (err)
{ {