Using account password instead of GJP + Leaderboard CSS fix (#151)

* password instead of gjp + css fix

* Modified account warning

Co-authored-by: tildeman <luucongthehien@gmail.com>
This commit is contained in:
H~~~~~~~~ 2021-05-27 19:30:56 +07:00 committed by GitHub
parent 3452ac1621
commit a025a8dac9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 8 deletions

View file

@ -173,8 +173,8 @@ function leaderboard(val) {
<div class="center ranking">
${x.icon.icon == -1 && type == "accurate" ? `<img class="spaced" src="./assets/trophies/${trophies.findIndex(z => y+1 <= z) + 1}.png" height="150%" style="margin-bottom: 0%; transform:scale(1.1)">` :
`<img class="spaced lazyLoad" data-src="./icon/icon?form=${x.icon.form}&icon=${x.icon.icon}&col1=${x.icon.col1}&col2=${x.icon.col2}&glow=${x.icon.glow}&size=auto" height="150%" style="margin-bottom: 0%; transform:scale(1.1)">`}
<h2 class="small" style="margin-top: 2%">${y+1}</h2>
`<img class="spaced lazyLoad" data-src="./icon/icon?form=${x.icon.form}&icon=${x.icon.icon}&col1=${x.icon.col1}&col2=${x.icon.col2}&glow=${x.icon.glow}&size=auto" height="150%" style="margin-bottom: 0%; transform:scale(1.1); margin-top: 30%;">`}
<h2 class="small" style="margin-top: 20%">${y+1}</h2>
</div>
</div>`)
})

View file

@ -134,19 +134,22 @@ directories.forEach(d => {
fs.readdirSync('./api/' + d).forEach(x => {if (x.includes('.')) app.run[x.split('.')[0]] = require('./api/' + d + "/" + x) })
})
app.xor = new XOR() //why complicated gjp stuff just xor it
try {
const secrets = require("./misc/secretStuff.json")
app.id = secrets.id
app.gjp = secrets.gjp
app.password = secrets.password
app.gjp = app.xor.encrypt(app.password)
app.sheetsKey = secrets.sheetsKey
if (app.id == "account id goes here" || app.gjp == "account gjp goes here") console.warn("Warning: No account ID and/or GJP has been provided in secretStuff.json! These are required for level leaderboards to work.")
if (app.id == "account id goes here" || app.password == "account password goes here") console.warn("Warning: No account ID and/or password has been provided in secretStuff.json! These are required for level leaderboards to work.")
if (app.sheetsKey.startsWith("google sheets api key")) app.sheetsKey = undefined
}
catch(e) {
app.id = 0
app.gjp = 0
console.warn("Warning: secretStuff.json has not been created! These are required for level leaderboards to work.")
console.warn("Warning: secretStuff.json has not been created! This file is required for level leaderboards to work.")
}
app.parseResponse = function (responseBody, splitter) {
@ -160,8 +163,6 @@ app.parseResponse = function (responseBody, splitter) {
return res
}
app.xor = new XOR()
//xss bad
app.clean = function(text) {if (!text || typeof text != "string") return text; else return text.replace(/&/g, "&#38;").replace(/</g, "&#60;").replace(/>/g, "&#62;").replace(/=/g, "&#61;").replace(/"/g, "&#34;").replace(/'/g, "&#39;")}

View file

@ -1,5 +1,5 @@
{
"id": "account id goes here",
"gjp": "account gjp goes here",
"password": "account password goes here",
"sheetsKey": "google sheets api key (for accurate leaderboard - delete this line if you don't need it)"
}