stuff ksdjfksdjkjds

This commit is contained in:
GDColon 2019-12-31 18:51:08 -05:00
parent 451c933301
commit 201ebb0daf
8 changed files with 20 additions and 18 deletions

4
.gitignore vendored
View file

@ -63,6 +63,4 @@ typings/
.env
# next.js build output
.next
misc/secretStuff.json
misc/secretStuff.json
.next

View file

@ -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)
})

View file

@ -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
}

View file

@ -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 = {

View file

@ -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();

View file

@ -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); } }

View file

@ -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); } }

View file

@ -6,7 +6,7 @@
<script>window.dataLayer = window.dataLayer || []; function gtag() { dataLayer.push(arguments); } gtag('js', new Date()); gtag('config', 'UA-135255146-3');</script>
<link rel="icon" href="../assets/messages.png">
<meta id="meta-title" property="og:title" content="Messages">
<meta id="meta-desc" property="og:description" content="Read, write, and delete your Geometry Dash messages!">
<meta id="meta-desc" property="og:description" content="Read, write, and manage your Geometry Dash messages!">
<meta id="meta-image" name="og:image" itemprop="image" content="https://gdbrowser.com/assets/messages.png">
</head>
@ -47,7 +47,7 @@
<div id="messages" style="display: none;">
<div class="brownbox center supercenter" style="height: 85%; width: 138vh">
<h1 class="smaller center" style="font-size: 5.5vh; margin-top: 1.5%">Messages</h1>
<div class="lightBox center dragscroll" id="msgList" style="margin-bottom: 0.7%">
<div class="lightBox center" id="msgList" style="margin-bottom: 0.7%">
</div>
<div style="text-align: left">
@ -128,7 +128,7 @@
<h1 id="messageSubject" class="smaller center"
style="font-size: 5.5vh; min-height: 9%; margin-top: 1%"></h1>
<h3 id="messageAuthor" class="gold center gauntletText gdButton"></h3>
<div class="transparentBox center dragscroll" id="theMfMessage">
<div class="transparentBox center" id="theMfMessage">
<img id="messageLoad" src="../assets/loading.png" class="spin noSelect"
style="width: 10%; margin-top: 15%">
<p id="messageBody"></p>
@ -205,7 +205,6 @@
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script async type="text/javascript" src="../assets/sizecheck.js"></script>
<script type="text/javascript" src="../assets/dragscroll.js"></script>
<script>
let accountID;