From ae9b94b4a120a8cd1a8c91b763c891c66fe8bfdf Mon Sep 17 00:00:00 2001 From: PRO100KatYT Date: Fri, 17 Dec 2021 19:59:13 +0100 Subject: [PATCH] Theater fix for 15.30+ --- index.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6cde866..2c4ee17 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,6 @@ const moment = require("moment"); const crypto = require("crypto"); const path = require("path"); const config = require("./config.json"); -const worldstw = require("./responses/worldstw.json"); const friendslist = require("./responses/friendslist.json"); const friendslist2 = require("./responses/friendslist2.json"); const keychain = require("./responses/keychain.json"); @@ -1152,6 +1151,7 @@ express.get("/content/api/pages/*", async (req, res) => { }) express.get("/fortnite/api/game/v2/world/info", async (req, res) => { + const worldstw = getTheater(req); res.json(worldstw) }) @@ -5540,6 +5540,24 @@ function getItemShop() { return catalog; } +function getTheater(req) { + const seasonchecker = require("./seasonchecker.js"); + const seasondata = require("./season.json"); + seasonchecker(req, seasondata); + + var theater = JSON.stringify(require("./responses/worldstw.json")); + + try { + if (seasondata.season >= 16 || seasondata.build == 15.30 || seasondata.build == 15.40 || seasondata.build == 15.50) { + theater = theater.replaceAll(/\/Game\//g, "\/SaveTheWorld\/"); + } + } catch (err) {} + + theater = JSON.parse(theater) + + return theater; +} + function getContentPages(req) { const seasonchecker = require("./seasonchecker.js"); const seasondata = require("./season.json");