mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-14 11:19:16 +01:00
Added Winterfest Presents rewards dupe protection.
This commit is contained in:
@@ -320,9 +320,10 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
|||||||
var BaseRevision = profile.rvn || 0;
|
var BaseRevision = profile.rvn || 0;
|
||||||
var QueryRevision = req.query.rvn || -1;
|
var QueryRevision = req.query.rvn || -1;
|
||||||
var StatChanged = false;
|
var StatChanged = false;
|
||||||
|
var ItemExists = false;
|
||||||
var Season = "Season" + memory.season;
|
var Season = "Season" + memory.season;
|
||||||
|
|
||||||
const ID = functions.MakeID();
|
var ID = functions.MakeID();
|
||||||
const GiftID = functions.MakeID();
|
const GiftID = functions.MakeID();
|
||||||
|
|
||||||
if (req.body.nodeId && req.body.rewardGraphId) {
|
if (req.body.nodeId && req.body.rewardGraphId) {
|
||||||
@@ -335,6 +336,22 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
|||||||
"profileCommandRevision": common_core.commandRevision || 0,
|
"profileCommandRevision": common_core.commandRevision || 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
for (var key in common_core.items) {
|
||||||
|
if (common_core.items[key].templateId.toLowerCase() == WinterFestIDS[Season][req.body.nodeId].toLowerCase()) {
|
||||||
|
common_core.items[key].attributes.item_seen = false;
|
||||||
|
ID = key;
|
||||||
|
ItemExists = true;
|
||||||
|
|
||||||
|
MultiUpdate[0].profileChanges.push({
|
||||||
|
"changeType": "itemAttrChanged",
|
||||||
|
"itemId": key,
|
||||||
|
"attributeName": "item_seen",
|
||||||
|
"attributeValue": common_core.items[key].attributes.item_seen
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ItemExists == false) {
|
||||||
common_core.items[ID] = {
|
common_core.items[ID] = {
|
||||||
"templateId": WinterFestIDS[Season][req.body.nodeId],
|
"templateId": WinterFestIDS[Season][req.body.nodeId],
|
||||||
"attributes": {
|
"attributes": {
|
||||||
@@ -353,15 +370,36 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
|||||||
"itemId": ID,
|
"itemId": ID,
|
||||||
"item": common_core.items[ID]
|
"item": common_core.items[ID]
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemExists = false;
|
||||||
|
|
||||||
common_core.rvn += 1;
|
common_core.rvn += 1;
|
||||||
common_core.commandRevision += 1;
|
common_core.commandRevision += 1;
|
||||||
|
|
||||||
MultiUpdate[0].profileRevision = common_core.rvn || 0;
|
MultiUpdate[0].profileRevision = common_core.rvn || 0;
|
||||||
MultiUpdate[0].profileCommandRevision = common_core.commandRevision || 0;
|
MultiUpdate[0].profileCommandRevision = common_core.commandRevision || 0;
|
||||||
|
|
||||||
|
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[{"itemType":WinterFestIDS[Season][req.body.nodeId],"itemGuid":ID,"itemProfile":"common_core","attributes":{"creation_time":new Date().toISOString()},"quantity":1}],"level":1,"item_seen":false,"xp":0,"giftedOn":new Date().toISOString(),"params":{"SubGame":"Athena","winterfestGift":"true"},"favorite":false},"quantity":1};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WinterFestIDS[Season][req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) {
|
if (!WinterFestIDS[Season][req.body.nodeId].toLowerCase().startsWith("homebasebannericon:")) {
|
||||||
|
for (var key in profile.items) {
|
||||||
|
if (profile.items[key].templateId.toLowerCase() == WinterFestIDS[Season][req.body.nodeId].toLowerCase()) {
|
||||||
|
profile.items[key].attributes.item_seen = false;
|
||||||
|
ID = key;
|
||||||
|
ItemExists = true;
|
||||||
|
|
||||||
|
ApplyProfileChanges.push({
|
||||||
|
"changeType": "itemAttrChanged",
|
||||||
|
"itemId": key,
|
||||||
|
"attributeName": "item_seen",
|
||||||
|
"attributeValue": profile.items[key].attributes.item_seen
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ItemExists == false) {
|
||||||
profile.items[ID] = {
|
profile.items[ID] = {
|
||||||
"templateId": WinterFestIDS[Season][req.body.nodeId],
|
"templateId": WinterFestIDS[Season][req.body.nodeId],
|
||||||
"attributes": {
|
"attributes": {
|
||||||
@@ -382,7 +420,11 @@ express.post("/fortnite/api/game/v2/profile/*/client/UnlockRewardNode", async (r
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ItemExists = false;
|
||||||
|
|
||||||
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[{"itemType":WinterFestIDS[Season][req.body.nodeId],"itemGuid":ID,"itemProfile":"athena","attributes":{"creation_time":new Date().toISOString()},"quantity":1}],"level":1,"item_seen":false,"xp":0,"giftedOn":new Date().toISOString(),"params":{"SubGame":"Athena","winterfestGift":"true"},"favorite":false},"quantity":1};
|
profile.items[GiftID] = {"templateId":"GiftBox:gb_winterfestreward","attributes":{"max_level_bonus":0,"fromAccountId":"","lootList":[{"itemType":WinterFestIDS[Season][req.body.nodeId],"itemGuid":ID,"itemProfile":"athena","attributes":{"creation_time":new Date().toISOString()},"quantity":1}],"level":1,"item_seen":false,"xp":0,"giftedOn":new Date().toISOString(),"params":{"SubGame":"Athena","winterfestGift":"true"},"favorite":false},"quantity":1};
|
||||||
|
}
|
||||||
|
|
||||||
profile.items[req.body.rewardGraphId].attributes.reward_keys[0].unlock_keys_used += 1;
|
profile.items[req.body.rewardGraphId].attributes.reward_keys[0].unlock_keys_used += 1;
|
||||||
profile.items[req.body.rewardGraphId].attributes.reward_nodes_claimed.push(req.body.nodeId);
|
profile.items[req.body.rewardGraphId].attributes.reward_nodes_claimed.push(req.body.nodeId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user