From f7a20f5bc08f957de7d9419e2590cc3934d58f92 Mon Sep 17 00:00:00 2001 From: PRO100KatYT <67335438+PRO100KatYT@users.noreply.github.com> Date: Fri, 4 Nov 2022 20:51:06 +0100 Subject: [PATCH] New config option: Enable all existing StW events! --- Config/config.ini | 4 ++- README.md | 2 +- structure/timeline.js | 79 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+), 2 deletions(-) diff --git a/Config/config.ini b/Config/config.ini index 641ed1b..f1c3124 100644 --- a/Config/config.ini +++ b/Config/config.ini @@ -5,8 +5,10 @@ bUseConfigDisplayName=false displayName=LawinServer [Profile] -# If this is set to true, every BR and StW seasonal quest will be on complete. Works for Battle Royale from Season 3 to Season 20 and for Save the World from Season 2 to Season X. +# If this is set to true, every BR and StW seasonal quest will be on complete. Works for Battle Royale from Season 3 to Season 21 and for Save the World from Season 2 to Season X. bCompletedSeasonalQuests=false +# If this is set to true, all Save the World events will be displayed in lobby. +bAllSTWEventsActivated=false [GameServer] # Matchmaker gameserver config, you can use this to connect to gameservers like rift (titanium), fortmp, etc... (they have to be hosting though). diff --git a/README.md b/README.md index 3f3b0af..d4d2404 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ - Changing items edit styles - Support a Creator with specific codes - Fully working daily challenges system (New daily challenge every day, replacing daily challenges, etc...) -- Seasonal Quests from Season 3 up to Season 20 (Can change) +- Seasonal Quests from Season 3 up to Season 21 (Can change) - Purchasable battle pass from Season 2 to Season 10 (Can change) - Discovery Tab diff --git a/structure/timeline.js b/structure/timeline.js index aa65a9f..2029694 100644 --- a/structure/timeline.js +++ b/structure/timeline.js @@ -1,6 +1,10 @@ const Express = require("express"); const express = Express.Router(); const functions = require("./functions.js"); +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()); express.get("/fortnite/api/calendar/v1/timeline", async (req, res) => { const memory = functions.GetVersionInfo(req); @@ -1062,6 +1066,81 @@ express.get("/fortnite/api/calendar/v1/timeline", async (req, res) => { }) } + if (config.Profile.bAllSTWEventsActivated == true) { + var Events = [ + "EventFlag.Blockbuster2018", + "EventFlag.Blockbuster2018Phase1", + "EventFlag.Blockbuster2018Phase2", + "EventFlag.Blockbuster2018Phase3", + "EventFlag.Blockbuster2018Phase4", + "EventFlag.Fortnitemares", + "EventFlag.FortnitemaresPhase1", + "EventFlag.FortnitemaresPhase2", + "EventFlag.Frostnite", + "EventFlag.HolidayDeco", + "EventFlag.Horde", + "EventFlag.Mayday", + "EventFlag.Outpost", + "EventFlag.Phoenix.Adventure", + "EventFlag.Phoenix.Fortnitemares", + "EventFlag.Phoenix.Fortnitemares.Clip", + "EventFlag.Phoenix.NewBeginnings", + "EventFlag.Phoenix.NewBeginnings.SpringTraining", + "EventFlag.Phoenix.RoadTrip", + "EventFlag.Phoenix.Winterfest", + "EventFlag.Phoenix.Winterfest.GhostOfChristmas", + "EventFlag.RoadTrip2018", + "EventFlag.STWBrainstorm", + "EventFlag.STWFennix", + "EventFlag.STWIrwin", + "EventFlag.Season10.Phase2", + "EventFlag.Season10.Phase3", + "EventFlag.Season11.Fortnitemares.Quests.Phase1", + "EventFlag.Season11.Fortnitemares.Quests.Phase2", + "EventFlag.Season11.Fortnitemares.Quests.Phase3", + "EventFlag.Season11.Fortnitemares.Quests.Phase4", + "EventFlag.Season11.Frostnite", + "EventFlag.Season11.WinterFest.Quests.Phase1", + "EventFlag.Season11.WinterFest.Quests.Phase2", + "EventFlag.Season11.WinterFest.Quests.Phase3", + "EventFlag.Season12.NoDancing.Quests", + "EventFlag.Season12.Spies.Quests", + "EventFlag.Season9.Phase1", + "EventFlag.Season9.Phase2", + "EventFlag.Spring2018Phase1", + "EventFlag.Spring2018Phase2", + "EventFlag.Spring2018Phase3", + "EventFlag.Spring2018Phase4", + "EventFlag.Spring2019", + "EventFlag.Spring2019.Phase1", + "EventFlag.Spring2019.Phase2", + "EventFlag.Starlight", + "EventFlag.StormKing.Landmark", + "EventFlag.YarrrTwo" + ] + + for (var i = 0; i < Events.length; i++) { + var Event = Events[i]; + var bAlreadyExists = false; + + for (var x = 0; x < activeEvents.length; x++) { + var ActiveEvent = activeEvents[x]; + if (ActiveEvent.eventType == Event) { + bAlreadyExists = true; + } + } + + if (bAlreadyExists == false) { + activeEvents.push( + { + "eventType": Event, + "activeUntil": "9999-01-01T00:00:00.000Z", + "activeSince": "2020-01-01T00:00:00.000Z" + }) + } + } + } + res.json({ "channels": { "client-matchmaking": {