diff --git a/.gitignore b/.gitignore index 469feb6..4faa183 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,4 @@ typings/ .env # next.js build output -.next -misc/secretStuff.json -misc/secretStuff.json +.next \ No newline at end of file diff --git a/api/messages/fetchMessage.js b/api/messages/fetchMessage.js index a69361e..af179e0 100644 --- a/api/messages/fetchMessage.js +++ b/api/messages/fetchMessage.js @@ -26,13 +26,14 @@ module.exports = async (app, req, res, api) => { msg.playerID = x[3] msg.accountID = x[2] msg.author = x[6] - msg.subject = Buffer.from(x[4], "base64").toString() + msg.subject = Buffer.from(x[4], "base64").toString().replace(/^Re: ☆/, "Re: ") msg.content = xor.decrypt(x[5], 14251) msg.date = x[7] + app.config.timestampSuffix - if (msg.subject.endsWith("☆")) { - msg.subject = msg.subject.slice(0, -1) - msg.browserColor = true - } + if (msg.subject.endsWith("☆") || msg.subject.startsWith("☆")) { + if (msg.subject.endsWith("☆")) msg.subject = msg.subject.slice(0, -1) + else msg.subject = msg.subject.slice(1) + msg.browserColor = true + } return res.status(200).send(msg) }) diff --git a/api/messages/getMessages.js b/api/messages/getMessages.js index da67e1d..d306701 100644 --- a/api/messages/getMessages.js +++ b/api/messages/getMessages.js @@ -33,11 +33,12 @@ module.exports = async (app, req, res, api) => { msg.playerID = x[3] msg.accountID = x[2] msg.author = x[6] - msg.subject = Buffer.from(x[4], "base64").toString() + msg.subject = Buffer.from(x[4], "base64").toString().replace(/^Re: ☆/, "Re: ") msg.date = x[7] + app.config.timestampSuffix msg.unread = x[8] != "1" - if (msg.subject.endsWith("☆")) { - msg.subject = msg.subject.slice(0, -1) + if (msg.subject.endsWith("☆") || msg.subject.startsWith("☆")) { + if (msg.subject.endsWith("☆")) msg.subject = msg.subject.slice(0, -1) + else msg.subject = msg.subject.slice(1) msg.browserColor = true } diff --git a/api/messages/sendMessage.js b/api/messages/sendMessage.js index 6afcad2..e194c49 100644 --- a/api/messages/sendMessage.js +++ b/api/messages/sendMessage.js @@ -9,7 +9,7 @@ module.exports = async (app, req, res, api) => { if (!req.body.accountID) return res.status(400).send("No account ID provided!") if (!req.body.password) return res.status(400).send("No password provided!") - let subject = new Buffer(req.body.subject ? (req.body.subject.slice(0, 50) + (req.body.color ? "☆" : "")) : "No subject").toString('base64').replace(/\//g, '_').replace(/\+/g, "-") + let subject = new Buffer(req.body.subject ? (req.body.color ? "☆" : "") + (req.body.subject.slice(0, 50)) : (req.body.color ? "☆" : "") + "No subject").toString('base64').replace(/\//g, '_').replace(/\+/g, "-") let body = xor.encrypt(req.body.message.slice(0, 300), 14251) let params = { diff --git a/api/post/postComment.js b/api/post/postComment.js index 7a0f4be..16ae4be 100644 --- a/api/post/postComment.js +++ b/api/post/postComment.js @@ -46,13 +46,14 @@ module.exports = async (app, req, res) => { params.chk = chk request.post(app.endpoint + 'uploadGJComment21.php', { - form: params + form: params, + headers: {'x-forwarded-for': '255.255.255.255'} // prevent pesky ip bans }, function (err, resp, body) { if (err) return res.status(400).send("The Geometry Dash servers returned an error! Perhaps they're down for maintenance") if (!body || body == "-1") return res.status(400).send("The Geometry Dash servers rejected your comment! Try again later, or make sure your username and password are entered correctly.") if (body.startsWith("temp")) { let banStuff = body.split("_") - return res.status(400).send(`You have been banned from commenting for ${(parseInt(banStuff[1]) / 86400).toFixed(0)} days. Reason: ${banStuff[2]}`) + return res.status(400).send(`You have been banned from commenting for ${(parseInt(banStuff[1]) / 86400).toFixed(0)} days. Reason: ${banStuff[2] || "None"}`) } res.status(200).send(`Comment posted to level ${params.levelID} with ID ${body}`) rateLimit[req.body.username] = Date.now(); diff --git a/assets/css/browser.css b/assets/css/browser.css index 2fcf0ff..eb1ef6a 100644 --- a/assets/css/browser.css +++ b/assets/css/browser.css @@ -1072,6 +1072,7 @@ input::-webkit-inner-spin-button { -webkit-animation: spin 2s linear infinite; -moz-animation: spin 2s linear infinite; animation: spin 2s linear infinite; + mix-blend-mode: luminosity; } @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } diff --git a/assets/css/iconkit.css b/assets/css/iconkit.css index 7dbb4f0..349c03b 100644 --- a/assets/css/iconkit.css +++ b/assets/css/iconkit.css @@ -351,6 +351,7 @@ input:focus, select:focus, textarea:focus, button:focus { -webkit-animation: spin 2s linear infinite; -moz-animation: spin 2s linear infinite; animation: spin 2s linear infinite; + mix-blend-mode: luminosity; } @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } diff --git a/html/messages.html b/html/messages.html index 8f02d6e..fc78bf7 100644 --- a/html/messages.html +++ b/html/messages.html @@ -6,7 +6,7 @@ - + @@ -47,7 +47,7 @@