mirror of
https://github.com/Lawin0129/LawinServer.git
synced 2026-01-13 02:42:22 +01:00
Add proper SAC support and fix getTheater
This commit is contained in:
37
index.js
37
index.js
@@ -172,15 +172,19 @@ express.get("/socialban/api/public/v1/*", async (req, res) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
express.get("/affiliate/api/public/affiliates/slug/:slug", async (req, res) => {
|
express.get("/affiliate/api/public/affiliates/slug/:slug", async (req, res) => {
|
||||||
if (req.params.slug.toLowerCase() == "lawin") {
|
const SupportedCodes = require("./responses/SAC.json");
|
||||||
return res.json({
|
SupportedCodes.forEach(code => {
|
||||||
"id": "Lawin",
|
if (req.params.slug.toLowerCase() == code.toLowerCase()) {
|
||||||
"slug": "lawin",
|
return res.json({
|
||||||
"displayName": "Lawin",
|
"id": code,
|
||||||
"status": "ACTIVE",
|
"slug": code,
|
||||||
"verified": false
|
"displayName": code,
|
||||||
});
|
"status": "ACTIVE",
|
||||||
}
|
"verified": false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
res.status(404);
|
res.status(404);
|
||||||
res.json({});
|
res.json({});
|
||||||
})
|
})
|
||||||
@@ -1214,11 +1218,14 @@ express.post("/fortnite/api/game/v2/profile/*/client/SetAffiliateName", async (r
|
|||||||
var QueryRevision = req.query.rvn || -1;
|
var QueryRevision = req.query.rvn || -1;
|
||||||
var StatChanged = false;
|
var StatChanged = false;
|
||||||
|
|
||||||
if (req.body.affiliateName.toLowerCase() == "lawin") {
|
const SupportedCodes = require("./responses/SAC.json");
|
||||||
profile.stats.attributes.mtx_affiliate_set_time = new Date().toISOString();
|
SupportedCodes.forEach(code => {
|
||||||
profile.stats.attributes.mtx_affiliate = req.body.affiliateName;
|
if (req.body.affiliateName.toLowerCase() == code.toLowerCase() || req.body.affiliateName == "") {
|
||||||
StatChanged = true;
|
profile.stats.attributes.mtx_affiliate_set_time = new Date().toISOString();
|
||||||
}
|
profile.stats.attributes.mtx_affiliate = req.body.affiliateName;
|
||||||
|
StatChanged = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
if (StatChanged == true) {
|
if (StatChanged == true) {
|
||||||
profile.rvn += 1;
|
profile.rvn += 1;
|
||||||
@@ -5754,7 +5761,7 @@ function getTheater(req) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
if (seasondata.season >= 16 || seasondata.build == 15.30 || seasondata.build == 15.40 || seasondata.build == 15.50) {
|
if (seasondata.season >= 16 || seasondata.build == 15.30 || seasondata.build == 15.40 || seasondata.build == 15.50) {
|
||||||
theater = theater.replaceAll(/\/Game\//g, "\/SaveTheWorld\/");
|
theater = theater.replace(/\/Game\//ig, "\/SaveTheWorld\/");
|
||||||
}
|
}
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
|
|
||||||
|
|||||||
7
responses/SAC.json
Normal file
7
responses/SAC.json
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[
|
||||||
|
"lawin",
|
||||||
|
"ti93",
|
||||||
|
"pro100katyt",
|
||||||
|
"playeereq",
|
||||||
|
"matteoki"
|
||||||
|
]
|
||||||
Reference in New Issue
Block a user