Daily Reward notification for S6- (StW)

This commit is contained in:
PRO100KatYT
2022-03-11 16:33:00 +01:00
parent 2b66e2db9d
commit ff38855259
2 changed files with 1365 additions and 0 deletions

1351
responses/dailyrewards.json Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1021,9 +1021,12 @@ express.post("/fortnite/api/game/v2/profile/*/client/RefundMtxPurchase", async (
// Claim STW daily reward // Claim STW daily reward
express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (req, res) => { express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (req, res) => {
const profile = require(`./../profiles/${req.query.profileId || "campaign"}.json`); const profile = require(`./../profiles/${req.query.profileId || "campaign"}.json`);
const DailyRewards = require("./../responses/dailyrewards.json");
functions.GetVersionInfo(req, memory);
// do not change any of these or you will end up breaking it // do not change any of these or you will end up breaking it
var ApplyProfileChanges = []; var ApplyProfileChanges = [];
var Notifications = [];
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;
@@ -1048,6 +1051,16 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (r
"value": profile.stats.attributes.daily_rewards "value": profile.stats.attributes.daily_rewards
}) })
if (memory.season < 7) {
var Day = profile.stats.attributes.daily_rewards.totalDaysLoggedIn % 336;
Notifications.push({
"type": "daily_rewards",
"primary": true,
"daysLoggedIn": profile.stats.attributes.daily_rewards.totalDaysLoggedIn,
"items": [DailyRewards[Day]]
})
}
fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2)); fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.json`, JSON.stringify(profile, null, 2));
} }
@@ -1064,6 +1077,7 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (r
"profileId": req.query.profileId || "campaign", "profileId": req.query.profileId || "campaign",
"profileChangesBaseRevision": BaseRevision, "profileChangesBaseRevision": BaseRevision,
"profileChanges": ApplyProfileChanges, "profileChanges": ApplyProfileChanges,
"notifications": Notifications,
"profileCommandRevision": profile.commandRevision || 0, "profileCommandRevision": profile.commandRevision || 0,
"serverTime": new Date().toISOString(), "serverTime": new Date().toISOString(),
"responseVersion": 1 "responseVersion": 1