mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 10:52:23 +01:00
Improve lots of stuff
This commit is contained in:
@@ -4,6 +4,8 @@
|
|||||||
"daily2": "",
|
"daily2": "",
|
||||||
"daily3": "",
|
"daily3": "",
|
||||||
"daily4": "",
|
"daily4": "",
|
||||||
|
"daily5": "",
|
||||||
|
"daily6": "",
|
||||||
"featured1": "",
|
"featured1": "",
|
||||||
"featured2": ""
|
"featured2": ""
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
{
|
{
|
||||||
"season": 15,
|
"season": 0,
|
||||||
"lobby": "LobbySeason15"
|
"build": 0.0,
|
||||||
|
"CL": "",
|
||||||
|
"lobby": "LobbySeason0"
|
||||||
}
|
}
|
||||||
@@ -1,46 +1,54 @@
|
|||||||
function CheckLobbyAndSeason(req, seasondata) {
|
function CheckLobbyAndSeason(req, seasondata) {
|
||||||
// Works perfectly fine for any version
|
|
||||||
if (req.headers["user-agent"])
|
if (req.headers["user-agent"])
|
||||||
{
|
{
|
||||||
var season = req.headers["user-agent"].slice(28, 30)
|
var CL = "";
|
||||||
var seasonInt = Number(season)
|
|
||||||
|
|
||||||
if (!Number.isNaN(seasonInt))
|
if (req.headers["user-agent"]) {
|
||||||
{
|
try {
|
||||||
seasondata.season = seasonInt;
|
var BuildID = req.headers["user-agent"].split("-")[3].split(",")[0]
|
||||||
seasondata.lobby = `LobbySeason${seasonInt}`;
|
if (!Number.isNaN(Number(BuildID))) {
|
||||||
|
CL = BuildID;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isNaN(seasonInt))
|
if (Number.isNaN(Number(BuildID))) {
|
||||||
{
|
var BuildID = req.headers["user-agent"].split("-")[3].split(" ")[0]
|
||||||
var season = req.headers["user-agent"].slice(32, 34)
|
if (!Number.isNaN(Number(BuildID))) {
|
||||||
var seasonInt = Number(season)
|
CL = BuildID;
|
||||||
|
}
|
||||||
if (!Number.isNaN(seasonInt))
|
}
|
||||||
{
|
} catch (err) {
|
||||||
seasondata.season = seasonInt;
|
try {
|
||||||
seasondata.lobby = `LobbySeason${seasonInt}`;
|
var BuildID = req.headers["user-agent"].split("-")[1].split("+")[0]
|
||||||
|
if (!Number.isNaN(Number(BuildID))) {
|
||||||
|
CL = BuildID;
|
||||||
|
}
|
||||||
|
} catch (err) {}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isNaN(seasonInt))
|
try {
|
||||||
{
|
var Build = req.headers["user-agent"].split("Release-")[1].split("-")[0];
|
||||||
var season = req.headers["user-agent"].slice(52, 54)
|
|
||||||
var seasonInt = Number(season)
|
|
||||||
|
|
||||||
if (!Number.isNaN(seasonInt))
|
if (Build.split(".").length == 3) {
|
||||||
{
|
Value = Build.split(".");
|
||||||
seasondata.season = seasonInt;
|
Build = Value[0] + "." + Value[1] + Value[2];
|
||||||
seasondata.lobby = `LobbySeason${seasonInt}`;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Number.isNaN(seasonInt))
|
seasondata.season = Number(Build.split(".")[0]);
|
||||||
{
|
seasondata.build = Number(Build);
|
||||||
|
seasondata.CL = CL;
|
||||||
|
seasondata.lobby = `LobbySeason${seasondata.season}`;
|
||||||
|
|
||||||
|
if (Number.isNaN(seasondata.season)) {
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
} catch (err) {
|
||||||
seasondata.season = 2;
|
seasondata.season = 2;
|
||||||
|
seasondata.build = 2.0;
|
||||||
|
seasondata.CL = CL;
|
||||||
seasondata.lobby = "LobbyWinterDecor";
|
seasondata.lobby = "LobbyWinterDecor";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = CheckLobbyAndSeason;
|
module.exports = CheckLobbyAndSeason;
|
||||||
Reference in New Issue
Block a user