Skip to content

Commit 01e5bee

Browse files
committed
"Big update" (24h Shop, Update Checker etc)
1 parent eca213e commit 01e5bee

File tree

13 files changed

+108
-17
lines changed

13 files changed

+108
-17
lines changed

CloudStorage/DefaultGame.ini

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,17 @@ bEnableCreativeMode=false ; Change "false" to "true" if u want Enable Creative s
5050

5151
+TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="40D1ADD648EDBD000A8F7E88E8D90341", NativeString="ITEM SHOP", LocalizedStrings=(("en","Item Shop")))
5252

53+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="NetworkConnectionLost", NativeString="Network Connection Lost", LocalizedStrings=(("en","https://discord.gg/PmYMpY9thJ")))
54+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="NetworkErrors", Key="ReturnToMainMenuTimeout", NativeString="Ack! We lost our connection to the match. Sorry about that. Make sure your internet connection is still good and try again. If it keeps up, visit {CheckStatusURL}.", LocalizedStrings=(("en","https://discord.gg/PmYMpY9thJ")))
55+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="C87986DE4542C0450F7EA1AC940B8F0D", NativeString="DRAT! WE'RE SORRY", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
56+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="4A40FB5E4D1A000D740EB18B21C70CE9", NativeString="UH OH! SOMETHING GOOFED", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
57+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="1B9B2D834DA0883E9514348620A95123", NativeString="WHOOPS!", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
58+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="E1FD8EAB445872DB7AF2209988DA1C93", NativeString="THAT WASN'T SUPPOSED TO HAPPEN", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
59+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="E211A281448782354CD492AFB98CCE7B", NativeString="WE HIT A ROADBLOCK", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
60+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="96CCC52841C1364F2BB12184E3CB2396", NativeString="NOT THE LLAMA YOU'RE LOOKING FOR", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
61+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="47218EFD4023FB7C729C71A3A83FF01D", NativeString="THERE WAS A PROBLEM", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
62+
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="10D2167A4B5AFCAB75963CBC54D06038", NativeString="THERE WAS AN ERROR", LocalizedStrings=(("ar","https://discord.gg/PmYMpY9thJ"),("en","https://discord.gg/PmYMpY9thJ"),("de","https://discord.gg/PmYMpY9thJ"),("es","https://discord.gg/PmYMpY9thJ"),("es-419","https://discord.gg/PmYMpY9thJ"),("fr","https://discord.gg/PmYMpY9thJ"),("it","https://discord.gg/PmYMpY9thJ"),("ja","https://discord.gg/PmYMpY9thJ"),("ko","https://discord.gg/PmYMpY9thJ"),("pl","https://discord.gg/PmYMpY9thJ"),("pt-BR","https://discord.gg/PmYMpY9thJ"),("ru","ОШИБКА"),("tr","https://discord.gg/PmYMpY9thJ"),("zh-CN","https://discord.gg/PmYMpY9thJ"),("zh-Hant","https://discord.gg/PmYMpY9thJ")))
63+
5364
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="930565094674D02FD5511282C666EB04", NativeString="SAVE THE WORLD", LocalizedStrings=(("ar", "UNAVAILABLE"),("en", "UNAVAILABLE"),("de", "UNAVAILABLE"),("es", "UNAVAILABLE"),("es-419", "UNAVAILABLE"),("fr", "UNAVAILABLE"),("it", "UNAVAILABLE"),("ja", "UNAVAILABLE"),("ko", "UNAVAILABLE"),("pl", "UNAVAILABLE"),("pt-BR", "UNAVAILABLE"),("ru", "UNAVAILABLE"),("tr", "UNAVAILABLE"),("zh-CN", "UNAVAILABLE"),("zh-Hant", "UNAVAILABLE")))
5465
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="226846CB47F043C86848BBBD8394B556", NativeString="SAVE THE WORLD", LocalizedStrings=(("ar", "UNAVAILABLE"),("en", "UNAVAILABLE"),("de", "UNAVAILABLE"),("es", "UNAVAILABLE"),("es-419", "UNAVAILABLE"),("fr", "UNAVAILABLE"),("it", "UNAVAILABLE"),("ja", "UNAVAILABLE"),("ko", "UNAVAILABLE"),("pl", "UNAVAILABLE"),("pt-BR", "UNAVAILABLE"),("ru", "UNAVAILABLE"),("tr", "UNAVAILABLE"),("zh-CN", "UNAVAILABLE"),("zh-Hant", "UNAVAILABLE")))
5566
# +TextReplacements=(Category=Game, bIsMinimalPatch=True, Namespace="", Key="0BDA5AB64D20E843B2CF009897EBA8FC", NativeString="BATTLE ROYALE", LocalizedStrings=(("ar", "BATTLE ROYALE"),("en", "BATTLE ROYALE"),("de", "BATTLE ROYALE"),("es", "BATTLE ROYALE"),("es-419", "BATTLE ROYALE"),("fr", "BATTLE ROYALE"),("it", "BATTLE ROYALE"),("ja", "BATTLE ROYALE"),("ko", "BATTLE ROYALE"),("pl", "BATTLE ROYALE"),("pt-BR", "BATTLE ROYALE"),("ru", "BATTLE ROYALE"),("tr", "BATTLE ROYALE"),("zh-CN", "BATTLE ROYALE"),("zh-Hant", "BATTLE ROYALE")))

Config/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414

1515
"bEnableDebugLogs": false,
16+
"bEnableRebootUser": true,
1617

1718
"//": "If you want to use the backend on reboot, leave 3551 as the port",
1819
"port": 3551,

DiscordBot/commands/Admin/delete.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
const { MessageEmbed, PermissionFlagsBits, SlashCommandBuilder } = require("discord.js");
1+
const { MessageEmbed } = require("discord.js");
22
const Users = require('../../../model/user.js');
33
const Profiles = require('../../../model/profiles.js');
4+
const SACCodes = require('../../../model/saccodes.js');
45
const config = require('../../../Config/config.json');
56

67
module.exports = {
@@ -25,6 +26,7 @@ module.exports = {
2526

2627
const username = interaction.options.getString('username');
2728
const deleteAccount = await Users.findOne({ username: username });
29+
const accountId = deleteAccount.accountId;
2830

2931
if (!deleteAccount) {
3032
await interaction.editReply({ content: "The selected user does not have **an account**", ephemeral: true });
@@ -33,6 +35,7 @@ module.exports = {
3335

3436
await Users.deleteOne({ username: username });
3537
await Profiles.deleteOne({ username: username });
38+
await SACCodes.deleteOne({ owneraccountId: accountId });
3639

3740
const embed = new MessageEmbed()
3841
.setTitle("Account deleted")

DiscordBot/commands/Admin/deletediscord.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const { MessageEmbed } = require("discord.js");
22
const Users = require('../../../model/user.js');
33
const Profiles = require('../../../model/profiles.js');
4+
const SACCodes = require('../../../model/saccodes.js');
45
const config = require('../../../Config/config.json')
56

67
module.exports = {
@@ -26,6 +27,7 @@ module.exports = {
2627
const discordId = interaction.options.getUser('username').id;
2728
const user = interaction.options.getUser('username');
2829
const deleteAccount = await Users.findOne({ discordId: discordId })
30+
const accountId = deleteAccount.accountId;
2931

3032
if (deleteAccount == null) {
3133
await interaction.editReply({ content: "The selected user does not have **an account**", ephemeral: true });
@@ -34,6 +36,7 @@ module.exports = {
3436

3537
await Users.deleteOne({ discordId: discordId })
3638
await Profiles.deleteOne({ discordId: discordId })
39+
await SACCodes.deleteOne({ owneraccountId: accountId });
3740

3841
const embed = new MessageEmbed()
3942
.setTitle("Account deleted")

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ This **project/backend** is licensed under the **BSD 3-Clause License.**
112112
## Credits
113113
### Credits to:
114114
* [Lawin](https://github.com/Lawin0129) - For the backend base (LawinServerV2)
115+
* [Momentum](https://github.com/Nexus-FN/Momentum) - For some files
115116
* [Burlone](https://github.com/burlone0) - For having modded most things, let's say he modded everything
116117
* [NotTacos](https://github.com/PhysicalDrive) - For adding the working challenges (Backend Part)
117118
* [zvivsp](https://github.com/zvivsp) - For creating the graphics

index.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const config = JSON.parse(fs.readFileSync("./Config/config.json").toString());
1010
const log = require("./structs/log.js");
1111
const error = require("./structs/error.js");
1212
const functions = require("./structs/functions.js");
13+
const CheckForUpdate = require("./structs/checkforupdate.js");
1314

1415
const app = express();
1516

@@ -46,6 +47,22 @@ global.kv = kv;
4647

4748
global.exchangeCodes = [];
4849

50+
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "./package.json")).toString());
51+
if (!packageJson) throw new Error("Failed to parse package.json");
52+
const version = packageJson.version;
53+
54+
const checkUpdates = async () => {
55+
try {
56+
await CheckForUpdate.checkForUpdate(version);
57+
} catch (err) {
58+
log.error("Failed to check for updates");
59+
}
60+
};
61+
62+
checkUpdates();
63+
64+
setInterval(checkUpdates, 60000);
65+
4966
mongoose.set('strictQuery', true);
5067

5168
mongoose.connect(config.mongodb.database, () => {

routes/auth.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,23 @@ app.post("/account/api/oauth/token", async (req, res) => {
6565
);
6666
}
6767
const { username: email, password: password } = req.body;
68-
69-
req.user = await User.findOne({ email: email.toLowerCase() }).lean();
68+
const regex = /@projectreboot\.dev$/;
69+
rebootAccount = regex.test(email);
70+
log.debug(`Reboot account: ${rebootAccount}`);
71+
if (rebootAccount && config.bEnableRebootUser) {
72+
const findUser = await User.findOne({ email: email.toLowerCase() });
73+
if (findUser) {
74+
req.user = findUser;
75+
}
76+
else {
77+
const numberWith8Digits = Math.floor(10000000 + Math.random() * 90000000);
78+
const registerUser = await functions.registerUser(numberWith8Digits, `reboot_${email.split("@")[0]}`, email, password, true);
79+
req.user = await User.findOne({ email: email.toLowerCase() });
80+
}
81+
}
82+
else {
83+
req.user = await User.findOne({ email: email.toLowerCase() }).lean();
84+
}
7085

7186
let err = () => error.createError(
7287
"errors.com.epicgames.account.invalid_account_credentials",
@@ -78,11 +93,12 @@ app.post("/account/api/oauth/token", async (req, res) => {
7893
log.debug("Invalid username or password");
7994
return err();
8095
} else {
81-
if (!await bcrypt.compare(password, req.user.password)) {
82-
log.debug("Invalid password");
83-
return err();
96+
if (!rebootAccount) {
97+
if (!(await bcrypt.compare(password, req.user.password)))
98+
return err();
8499
}
85100
}
101+
86102
break;
87103

88104
case "refresh_token":

routes/launcher.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ const app = express.Router();
33
const User = require("../model/user.js");
44
const bcrypt = require("bcrypt");
55

6-
//Api for launcher login
7-
app.post("/launcher/login", async (req, res) => {
8-
const { email, password } = req.body;
9-
6+
//Api for launcher login (If u want a POST requesto just replace "app.get" to "app.post" and "req.query" to "req.body")
7+
app.get("/launcher/login", async (req, res) => {
8+
const { email, password } = req.query;
9+
1010
if (!email) return res.status(400).send('The email was not entered.');
1111
if (!password) return res.status(400).send('The password was not entered.');
12-
12+
1313
try {
1414
const user = await User.findOne({ email: email });
1515
if (!user) return res.status(404).send('User not found.');

routes/storefront.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ const keychain = require("../responses/keychain.json");
1010

1111
app.get("/fortnite/api/storefront/v2/catalog", (req, res) => {
1212
log.debug("Request to /fortnite/api/storefront/v2/catalog");
13-
if (req.headers["user-agent"].includes("2870186")) return res.status(404).end();
13+
if (req.headers["user-agent"] == undefined) return;
14+
if (req.headers["user-agent"].includes("2870186")) {
15+
return res.status(404).end();
16+
}
17+
1418
res.json(functions.getItemShop());
1519
});
1620

routes/timeline.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ const config = JSON.parse(fs.readFileSync("./Config/config.json").toString());
66

77
app.get("/fortnite/api/calendar/v1/timeline", async (req, res) => {
88
const memory = functions.GetVersionInfo(req);
9+
10+
const todayAtMidnight = new Date();
11+
todayAtMidnight.setHours(24, 0, 0, 0)
12+
const todayOneMinuteBeforeMidnight = new Date(todayAtMidnight.getTime() - 60000);
13+
const isoDate = todayOneMinuteBeforeMidnight.toISOString();
914

1015
var activeEvents = [
1116
{
@@ -1140,11 +1145,11 @@ app.get("/fortnite/api/calendar/v1/timeline", async (req, res) => {
11401145
"seasonBegin": "2020-01-01T13:00:00Z",
11411146
"seasonEnd": "9999-01-01T14:00:00Z",
11421147
"seasonDisplayedEnd": "9999-01-01T07:30:00Z",
1143-
"weeklyStoreEnd": "9999-01-01T00:00:00Z",
1148+
"weeklyStoreEnd": isoDate,
11441149
"sectionStoreEnds": {
1145-
"Featured": "9999-01-01T00:00:00.000Z"
1150+
"Featured": isoDate
11461151
},
1147-
"dailyStoreEnd": "9999-01-01T00:00:00Z"
1152+
"dailyStoreEnd": isoDate
11481153
};
11491154

11501155
var states = [{

0 commit comments

Comments
 (0)