Skip to content

Commit

Permalink
removed client settings till further notice
Browse files Browse the repository at this point in the history
  • Loading branch information
HybridFNBR committed May 25, 2024
1 parent a5deb63 commit 10bee7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 50 deletions.
17 changes: 3 additions & 14 deletions api/controllers/CloudStorageController.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,14 @@ module.exports = {

user: function (req, res) {
const {versionGlobal} = getVersionInfo(req);
return res.json({
"uniqueFilename": "ClientSettings.Sav",
"filename": "ClientSettings.Sav",
"hash": crypto.createHash("sha1").update(fs.readFileSync(path.join(__dirname, `../../ClientSettings/s${versionGlobal}/ClientSettings.sav`))).digest("hex"),
"hash256": crypto.createHash("sha256").update(fs.readFileSync(path.join(__dirname, `../../ClientSettings/s${versionGlobal}/ClientSettings.sav`))).digest("hex"),
"length": path.join(__dirname, `../../ClientSettings/s${versionGlobal}/ClientSettings.sav`).length,
"contentType": "text/plain",
"uploaded": fs.statSync(path.join(__dirname, `../../ClientSettings/s${versionGlobal}/ClientSettings.sav`)).mtime,
"storageType": "S3",
"doNotCache": false
})
return res.json({})
},

userFile: function async(req, res, next) {
const {versionGlobal} = getVersionInfo(req);
const ReadClientSettings = fs.readFileSync(path.join(__dirname, `../../ClientSettings/s${versionGlobal}/ClientSettings.sav`));
res.send(ReadClientSettings + `?v=64`).status(200).end();
res.status(200).send()
},

userPutFile:function (req, res, next) {
res.status(200).send()
},
};
9 changes: 0 additions & 9 deletions config/defs.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,6 @@ const {discoveryResponses} = require("../discovery/events")
return JSON.parse(jsonData);
};

const fileversionBuffer = (version, filePath) => {
const buffer = Buffer.alloc(5);
buffer.writeUInt32LE(version, 0);
buffer.fill(0, 4);
fs.writeFileSync(filePath, buffer);
}
//scuffed fix but it works.

const VersionFilter = [
"Cert",
"Live",
Expand Down Expand Up @@ -697,7 +689,6 @@ module.exports = {
loadJSON,
VersionFilter,
seasonData,
fileversionBuffer,
billboard,
CustomBackground
};
28 changes: 1 addition & 27 deletions config/http.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const NeoLog = require("../structs/NeoLog");
const fs = require('fs');
const path = require('path');
const {getVersionInfo, fileversionBuffer} = require("../config/defs")
const {getVersionInfo} = require("../config/defs")


module.exports.http = {
Expand All @@ -11,32 +11,6 @@ module.exports.http = {
'bodyParser'
],
LogURL: function (req, res, next) {
try{
const {versionGlobal} = getVersionInfo(req);
if (versionGlobal && (/^\d+$/.test(versionGlobal) || versionGlobal === "Cert" || versionGlobal === "Live" || versionGlobal === "Next")) {
const directoryPath = path.join(__dirname, `../ClientSettings/s${versionGlobal}`);
if (!fs.existsSync(directoryPath)) {
fs.mkdirSync(directoryPath, { recursive: true });
}
const filePath = path.join(directoryPath, 'ClientSettings.sav');
if (!fs.existsSync(filePath)) {
fileversionBuffer(64, filePath);
}
}
if(req.originalUrl = "/fortnite/api/cloudstorage/user/*" && req.method == "PUT"){
var rawParser = require("body-parser").raw({type: "*/*"});
req.setEncoding("latin1");
rawParser(req, res, (err) => {
req.rawBody = ""
req.on("data", (chunk) => req.rawBody += chunk)
req.on("end", () => {
fs.writeFileSync(path.join(__dirname, `../ClientSettings/s${versionGlobal}/ClientSettings.sav`), req.rawBody, 'latin1');
});
});
res.status(204).end();
}
}
catch{}
const startTime = new Date();
res.on('finish', () => {
const endTime = new Date();
Expand Down

0 comments on commit 10bee7b

Please sign in to comment.