mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 02:42:22 +01:00
Some edit style fixes and shorten some locker code
This commit is contained in:
12195
profiles/athena.json
12195
profiles/athena.json
File diff suppressed because it is too large
Load Diff
131
structure/mcp.js
131
structure/mcp.js
@@ -4874,7 +4874,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/AbandonExpedition", async (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the expedition back as availale
|
// Set the expedition back as available
|
||||||
delete profile.items[req.body.expeditionId].attributes.expedition_squad_id
|
delete profile.items[req.body.expeditionId].attributes.expedition_squad_id
|
||||||
delete profile.items[req.body.expeditionId].attributes.expedition_start_time
|
delete profile.items[req.body.expeditionId].attributes.expedition_start_time
|
||||||
delete profile.items[req.body.expeditionId].attributes.expedition_end_time
|
delete profile.items[req.body.expeditionId].attributes.expedition_end_time
|
||||||
@@ -7616,39 +7616,14 @@ express.post("/fortnite/api/game/v2/profile/*/client/EquipBattleRoyaleCustomizat
|
|||||||
if (req.body.slotName) {
|
if (req.body.slotName) {
|
||||||
|
|
||||||
switch (req.body.slotName) {
|
switch (req.body.slotName) {
|
||||||
|
|
||||||
case "Character":
|
case "Character":
|
||||||
profile.stats.attributes.favorite_character = req.body.itemToSlot || "";
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Backpack":
|
case "Backpack":
|
||||||
profile.stats.attributes.favorite_backpack = req.body.itemToSlot || "";
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Pickaxe":
|
case "Pickaxe":
|
||||||
profile.stats.attributes.favorite_pickaxe = req.body.itemToSlot || "";
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Glider":
|
case "Glider":
|
||||||
profile.stats.attributes.favorite_glider = req.body.itemToSlot || "";
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "SkyDiveContrail":
|
case "SkyDiveContrail":
|
||||||
profile.stats.attributes.favorite_skydivecontrail = req.body.itemToSlot || "";
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "MusicPack":
|
case "MusicPack":
|
||||||
profile.stats.attributes.favorite_musicpack = req.body.itemToSlot || "";
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "LoadingScreen":
|
case "LoadingScreen":
|
||||||
profile.stats.attributes.favorite_loadingscreen = req.body.itemToSlot || "";
|
profile.stats.attributes[`favorite_${req.body.slotName.toLowerCase()}`] = req.body.itemToSlot || "";
|
||||||
StatChanged = true;
|
StatChanged = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -7668,9 +7643,6 @@ express.post("/fortnite/api/game/v2/profile/*/client/EquipBattleRoyaleCustomizat
|
|||||||
switch (Math.sign(indexwithinslot)) {
|
switch (Math.sign(indexwithinslot)) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
profile.stats.attributes.favorite_itemwraps[indexwithinslot] = req.body.itemToSlot || "";
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
profile.stats.attributes.favorite_itemwraps[indexwithinslot] = req.body.itemToSlot || "";
|
profile.stats.attributes.favorite_itemwraps[indexwithinslot] = req.body.itemToSlot || "";
|
||||||
break;
|
break;
|
||||||
@@ -7870,17 +7842,30 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetCosmeticLockerSlot", asy
|
|||||||
];
|
];
|
||||||
|
|
||||||
if (profile.profileId == "athena") {
|
if (profile.profileId == "athena") {
|
||||||
if (profile.items[req.body.itemToSlot].attributes.variants.length == 0) {
|
|
||||||
profile.items[req.body.itemToSlot].attributes.variants = req.body.variantUpdates || [];
|
for (var variantUpdate in req.body.variantUpdates) {
|
||||||
|
var bFound = false;
|
||||||
|
for (var variant in profile.items[req.body.itemToSlot].attributes.variants) {
|
||||||
|
if (req.body.variantUpdates[variantUpdate].channel == profile.items[req.body.itemToSlot].attributes.variants[variant].channel) {
|
||||||
|
profile.items[req.body.itemToSlot].attributes.variants[variant].active = req.body.variantUpdates[variantUpdate].active;
|
||||||
|
|
||||||
|
bFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bFound == false) {
|
||||||
|
profile.items[req.body.itemToSlot].attributes.variants.push(req.body.variantUpdates[variantUpdate])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in profile.items[req.body.itemToSlot].attributes.variants) {
|
ApplyProfileChanges.push({
|
||||||
try {
|
"changeType": "itemAttrChanged",
|
||||||
if (profile.items[req.body.itemToSlot].attributes.variants[i].channel.toLowerCase() == req.body.variantUpdates[i].channel.toLowerCase()) {
|
"itemId": req.body.itemToSlot,
|
||||||
profile.items[req.body.itemToSlot].attributes.variants[i].active = req.body.variantUpdates[i].active || "";
|
"attributeName": "variants",
|
||||||
}
|
"attributeValue": profile.items[req.body.itemToSlot].attributes.variants
|
||||||
} catch (err) {}
|
})
|
||||||
}
|
|
||||||
|
StatChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in req.body.variantUpdates) {
|
for (var i in req.body.variantUpdates) {
|
||||||
@@ -7897,39 +7882,14 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetCosmeticLockerSlot", asy
|
|||||||
if (req.body.category && req.body.lockerItem) {
|
if (req.body.category && req.body.lockerItem) {
|
||||||
|
|
||||||
switch (req.body.category) {
|
switch (req.body.category) {
|
||||||
|
|
||||||
case "Character":
|
case "Character":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.Character.items = [req.body.itemToSlot || ""];
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Backpack":
|
case "Backpack":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.Backpack.items = [req.body.itemToSlot || ""];
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Pickaxe":
|
case "Pickaxe":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.Pickaxe.items = [req.body.itemToSlot || ""];
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "Glider":
|
case "Glider":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.Glider.items = [req.body.itemToSlot || ""];
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "SkyDiveContrail":
|
case "SkyDiveContrail":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.SkyDiveContrail.items = [req.body.itemToSlot || ""];
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "MusicPack":
|
case "MusicPack":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.MusicPack.items = [req.body.itemToSlot || ""];
|
|
||||||
StatChanged = true;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case "LoadingScreen":
|
case "LoadingScreen":
|
||||||
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots.LoadingScreen.items = [req.body.itemToSlot || ""];
|
profile.items[req.body.lockerItem].attributes.locker_slots_data.slots[req.body.category].items = [req.body.itemToSlot || ""];
|
||||||
StatChanged = true;
|
StatChanged = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -8015,6 +7975,8 @@ express.post("/fortnite/api/game/v2/profile/*/client/PutModularCosmeticLoadout",
|
|||||||
var QueryRevision = req.query.rvn || -1;
|
var QueryRevision = req.query.rvn || -1;
|
||||||
var StatChanged = false;
|
var StatChanged = false;
|
||||||
|
|
||||||
|
var loadoutData = JSON.parse(req.body.loadoutData);
|
||||||
|
|
||||||
if (!profile.stats.attributes.hasOwnProperty("loadout_presets")) {
|
if (!profile.stats.attributes.hasOwnProperty("loadout_presets")) {
|
||||||
profile.stats.attributes.loadout_presets = {};
|
profile.stats.attributes.loadout_presets = {};
|
||||||
|
|
||||||
@@ -8059,7 +8021,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/PutModularCosmeticLoadout",
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
LoadoutGUID = profile.stats.attributes.loadout_presets[req.body.loadoutType][req.body.presetId];
|
LoadoutGUID = profile.stats.attributes.loadout_presets[req.body.loadoutType][req.body.presetId];
|
||||||
profile.items[LoadoutGUID].attributes = JSON.parse(req.body.loadoutData);
|
profile.items[LoadoutGUID].attributes = loadoutData;
|
||||||
|
|
||||||
ApplyProfileChanges.push({
|
ApplyProfileChanges.push({
|
||||||
"changeType": "itemAttrChanged",
|
"changeType": "itemAttrChanged",
|
||||||
@@ -8072,6 +8034,43 @@ express.post("/fortnite/api/game/v2/profile/*/client/PutModularCosmeticLoadout",
|
|||||||
|
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
|
|
||||||
|
// Apply the edit style changes to the item attributes too
|
||||||
|
for (var slot in loadoutData.slots) {
|
||||||
|
if (loadoutData.slots[slot].hasOwnProperty("customization_info")) {
|
||||||
|
for (var item in profile.items) {
|
||||||
|
if (profile.items[item].templateId.toLowerCase() == loadoutData.slots[slot].equipped_item.toLowerCase()) {
|
||||||
|
for (var customization in loadoutData.slots[slot].customization_info) {
|
||||||
|
var bFound = false;
|
||||||
|
for (var profileCustomization in profile.items[item].attributes.variants) {
|
||||||
|
if (loadoutData.slots[slot].customization_info[customization].channel_tag == profile.items[item].attributes.variants[profileCustomization].channel) {
|
||||||
|
profile.items[item].attributes.variants[profileCustomization].active = `${loadoutData.slots[slot].customization_info[customization].variant_tag}.${loadoutData.slots[slot].customization_info[customization].additional_data}`;
|
||||||
|
|
||||||
|
bFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (bFound == false) {
|
||||||
|
profile.items[item].attributes.variants.push({
|
||||||
|
"channel": loadoutData.slots[slot].customization_info[customization].channel_tag,
|
||||||
|
"active": `${loadoutData.slots[slot].customization_info[customization].variant_tag}.${loadoutData.slots[slot].customization_info[customization].additional_data}`,
|
||||||
|
"owned": []
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplyProfileChanges.push({
|
||||||
|
"changeType": "itemAttrChanged",
|
||||||
|
"itemId": item,
|
||||||
|
"attributeName": "variants",
|
||||||
|
"attributeValue": profile.items[item].attributes.variants
|
||||||
|
})
|
||||||
|
|
||||||
|
StatChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (StatChanged == true) {
|
if (StatChanged == true) {
|
||||||
profile.rvn += 1;
|
profile.rvn += 1;
|
||||||
profile.commandRevision += 1;
|
profile.commandRevision += 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user