Change structure of LawinServer

This commit is contained in:
Lawin0129
2022-02-15 17:45:46 +00:00
parent acf6b1d3d6
commit 63cb770799
28 changed files with 7162 additions and 7102 deletions

27
structure/affiliate.js Normal file
View File

@@ -0,0 +1,27 @@
const Express = require("express");
const express = Express.Router();
express.get("/affiliate/api/public/affiliates/slug/:slug", async (req, res) => {
const SupportedCodes = require("./../responses/SAC.json");
var ValidCode = false;
SupportedCodes.forEach(code => {
if (req.params.slug.toLowerCase() == code.toLowerCase()) {
ValidCode = true;
return res.json({
"id": code,
"slug": code,
"displayName": code,
"status": "ACTIVE",
"verified": false
});
}
})
if (ValidCode == false) {
res.status(404);
res.json({});
}
})
module.exports = express;

131
structure/cloudstorage.js Normal file
View File

@@ -0,0 +1,131 @@
const Express = require("express");
const express = Express.Router();
const crypto = require("crypto");
const fs = require("fs");
const path = require("path");
const functions = require("./functions.js");
const memory = require("./../memory.json");
express.get("/fortnite/api/cloudstorage/system", async (req, res) => {
functions.GetVersionInfo(req, memory);
if (memory.build >= 9.40 && memory.build <= 10.40) {
return res.status(404).end();
}
const dir = path.join(__dirname, "..", "CloudStorage")
var CloudFiles = [];
fs.readdirSync(dir).forEach(name => {
if (name.toLowerCase().endsWith(".ini")) {
const ParsedFile = fs.readFileSync(path.join(dir, name), 'utf-8');
const ParsedStats = fs.statSync(path.join(dir, name));
CloudFiles.push({
"uniqueFilename": name,
"filename": name,
"hash": crypto.createHash('sha1').update(ParsedFile).digest('hex'),
"hash256": crypto.createHash('sha256').update(ParsedFile).digest('hex'),
"length": ParsedFile.length,
"contentType": "application/octet-stream",
"uploaded": ParsedStats.mtime,
"storageType": "S3",
"storageIds": {},
"doNotCache": true
})
}
});
res.json(CloudFiles)
})
express.get("/fortnite/api/cloudstorage/system/:file", async (req, res) => {
const file = path.join(__dirname, "..", "CloudStorage", req.params.file);
if (fs.existsSync(file)) {
const ParsedFile = fs.readFileSync(file);
return res.status(200).send(ParsedFile).end();
} else {
res.status(200);
res.end();
}
})
express.get("/fortnite/api/cloudstorage/user/*/:file", async (req, res) => {
if (!fs.existsSync(path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings"))) {
fs.mkdirSync(path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings"));
}
res.set("Content-Type", "application/octet-stream")
if (req.params.file.toLowerCase() != "clientsettings.sav") {
return res.status(404).json({
"error": "file not found"
});
}
functions.GetVersionInfo(req, memory);
var currentBuildID = memory.CL;
const file = path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings", `ClientSettings-${currentBuildID}.Sav`);
if (fs.existsSync(file)) {
const ParsedFile = fs.readFileSync(file);
return res.status(200).send(ParsedFile).end();
} else {
res.status(200);
res.end();
}
})
express.get("/fortnite/api/cloudstorage/user/:accountId", async (req, res) => {
if (!fs.existsSync(path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings"))) {
fs.mkdirSync(path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings"));
}
res.set("Content-Type", "application/json")
functions.GetVersionInfo(req, memory);
var currentBuildID = memory.CL;
const file = path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings", `ClientSettings-${currentBuildID}.Sav`);
if (fs.existsSync(file)) {
const ParsedFile = fs.readFileSync(file, 'utf-8');
const ParsedStats = fs.statSync(file);
return res.json([{
"uniqueFilename": "ClientSettings.Sav",
"filename": "ClientSettings.Sav",
"hash": crypto.createHash('sha1').update(ParsedFile).digest('hex'),
"hash256": crypto.createHash('sha256').update(ParsedFile).digest('hex'),
"length": Buffer.byteLength(ParsedFile),
"contentType": "application/octet-stream",
"uploaded": ParsedStats.mtime,
"storageType": "S3",
"storageIds": {},
"accountId": req.params.accountId,
"doNotCache": true
}]);
} else {
return res.json([]);
}
})
express.put("/fortnite/api/cloudstorage/user/*/*", async (req, res) => {
if (!fs.existsSync(path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings"))) {
fs.mkdirSync(path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings"));
}
functions.GetVersionInfo(req, memory);
var currentBuildID = memory.CL;
const file = path.join(process.env.LOCALAPPDATA, "LawinServer", "ClientSettings", `ClientSettings-${currentBuildID}.Sav`);
fs.writeFileSync(file, req.rawBody, 'latin1');
res.status(204).end();
})
module.exports = express;

11
structure/contentpages.js Normal file
View File

@@ -0,0 +1,11 @@
const Express = require("express");
const express = Express.Router();
const functions = require("./functions.js");
express.get("/content/api/pages/*", async (req, res) => {
const contentpages = functions.getContentPages(req);
res.json(contentpages)
})
module.exports = express;

32
structure/friends.js Normal file
View File

@@ -0,0 +1,32 @@
const Express = require("express");
const express = Express.Router();
const friendslist = require("./../responses/friendslist.json");
const friendslist2 = require("./../responses/friendslist2.json");
express.get("/friends/api/v1/*/settings", async (req, res) => {
res.json({})
})
express.get("/friends/api/v1/*/blocklist", async (req, res) => {
res.json([])
})
express.get("/friends/api/public/friends/*", async (req, res) => {
res.json(friendslist)
})
express.get("/friends/api/v1/*/summary", async (req, res) => {
res.json(friendslist2)
})
express.get("/friends/api/public/list/fortnite/*/recentPlayers", async (req, res) => {
res.json([])
})
express.get("/friends/api/public/blocklist/*", async (req, res) => {
res.json({
"blockedUsers": []
})
})
module.exports = express;

218
structure/functions.js Normal file
View File

@@ -0,0 +1,218 @@
const crypto = require("crypto");
const memory = require("./../memory.json");
function GetVersionInfo(req, memory) {
if (req.headers["user-agent"])
{
var CL = "";
if (req.headers["user-agent"]) {
try {
var BuildID = req.headers["user-agent"].split("-")[3].split(",")[0]
if (!Number.isNaN(Number(BuildID))) {
CL = BuildID;
}
if (Number.isNaN(Number(BuildID))) {
var BuildID = req.headers["user-agent"].split("-")[3].split(" ")[0]
if (!Number.isNaN(Number(BuildID))) {
CL = BuildID;
}
}
} catch (err) {
try {
var BuildID = req.headers["user-agent"].split("-")[1].split("+")[0]
if (!Number.isNaN(Number(BuildID))) {
CL = BuildID;
}
} catch (err) {}
}
}
try {
var Build = req.headers["user-agent"].split("Release-")[1].split("-")[0];
if (Build.split(".").length == 3) {
Value = Build.split(".");
Build = Value[0] + "." + Value[1] + Value[2];
}
memory.season = Number(Build.split(".")[0]);
memory.build = Number(Build);
memory.CL = CL;
memory.lobby = `LobbySeason${memory.season}`;
if (Number.isNaN(memory.season)) {
throw new Error();
}
} catch (err) {
memory.season = 2;
memory.build = 2.0;
memory.CL = CL;
memory.lobby = "LobbyWinterDecor";
}
}
}
function getItemShop() {
const catalog = JSON.parse(JSON.stringify(require("./../responses/catalog.json")));
const CatalogConfig = require("./../Config/catalog_config.json");
try {
for (var value in CatalogConfig) {
if (typeof CatalogConfig[value].templateId == "string") {
if (CatalogConfig[value].templateId.length != 0) {
const CatalogEntry = {"devName":"","offerId":"","fulfillmentIds":[],"dailyLimit":-1,"weeklyLimit":-1,"monthlyLimit":-1,"categories":[],"prices":[{"currencyType":"MtxCurrency","currencySubType":"","regularPrice":0,"finalPrice":0,"saleExpiration":"9999-12-02T01:12:00Z","basePrice":0}],"matchFilter":"","filterWeight":0,"appStoreId":[],"requirements":[{"requirementType":"DenyOnItemOwnership","requiredId":"","minQuantity":1}],"offerType":"StaticPrice","giftInfo":{"bIsEnabled":false,"forcedGiftBoxTemplateId":"","purchaseRequirements":[],"giftRecordIds":[]},"refundable":true,"metaInfo":[],"displayAssetPath":"","itemGrants":[{"templateId":"","quantity":1}],"sortPriority":0,"catalogGroupPriority":0};
if (value.toLowerCase().startsWith("daily")) {
catalog.storefronts.forEach((storefront, i) => {
if (storefront.name == "BRDailyStorefront") {
CatalogEntry.devName = CatalogConfig[value].templateId
CatalogEntry.offerId = CatalogConfig[value].templateId
CatalogEntry.requirements[0].requiredId = CatalogConfig[value].templateId
CatalogEntry.itemGrants[0].templateId = CatalogConfig[value].templateId
CatalogEntry.prices[0].basePrice = CatalogConfig[value].price
CatalogEntry.prices[0].regularPrice = CatalogConfig[value].price
CatalogEntry.prices[0].finalPrice = CatalogConfig[value].price
catalog.storefronts[i].catalogEntries.push(CatalogEntry);
}
})
}
if (value.toLowerCase().startsWith("featured")) {
catalog.storefronts.forEach((storefront, i) => {
if (storefront.name == "BRWeeklyStorefront") {
CatalogEntry.devName = CatalogConfig[value].templateId
CatalogEntry.offerId = CatalogConfig[value].templateId
CatalogEntry.requirements[0].requiredId = CatalogConfig[value].templateId
CatalogEntry.itemGrants[0].templateId = CatalogConfig[value].templateId
CatalogEntry.prices[0].basePrice = CatalogConfig[value].price
CatalogEntry.prices[0].regularPrice = CatalogConfig[value].price
CatalogEntry.prices[0].finalPrice = CatalogConfig[value].price
catalog.storefronts[i].catalogEntries.push(CatalogEntry);
}
})
}
}
}
}
} catch (err) {}
return catalog;
}
function getTheater(req) {
GetVersionInfo(req, memory);
var theater = JSON.stringify(require("./../responses/worldstw.json"));
try {
if (memory.build >= 15.30) {
theater = theater.replace(/\/Game\//ig, "\/SaveTheWorld\/");
theater = theater.replace(/\"DataTable\'\/SaveTheWorld\//ig, "\"DataTable\'\/Game\/");
}
var date = new Date().toISOString()
// Set the 24-hour StW mission refresh date for version season 9 and above
if (memory.season >= 9) {
date = date.split("T")[0] + "T23:59:59.999Z";
} else {
// Set the 6-hour StW mission refresh date for versions below season 9
if (date < (date.split("T")[0] + "T05:59:59.999Z")) {
date = date.split("T")[0] + "T05:59:59.999Z";
} else if (date < (date.split("T")[0] + "T11:59:59.999Z")) {
date = date.split("T")[0] + "T11:59:59.999Z";
} else if (date < (date.split("T")[0] + "T17:59:59.999Z")) {
date = date.split("T")[0] + "T17:59:59.999Z";
} else if (date < (date.split("T")[0] + "T23:59:59.999Z")) {
date = date.split("T")[0] + "T23:59:59.999Z";
}
}
theater = theater.replace(/2017-07-25T23:59:59.999Z/ig, date);
} catch (err) {}
theater = JSON.parse(theater)
return theater;
}
function getContentPages(req) {
GetVersionInfo(req, memory);
const contentpages = JSON.parse(JSON.stringify(require("./../responses/contentpages.json")));
var Language = "en";
if (req.headers["accept-language"]) {
if (req.headers["accept-language"].includes("-") && req.headers["accept-language"] != "es-419") {
Language = req.headers["accept-language"].split("-")[0];
} else {
Language = req.headers["accept-language"];
}
}
const modes = ["saveTheWorldUnowned", "battleRoyale", "creative", "saveTheWorld"];
const news = ["savetheworldnews", "battleroyalenews"]
try {
modes.forEach(mode => {
contentpages.subgameselectdata[mode].message.title = contentpages.subgameselectdata[mode].message.title[Language]
contentpages.subgameselectdata[mode].message.body = contentpages.subgameselectdata[mode].message.body[Language]
})
} catch (err) {}
try {
if (memory.season < 5 || (memory.season == 5 && Number(memory.build.toString().split(".")[1]) < 30)) {
news.forEach(mode => {
contentpages[mode].news.messages[0].image = "https://cdn.discordapp.com/attachments/927739901540188200/930879507496308736/discord.png";
contentpages[mode].news.messages[1].image = "https://cdn.discordapp.com/attachments/927739901540188200/930879519882088508/lawin.png";
})
}
} catch (err) {}
try {
contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = `season${memory.season}`;
contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = `season${memory.season}`;
if (memory.season == 10) {
contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = "seasonx";
contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = "seasonx";
}
if (memory.build == 11.31 || memory.build == 11.40) {
contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = "Winter19";
contentpages.dynamicbackgrounds.backgrounds.backgrounds[1].stage = "Winter19";
}
if (memory.build == 19.01) {
contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].stage = "winter2021";
contentpages.dynamicbackgrounds.backgrounds.backgrounds[0].backgroundimage = "https://cdn.discordapp.com/attachments/927739901540188200/930880158167085116/t-bp19-lobby-xmas-2048x1024-f85d2684b4af.png";
contentpages.subgameinfo.battleroyale.image = "https://cdn.discordapp.com/attachments/927739901540188200/930880421514846268/19br-wf-subgame-select-512x1024-16d8bb0f218f.jpg";
contentpages.specialoffervideo.bSpecialOfferEnabled = "true";
}
} catch (err) {}
return contentpages;
}
function MakeID() {
let CurrentDate = (new Date()).valueOf().toString();
let RandomFloat = Math.random().toString();
let ID = crypto.createHash('md5').update(CurrentDate + RandomFloat).digest('hex');
let FinishedID = ID.slice(0, 8) + "-" + ID.slice(8, 12) + "-" + ID.slice(12, 16) + "-" + ID.slice(16, 20) + "-" + ID.slice(20, 32);
return FinishedID;
}
module.exports = {
GetVersionInfo,
getItemShop,
getTheater,
getContentPages,
MakeID
}

47
structure/lightswitch.js Normal file
View File

@@ -0,0 +1,47 @@
const Express = require("express");
const express = Express.Router();
express.get("/lightswitch/api/service/Fortnite/status", async (req, res) => {
res.json({
"serviceInstanceId": "fortnite",
"status": "UP",
"message": "Fortnite is online",
"maintenanceUri": null,
"overrideCatalogIds": [
"a7f138b2e51945ffbfdacc1af0541053"
],
"allowedActions": [],
"banned": false,
"launcherInfoDTO": {
"appName": "Fortnite",
"catalogItemId": "4fe75bbc5a674f4f9b356b5c90567da5",
"namespace": "fn"
}
});
})
express.get("/lightswitch/api/service/bulk/status", async (req, res) => {
res.json(
[{
"serviceInstanceId": "fortnite",
"status": "UP",
"message": "fortnite is up.",
"maintenanceUri": null,
"overrideCatalogIds": [
"a7f138b2e51945ffbfdacc1af0541053"
],
"allowedActions": [
"PLAY",
"DOWNLOAD"
],
"banned": false,
"launcherInfoDTO": {
"appName": "Fortnite",
"catalogItemId": "4fe75bbc5a674f4f9b356b5c90567da5",
"namespace": "fn"
}
}]
)
})
module.exports = express;

197
structure/main.js Normal file
View File

@@ -0,0 +1,197 @@
const Express = require("express");
const express = Express.Router();
const functions = require("./functions.js");
express.get("/clearitemsforshop", async (req, res) => {
res.set("Content-Type", "text/plain");
const athena = require("./../profiles/athena.json");
const CatalogConfig = require("./../Config/catalog_config.json");
var StatChanged = false;
for (var value in CatalogConfig) {
for (var key in athena.items) {
if (typeof CatalogConfig[value].templateId == "string") {
if (CatalogConfig[value].templateId.length != 0) {
if (CatalogConfig[value].templateId.toLowerCase() == athena.items[key].templateId.toLowerCase()) {
delete athena.items[key]
StatChanged = true;
}
}
}
}
}
if (StatChanged == true) {
athena.rvn += 1;
athena.commandRevision += 1;
fs.writeFileSync("./profiles/athena.json", JSON.stringify(athena, null, 2));
res.send('Success');
} else {
res.send('Failed, there are no items to remove')
}
})
express.get("/eulatracking/api/shared/agreements/fn*", async (req, res) => {
res.json({})
})
express.get("/fortnite/api/game/v2/friendcodes/*/epic", async (req, res) => {
res.json([])
})
express.get("/launcher/api/public/distributionpoints/", async (req, res) => {
res.json({
"distributions": [
"https://download.epicgames.com/",
"https://download2.epicgames.com/",
"https://download3.epicgames.com/",
"https://download4.epicgames.com/",
"https://epicgames-download1.akamaized.net/"
]
});
})
express.post("/fortnite/api/game/v2/grant_access/*", async (req, res) => {
res.json({});
res.status(204);
})
express.post("/api/v1/user/setting", async (req, res) => {
res.json([]);
})
express.get("/waitingroom/api/waitingroom", async (req, res) => {
res.status(204);
res.end();
})
express.get("/socialban/api/public/v1/*", async (req, res) => {
res.json({
"bans": [],
"warnings": []
});
})
express.get("/party/api/v1/Fortnite/user/*", async (req, res) => {
res.json({
"current": [],
"pending": [],
"invites": [],
"pings": []
});
})
express.post("/party/api/v1/Fortnite/user/*/current/*", async (req, res) => {
res.json({});
})
express.post("/party/api/v1/Fortnite/user/*/pending/*", async (req, res) => {
res.json({});
})
express.post("/party/api/v1/Fortnite/user/*/invites/*", async (req, res) => {
res.json({});
})
express.get("/fortnite/api/game/v2/events/tournamentandhistory/*/EU/WindowsClient", async (req, res) => {
res.json({});
})
express.post("/party/api/v1/Fortnite/user/*/pings/*", async (req, res) => {
res.json({});
})
express.get("/fortnite/api/game/v2/events/tournamentandhistory/*/EU/WindowsClient", async (req, res) => {
res.json({});
})
express.get("/fortnite/api/statsv2/account/:accountId", async (req, res) => {
res.json({
"startTime": 0,
"endTime": 0,
"stats": {},
"accountId": req.params.accountId
});
})
express.get("/statsproxy/api/statsv2/account/:accountId", async (req, res) => {
res.json({
"startTime": 0,
"endTime": 0,
"stats": {},
"accountId": req.params.accountId
});
})
express.get("/fortnite/api/stats/accountId/:accountId/bulk/window/alltime", async (req, res) => {
res.json({
"startTime": 0,
"endTime": 0,
"stats": {},
"accountId": req.params.accountId
})
})
express.post("/fortnite/api/feedback/*", async (req, res) => {
res.status(200);
res.end();
})
express.post("/fortnite/api/statsv2/query", async (req, res) => {
res.json([]);
})
express.post("/statsproxy/api/statsv2/query", async (req, res) => {
res.json([]);
})
express.post("/fortnite/api/game/v2/events/v2/setSubgroup/*", async (req, res) => {
res.status(204);
res.end();
})
express.get("/fortnite/api/game/v2/enabled_features", async (req, res) => {
res.json([])
})
express.get("/api/v1/events/Fortnite/download/*", async (req, res) => {
res.json({})
})
express.get("/fortnite/api/game/v2/twitch/*", async (req, res) => {
res.status(200);
res.end();
})
express.get("/fortnite/api/game/v2/world/info", async (req, res) => {
const worldstw = functions.getTheater(req);
res.json(worldstw)
})
express.post("/fortnite/api/game/v2/chat/*/recommendGeneralChatRooms/pc", async (req, res) => {
res.json({})
})
express.get("/presence/api/v1/_/*/last-online", async (req, res) => {
res.json({})
})
express.get("/fortnite/api/receipts/v1/account/*/receipts", async (req, res) => {
res.json([])
})
express.get("/fortnite/api/game/v2/leaderboards/cohort/*", async (req, res) => {
res.json([])
})
express.post("/datarouter/api/v1/public/data", async (req, res) => {
res.status(204);
res.end();
})
module.exports = express;

90
structure/matchmaking.js Normal file
View File

@@ -0,0 +1,90 @@
const Express = require("express");
const express = Express.Router();
const fs = require("fs");
const path = require("path");
const iniparser = require("ini");
const config = iniparser.parse(fs.readFileSync(path.join(__dirname, "..", "Config", "config.ini")).toString());
const functions = require("./functions.js");
const memory = require("./../memory.json");
express.get("/fortnite/api/matchmaking/session/findPlayer/*", async (req, res) => {
res.status(200);
res.end();
})
express.get("/fortnite/api/game/v2/matchmakingservice/ticket/player/*", async (req, res) => {
memory.currentbuildUniqueId = req.query.bucketId.split(":")[0];
fs.writeFileSync("./memory.json", JSON.stringify(memory, null, 2));
res.json({
"serviceUrl": "ws://lawinservermatchmaker.herokuapp.com",
"ticketType": "mms-player",
"payload": "69=",
"signature": "420="
})
res.end();
})
express.get("/fortnite/api/game/v2/matchmaking/account/:accountId/session/:sessionId", async (req, res) => {
res.json({
"accountId": req.params.accountId,
"sessionId": req.params.sessionId,
"key": "AOJEv8uTFmUh7XM2328kq9rlAzeQ5xzWzPIiyKn2s7s="
})
})
express.get("/fortnite/api/matchmaking/session/:session_id", async (req, res) => {
res.json({
"id": req.params.session_id,
"ownerId": functions.MakeID().replace(/-/ig, "").toUpperCase(),
"ownerName": "[DS]fortnite-liveeugcec1c2e30ubrcore0a-z8hj-1968",
"serverName": "[DS]fortnite-liveeugcec1c2e30ubrcore0a-z8hj-1968",
"serverAddress": config.GameServer.ip,
"serverPort": Number(config.GameServer.port),
"maxPublicPlayers": 220,
"openPublicPlayers": 175,
"maxPrivatePlayers": 0,
"openPrivatePlayers": 0,
"attributes": {
"REGION_s": "EU",
"GAMEMODE_s": "FORTATHENA",
"ALLOWBROADCASTING_b": true,
"SUBREGION_s": "GB",
"DCID_s": "FORTNITE-LIVEEUGCEC1C2E30UBRCORE0A-14840880",
"tenant_s": "Fortnite",
"MATCHMAKINGPOOL_s": "Any",
"STORMSHIELDDEFENSETYPE_i": 0,
"HOTFIXVERSION_i": 0,
"PLAYLISTNAME_s": "Playlist_DefaultSolo",
"SESSIONKEY_s": functions.MakeID().replace(/-/ig, "").toUpperCase(),
"TENANT_s": "Fortnite",
"BEACONPORT_i": 15009
},
"publicPlayers": [],
"privatePlayers": [],
"totalPlayers": 45,
"allowJoinInProgress": false,
"shouldAdvertise": false,
"isDedicated": false,
"usesStats": false,
"allowInvites": false,
"usesPresence": false,
"allowJoinViaPresence": true,
"allowJoinViaPresenceFriendsOnly": false,
"buildUniqueId": memory.currentbuildUniqueId, // buildUniqueId is different for every build, this uses the netver of the version you're currently using
"lastUpdated": new Date().toISOString(),
"started": false
})
})
express.post("/fortnite/api/matchmaking/session/*/join", async (req, res) => {
res.status(204);
res.end();
})
express.post("/fortnite/api/matchmaking/session/matchMakingRequest", async (req, res) => {
res.json([])
})
module.exports = express;

5339
structure/mcp.js Normal file

File diff suppressed because it is too large Load Diff

22
structure/privacy.js Normal file
View File

@@ -0,0 +1,22 @@
const Express = require("express");
const express = Express.Router();
const fs = require("fs");
const privacy = require("./../responses/privacy.json");
express.get("/fortnite/api/game/v2/privacy/account/:accountId", async (req, res) => {
privacy.accountId = req.params.accountId;
res.json(privacy);
})
express.post("/fortnite/api/game/v2/privacy/account/:accountId", async (req, res) => {
privacy.accountId = req.params.accountId;
privacy.optOutOfPublicLeaderboards = req.body.optOutOfPublicLeaderboards;
fs.writeFileSync("./responses/privacy.json", JSON.stringify(privacy, null, 2));
res.json(privacy);
res.end();
})
module.exports = express;

23
structure/storefront.js Normal file
View File

@@ -0,0 +1,23 @@
const Express = require("express");
const express = Express.Router();
const functions = require("./functions.js");
const catalog = functions.getItemShop();
const keychain = require("./../responses/keychain.json");
express.get("/fortnite/api/storefront/v2/catalog", async (req, res) => {
if (req.headers["user-agent"].includes("2870186")) {
return res.status(404).end();
}
res.json(catalog);
})
express.get("/fortnite/api/storefront/v2/keychain", async (req, res) => {
res.json(keychain)
})
express.get("/catalog/api/shared/bulk/offers", async (req, res) => {
res.json({});
})
module.exports = express;

567
structure/timeline.js Normal file
View File

@@ -0,0 +1,567 @@
const Express = require("express");
const express = Express.Router();
const functions = require("./functions.js");
const memory = require("./../memory.json");
express.get("/fortnite/api/calendar/v1/timeline", async (req, res) => {
functions.GetVersionInfo(req, memory);
var activeEvents = [
{
"eventType": `EventFlag.Season${memory.season}`,
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": `EventFlag.${memory.lobby}`,
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
}];
if (memory.season == 3) {
activeEvents.push(
{
"eventType": "EventFlag.Spring2018Phase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Spring2018Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Spring2018Phase3",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Spring2018Phase4",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 4) {
activeEvents.push(
{
"eventType": "EventFlag.Blockbuster2018",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Blockbuster2018Phase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Blockbuster2018Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Blockbuster2018Phase3",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Blockbuster2018Phase4",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 5) {
activeEvents.push(
{
"eventType": "EventFlag.RoadTrip2018",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Horde",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_Heist",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.build == 5.10) {
activeEvents.push(
{
"eventType": "EventFlag.BirthdayBattleBus",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 6) {
activeEvents.push(
{
"eventType": "EventFlag.Fortnitemares",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.FortnitemaresPhase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.FortnitemaresPhase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_Fortnitemares",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_LilKevin",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.build == 6.20 || memory.build == 6.21) {
activeEvents.push(
{
"eventType": "EventFlag.LobbySeason6Halloween",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.HalloweenBattleBus",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 7) {
activeEvents.push(
{
"eventType": "EventFlag.Frostnite",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_14DaysOfFortnite",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_Festivus",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_WinterDeimos",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_S7_OverTime",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 8) {
activeEvents.push(
{
"eventType": "EventFlag.Spring2019",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Spring2019.Phase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Spring2019.Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_Ashton",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_Goose",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_HighStakes",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_BootyBay",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 9) {
activeEvents.push(
{
"eventType": "EventFlag.Season9.Phase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season9.Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Anniversary2019_BR",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_14DaysOfSummer",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_Mash",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTM_Wax",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 10) {
activeEvents.push(
{
"eventType": "EventFlag.Season10.Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season10.Phase3",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_BlackMonday",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.S10_Oak",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EEventFlag.S10_Mystery",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 11) {
activeEvents.push(
{
"eventType": "EventFlag.LTE_CoinCollectXP",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_Fortnitemares2019",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_Galileo_Feats",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_Galileo",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_WinterFest2019",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
if (Number(memory.build.toString().split(".")[1].split("")[0]) >= 2) {
activeEvents.push(
{
"eventType": "EventFlag.Starlight",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (Number(memory.build.toString().split(".")[1].split("")[0]) < 3) {
activeEvents.push(
{
"eventType": "EventFlag.Season11.Fortnitemares.Quests.Phase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.Fortnitemares.Quests.Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.Fortnitemares.Quests.Phase3",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.Fortnitemares.Quests.Phase4",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.StormKing.Landmark",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
} else {
activeEvents.push(
{
"eventType": "EventFlag.HolidayDeco",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.WinterFest.Quests.Phase1",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.WinterFest.Quests.Phase2",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.WinterFest.Quests.Phase3",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Season11.Frostnite",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
// Credits to Silas for these BR Winterfest event flags
if (memory.build == 11.31 || memory.build == 11.40) {
activeEvents.push(
{
"eventType": "EventFlag.Winterfest.Tree",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_WinterFest",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_WinterFest2019",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
}
if (memory.season == 12) {
activeEvents.push(
{
"eventType": "EventFlag.LTE_SpyGames",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_JerkyChallenges",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_Oro",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTE_StormTheAgency",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 14) {
activeEvents.push(
{
"eventType": "EventFlag.LTE_Fortnitemares_2020",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.season == 15) {
activeEvents.push(
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_01",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_02",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_03",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_04",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_05",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_06",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_07",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_08",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_09",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_10",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_11",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_12",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_13",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_14",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.LTQ_S15_Legendary_Week_15",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Event_HiddenRole",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Event_OperationSnowdown",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "EventFlag.Event_PlumRetro",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
if (memory.build == 19.01) {
activeEvents.push(
{
"eventType": "EventFlag.LTE_WinterFest",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
},
{
"eventType": "WF_IG_AVAIL",
"activeUntil": "9999-01-01T00:00:00.000Z",
"activeSince": "2020-01-01T00:00:00.000Z"
})
}
res.json({
"channels": {
"client-matchmaking": {
"states": [],
"cacheExpire": "9999-01-01T22:28:47.830Z"
},
"client-events": {
"states": [{
"validFrom": "2020-01-01T20:28:47.830Z",
"activeEvents": activeEvents,
"state": {
"activeStorefronts": [],
"eventNamedWeights": {},
"seasonNumber": memory.season,
"seasonTemplateId": `AthenaSeason:athenaseason${memory.season}`,
"matchXpBonusPoints": 0,
"seasonBegin": "2020-01-01T13:00:00Z",
"seasonEnd": "9999-01-01T14:00:00Z",
"seasonDisplayedEnd": "9999-01-01T07:30:00Z",
"weeklyStoreEnd": "9999-01-01T00:00:00Z",
"stwEventStoreEnd": "9999-01-01T00:00:00.000Z",
"stwWeeklyStoreEnd": "9999-01-01T00:00:00.000Z",
"dailyStoreEnd": "9999-01-01T00:00:00Z"
}
}],
"cacheExpire": "9999-01-01T22:28:47.830Z"
}
},
"eventsTimeOffsetHrs": 0,
"cacheIntervalMins": 10,
"currentTime": new Date().toISOString()
});
res.end();
})
module.exports = express;

357
structure/user.js Normal file
View File

@@ -0,0 +1,357 @@
const Express = require("express");
const express = Express.Router();
const fs = require("fs");
const path = require("path");
const iniparser = require("ini");
const config = iniparser.parse(fs.readFileSync(path.join(__dirname, "..", "Config", "config.ini")).toString());
const functions = require("./functions.js");
var Memory_CurrentAccountID = functions.MakeID().replace(/-/ig, "");
express.get("/account/api/public/account", async (req, res) => {
var displayName = config.Config.displayName;
if (config.Config.bUseConfigDisplayName == false) {
displayName = req.query.accountId;
}
res.json(
[
{
"id": req.query.accountId,
"displayName": displayName,
"externalAuths": {}
},
{
"id": "SubtoLawin_LOL123",
"displayName": "Subscribe to Lawin on YouTube!",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "SubtoLawin_LOL123",
"externalDisplayName": "YouTube-Lawin",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "SubtoLawin_LOL123",
"externalDisplayName": "YouTube-Lawin",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "Followlawin_LOL123",
"displayName": "Follow @lawin_010 on twitter!",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "Followlawin_LOL123",
"externalDisplayName": "Twitter-lawin_010",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "Followlawin_LOL123",
"externalDisplayName": "Twitter-lawin_010",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "NINJALOL_1238",
"displayName": "Ninja",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "NINJALOL_1238",
"externalDisplayName": "Ninja",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "NINJALOL_1238",
"externalDisplayName": "Ninja",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "TFUELOL_1238",
"displayName": "Tfue",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "TFUELOL_1238",
"externalDisplayName": "Tfue",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "TFUELOL_1238",
"externalDisplayName": "Tfue",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "ALIALOL_1238",
"displayName": "Ali-A",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "ALIALOL_1238",
"externalDisplayName": "Ali-A",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "ALIALOL_1238",
"externalDisplayName": "Ali-A",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "DAKOTAZLOL_1238",
"displayName": "Dark",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "DAKOTAZLOL_1238",
"externalDisplayName": "Dark",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "DAKOTAZLOL_1238",
"externalDisplayName": "Dark",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "SYPHERPKLOL_1238",
"displayName": "SypherPK",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "SYPHERPKLOL_1238",
"externalDisplayName": "SypherPK",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "SYPHERPKLOL_1238",
"externalDisplayName": "SypherPK",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
},
{
"id": "NICKEH30LOLL_2897669",
"displayName": "Nick Eh 30",
"externalAuths": {
"xbl": {
"type": "xbl",
"externalAuthIdType": "xuid",
"accountId": "NICKEH30LOLL_2897669",
"externalDisplayName": "Nick Eh 30",
"authIds": [{
"id": "0",
"type": "xuid"
}]
},
"psn": {
"type": "psn",
"externalAuthId": "0",
"externalAuthIdType": "psn_user_id",
"accountId": "NICKEH30LOLL_2897669",
"externalDisplayName": "Nick Eh 30",
"authIds": [{
"id": "0",
"type": "psn_user_id"
}]
}
}
}
]
)
})
express.get("/account/api/public/account/:accountId", async (req, res) => {
var displayName = config.Config.displayName;
if (config.Config.bUseConfigDisplayName == false) {
displayName = req.params.accountId;
}
res.json({
"id": req.params.accountId,
"displayName": displayName,
"name": "Lawin",
"email": displayName + "@lawin.com",
"failedLoginAttempts": 0,
"lastLogin": new Date().toISOString(),
"numberOfDisplayNameChanges": 0,
"ageGroup": "UNKNOWN",
"headless": false,
"country": "US",
"lastName": "Server",
"preferredLanguage": "en",
"canUpdateDisplayName": false,
"tfaEnabled": false,
"emailVerified": true,
"minorVerified": false,
"minorExpected": false,
"minorStatus": "UNKNOWN"
})
})
express.get("/account/api/public/account/*/externalAuths", async (req, res) => {
res.json([])
})
express.delete("/account/api/oauth/sessions/kill", async (req, res) => {
res.status(204);
res.end();
})
express.delete("/account/api/oauth/sessions/kill/*", async (req, res) => {
res.status(204);
res.end();
})
express.get("/account/api/oauth/verify", async (req, res) => {
var displayName = config.Config.displayName;
if (config.Config.bUseConfigDisplayName == false) {
displayName = Memory_CurrentAccountID
}
res.json({
"token": "lawinstokenlol",
"session_id": "3c3662bcb661d6de679c636744c66b62",
"token_type": "bearer",
"client_id": "lawinsclientidlol",
"internal_client": true,
"client_service": "fortnite",
"account_id": Memory_CurrentAccountID,
"expires_in": 28800,
"expires_at": "9999-12-02T01:12:01.100Z",
"auth_method": "exchange_code",
"display_name": displayName,
"app": "fortnite",
"in_app_id": Memory_CurrentAccountID,
"device_id": "lawinsdeviceidlol"
})
})
express.post("/account/api/oauth/token", async (req, res) => {
var displayName = config.Config.displayName;
if (config.Config.bUseConfigDisplayName == false) {
Memory_CurrentAccountID = req.body.username || "LawinServer"
displayName = req.body.username || "LawinServer"
}
res.json({
"access_token": "lawinstokenlol",
"expires_in": 28800,
"expires_at": "9999-12-02T01:12:01.100Z",
"token_type": "bearer",
"refresh_token": "lawinstokenlol",
"refresh_expires": 86400,
"refresh_expires_at": "9999-12-02T01:12:01.100Z",
"account_id": Memory_CurrentAccountID,
"client_id": "lawinsclientidlol",
"internal_client": true,
"client_service": "fortnite",
"displayName": displayName,
"app": "fortnite",
"in_app_id": Memory_CurrentAccountID,
"device_id": "lawinsdeviceidlol"
})
})
express.post("/account/api/oauth/exchange", async (req, res) => {
res.json({})
})
express.get("/account/api/epicdomains/ssodomains", async (req, res) => {
res.json([
"unrealengine.com",
"unrealtournament.com",
"fortnite.com",
"epicgames.com"
])
})
express.post("/fortnite/api/game/v2/tryPlayOnPlatform/account/*", async (req, res) => {
res.setHeader("Content-Type", "text/plain");
res.send(true);
})
module.exports = express;

59
structure/version.js Normal file
View File

@@ -0,0 +1,59 @@
const Express = require("express");
const express = Express.Router();
express.get("/fortnite/api/version", async (req, res) => {
res.json({
"app": "fortnite",
"serverDate": new Date().toISOString(),
"overridePropertiesVersion": "unknown",
"cln": "17951730",
"build": "444",
"moduleName": "Fortnite-Core",
"buildDate": "2021-10-27T21:00:51.697Z",
"version": "18.30",
"branch": "Release-18.30",
"modules": {
"Epic-LightSwitch-AccessControlCore": {
"cln": "17237679",
"build": "b2130",
"buildDate": "2021-08-19T18:56:08.144Z",
"version": "1.0.0",
"branch": "trunk"
},
"epic-xmpp-api-v1-base": {
"cln": "5131a23c1470acbd9c94fae695ef7d899c1a41d6",
"build": "b3595",
"buildDate": "2019-07-30T09:11:06.587Z",
"version": "0.0.1",
"branch": "master"
},
"epic-common-core": {
"cln": "17909521",
"build": "3217",
"buildDate": "2021-10-25T18:41:12.486Z",
"version": "3.0",
"branch": "TRUNK"
}
}
});
})
express.get("/fortnite/api/v2/versioncheck/*", async (req, res) => {
res.json({
"type": "NO_UPDATE"
})
})
express.get("/fortnite/api/v2/versioncheck*", async (req, res) => {
res.json({
"type": "NO_UPDATE"
})
})
express.get("/fortnite/api/versioncheck*", async (req, res) => {
res.json({
"type": "NO_UPDATE"
})
})
module.exports = express;