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

Merged
tildeman merged 2 commits from master into master 2021-05-27 08:30:56 -04:00
3 changed files with 9 additions and 8 deletions

View file

@ -173,8 +173,8 @@ function leaderboard(val) {
<div class="center ranking"> <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)">` : ${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)">`} `<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: 2%">${y+1}</h2> <h2 class="small" style="margin-top: 20%">${y+1}</h2>
</div> </div>
</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) }) 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 { try {
const secrets = require("./misc/secretStuff.json") const secrets = require("./misc/secretStuff.json")
app.id = secrets.id app.id = secrets.id
app.gjp = secrets.gjp app.password = secrets.password
app.gjp = app.xor.encrypt(app.password)
app.sheetsKey = secrets.sheetsKey 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 if (app.sheetsKey.startsWith("google sheets api key")) app.sheetsKey = undefined
} }
catch(e) { catch(e) {
app.id = 0 app.id = 0
app.gjp = 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) { app.parseResponse = function (responseBody, splitter) {
@ -160,8 +163,6 @@ app.parseResponse = function (responseBody, splitter) {
return res return res
} }
app.xor = new XOR()
//xss bad //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;")} 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", "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)" "sheetsKey": "google sheets api key (for accurate leaderboard - delete this line if you don't need it)"
} }