Homebase Naming screen upon first StW join.

This commit is contained in:
PRO100KatYT
2022-05-04 17:16:01 +02:00
parent 3ef0836fac
commit 41ca71af8c
8 changed files with 377 additions and 90 deletions

View File

@@ -52,11 +52,11 @@ express.get("/fortnite/api/game/v2/friendcodes/*/epic", async (req, res) => {
express.get("/launcher/api/public/distributionpoints/", async (req, res) => {
res.json({
"distributions": [
"https://epicgames-download1.akamaized.net/",
"https://download.epicgames.com/",
"https://download2.epicgames.com/",
"https://download3.epicgames.com/",
"https://download4.epicgames.com/",
"https://epicgames-download1.akamaized.net/",
"https://lawinserver.ol.epicgames.com/"
]
});
@@ -219,6 +219,89 @@ express.get("/fortnite/api/game/v2/leaderboards/cohort/*", async (req, res) => {
res.json([])
})
express.get("/fortnite/api/game/v2/homebase/allowed-name-chars", async (req, res) => {
res.json({
"ranges": [
48,
57,
65,
90,
97,
122,
192,
255,
260,
265,
280,
281,
286,
287,
304,
305,
321,
324,
346,
347,
350,
351,
377,
380,
1024,
1279,
1536,
1791,
4352,
4607,
11904,
12031,
12288,
12351,
12352,
12543,
12592,
12687,
12800,
13055,
13056,
13311,
13312,
19903,
19968,
40959,
43360,
43391,
44032,
55215,
55216,
55295,
63744,
64255,
65072,
65103,
65281,
65470,
131072,
173791,
194560,
195103
],
"singlePoints": [
32,
39,
45,
46,
95,
126
],
"excludedPoints": [
208,
215,
222,
247
]
})
})
express.post("/datarouter/api/v1/public/data", async (req, res) => {
res.status(204);
res.end();

View File

@@ -181,6 +181,75 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetHomebaseBanner", async (
res.end();
});
// Set Homebase Name STW
express.post("/fortnite/api/game/v2/profile/*/client/SetHomebaseName", async (req, res) => {
const profile = require(`./../profiles/${req.query.profileId || "profile0"}.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.homebaseName) {
switch (req.query.profileId) {
case "profile0":
profile.stats.attributes.homebase.townName = req.body.homebaseName;
StatChanged = true;
break;
case "common_public":
profile.stats.attributes.homebase_name = req.body.homebaseName;
StatChanged = true;
break;
}
}
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
if (req.query.profileId == "profile0") {
ApplyProfileChanges.push({
"changeType": "statModified",
"name": "homebase",
"value": profile.stats.attributes.homebase
})
}
if (req.query.profileId == "common_public") {
ApplyProfileChanges.push({
"changeType": "statModified",
"name": "homebase_name",
"value": profile.stats.attributes.homebase_name
})
}
fs.writeFileSync(`./profiles/${req.query.profileId || "profile0"}.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 || "profile0",
"profileChangesBaseRevision": BaseRevision,
"profileChanges": ApplyProfileChanges,
"profileCommandRevision": profile.commandRevision || 0,
"serverTime": new Date().toISOString(),
"responseVersion": 1
})
res.end();
});
// Buy skill tree perk STW
express.post("/fortnite/api/game/v2/profile/*/client/PurchaseHomebaseNode", async (req, res) => {
const profile = require(`./../profiles/${req.query.profileId || "profile0"}.json`);
@@ -1123,6 +1192,94 @@ express.post("/fortnite/api/game/v2/profile/*/client/ClaimLoginReward", async (r
res.end();
});
// Update quest client objectives STW
express.post("/fortnite/api/game/v2/profile/*/client/UpdateQuestClientObjectives", async (req, res) => {
const profile = require(`./../profiles/${req.query.profileId || "campaign"}.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.advance) {
for (var i in req.body.advance) {
var Quest = [];
var bIncomplete = false;
for (var x in profile.items) {
if (profile.items[x].templateId.toLowerCase().startsWith("quest:")) {
for (var y in profile.items[x].attributes) {
if (y.toLowerCase() == `completion_${req.body.advance[i].statName}`) {
Quest = x;
}
}
}
}
if (Quest) {
profile.items[Quest].attributes[`completion_${req.body.advance[i].statName}`] = req.body.advance[i].count;
ApplyProfileChanges.push({
"changeType": "itemAttrChanged",
"itemId": Quest,
"attributeName": `completion_${req.body.advance[i].statName}`,
"attributeValue": req.body.advance[i].count
})
if (profile.items[Quest].attributes.quest_state.toLowerCase() != "claimed") {
for (var x in profile.items[Quest].attributes) {
if (x.toLowerCase().startsWith("completion_")) {
if (profile.items[Quest].attributes[x] == 0) {
bIncomplete = true;
}
}
}
if (bIncomplete == false) {
profile.items[Quest].attributes.quest_state = "Claimed";
ApplyProfileChanges.push({
"changeType": "itemAttrChanged",
"itemId": Quest,
"attributeName": "quest_state",
"attributeValue": profile.items[Quest].attributes.quest_state
})
}
}
StatChanged = true;
}
}
}
if (StatChanged == true) {
profile.rvn += 1;
profile.commandRevision += 1;
fs.writeFileSync(`./profiles/${req.query.profileId || "campaign"}.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 || "campaign",
"profileChangesBaseRevision": BaseRevision,
"profileChanges": ApplyProfileChanges,
"profileCommandRevision": profile.commandRevision || 0,
"serverTime": new Date().toISOString(),
"responseVersion": 1
})
res.end();
});
// Equip team perk STW
express.post("/fortnite/api/game/v2/profile/*/client/AssignTeamPerkToLoadout", async (req, res) => {
const profile = require("./../profiles/campaign.json");