GD Private Servers are now actually private

From now on I'm not going to be committing the servers.json file or their assets. I left in a few examples (with permission) to work off of.
This commit is contained in:
GDColon 2021-08-03 11:51:09 -04:00
parent 6e0207b5b4
commit 4c511c3c1d
44 changed files with 21 additions and 182 deletions

1
.gitignore vendored
View file

@ -1,7 +1,6 @@
# Ew
extra
package-lock.json
misc/secretStuff.json
# Logs
logs

View file

@ -32,7 +32,7 @@ If you want to disable rate limits, ip forwarding, etc you can do so by modifyin
Hold up, wait a minute... private servers are an official feature now!
If you would like to add your GDPS to GDBrowser, simply reach out to me on [Twitter](https://twitter.com/TheRealGDColon) and I'll be happy to add it (provided the server is relatively large and active)
If you would like to add your GDPS to GDBrowser, [fill out this quick form](https://forms.gle/kncuRqyKykQX42QD7) and I'll be happy to add it (provided the server is relatively large and active)
If you 100% insist on adding a private server to your own magical little fork, you can do so by adding it to **servers.json**. Simply add a new object to the array with the following information:
@ -60,6 +60,8 @@ There's also a few optional values for fine-tuning. I'll add more over time
[array] **disabled:** An array of menu buttons to "disable" (mappacks, gauntlets, daily, weekly, etc). They appear greyed out but are still clickable.
[bool] **pinned:** "Pins" the server to the top of the GDPS list. It appears above all unpinned servers and is not placed in alphabetical order.
[bool] **onePointNine:** Makes a bunch of fancy changes to better fit 1.9 servers. (removes orbs/diamonds, hides some pointless buttons, etc)
[bool] **weeklyLeaderboard:** Enables the lost but not forgotten Weekly Leaderboard, for servers that still milk it

View file

@ -64,7 +64,7 @@ module.exports = async (app, req, res, api, ID, analyze) => {
level = level.getSongInfo(app.parseResponse(songRes, '~|~'))
level.extraString = levelInfo[36]
level.data = levelInfo[4]
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.endpoint
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.server.id
if (analyze) return app.run.analyze(app, req, res, level)

View file

@ -32,7 +32,7 @@ module.exports = async (app, req, res, api, analyze) => {
let level = new Level(levelInfo, req.server, false, author).getSongInfo(song)
if (!level.id) return rejectLevel()
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.endpoint
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.server.id
if (level.author != "-") app.userCache(req.id, level.accountID, level.playerID, level.author)
function sendLevel() {

View file

@ -126,7 +126,7 @@ module.exports = async (app, req, res) => {
level.demonPosition = demonList[req.id].list.indexOf(level.id) + 1
}
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.endpoint
if (req.isGDPS) level.gdps = (req.onePointNine ? "1.9/" : "") + req.server.id
if (level.author != "-" && app.config.cacheAccountIDs) app.userCache(req.id, level.accountID, level.playerID, level.author)
//this is broken if you're not on page 0, blame robtop

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 186 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

View file

@ -11,6 +11,8 @@ let pinnedServers = serverList.filter(x => x.pinned)
let notPinnedServers = serverList.filter(x => !x.pinned).sort((a, b) => a.name.localeCompare(b.name))
app.servers = pinnedServers.concat(notPinnedServers)
app.safeServers = JSON.parse(JSON.stringify(app.servers)) // clone
app.safeServers.forEach(x => { delete x.endpoint; delete x.substitutions; delete x.overrides; delete x.disabled })
app.config = require('./settings.js')
let rlMessage = "Rate limited ¯\\_(ツ)_/¯<br><br>Please do not spam my servers with a crazy amount of requests. It slows things down on my end and stresses RobTop's servers just as much." +
@ -139,22 +141,24 @@ 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
app.xor = new XOR()
let hasSecretStuff = false
try {
const secrets = require("./misc/secretStuff.json")
hasSecretStuff = true
app.id = secrets.id
app.password = secrets.password
app.gjp = app.xor.encrypt(app.password)
app.gjp = secrets.gjp || app.xor.encrypt(secrets.password)
app.sheetsKey = secrets.sheetsKey
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 (!Number(app.id) || !secrets.password || !secrets.gjp || (secrets.password || secrets.gjp).includes("delete this line")) 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.includes("google sheets api key")) app.sheetsKey = undefined
}
catch(e) {
app.id = 0
app.gjp = 0
console.warn("Warning: secretStuff.json has not been created! This file is required for level leaderboards to work.")
if (!hasSecretStuff) console.warn("Warning: secretStuff.json has not been created! This file is required for level leaderboards to work.")
else { console.warn("There was an error parsing your secretStuff.json file!"); console.error(e) }
}
app.parseResponse = function (responseBody, splitter) {
@ -304,7 +308,7 @@ app.get("/icon/:text", function(req, res) { app.run.icon(app, req, res) })
app.get("/api/userCache", function(req, res) { res.send(app.accountCache) })
app.get("/api/achievements", function(req, res) { res.send({achievements, types: achievementTypes, shopIcons, colors: colorList }) })
app.get("/api/music", function(req, res) { res.send(music) })
app.get("/api/gdps", function(req, res) {res.send(req.query.hasOwnProperty("current") ? req.server : app.servers) })
app.get("/api/gdps", function(req, res) {res.send(req.query.hasOwnProperty("current") ? app.safeServers.find(x => req.server.id == x.id) : app.safeServers) })
app.get('/api/icons', function(req, res) {
let sample = [JSON.stringify(sampleIcons[Math.floor(Math.random() * sampleIcons.length)].slice(1))]
let iconserver = req.isGDPS ? req.server.name : undefined

View file

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

View file

@ -19,7 +19,6 @@
"authorLink": "https://www.youtube.com/channel/UClXb1w9vSL3Z0V-mUbudOnw",
"id": "22unlocked",
"endpoint": "http://smjs.eu/gd/unlock/database/",
"pinned": true,
"disabled": ["gauntlets", "mappacks", "daily", "weekly"],
"substitutions": {
"levelID": "oereoIE",
@ -38,176 +37,10 @@
"onePointNine": true,
"weeklyLeaderboard": true,
"demonList": "https://pointercrate.xyze.dev/",
"pinned": true,
"overrides": {
"getGJMapPacks21": "getGJMapPacks",
"getGJScores20": "getGJScores",
"getGJComments21": "getGJComments"
}
},
{
"name": "XGDPS",
"link": "http://xcggdpsserver.xyz/",
"author": "XcreatorGoal",
"authorLink": "https://www.youtube.com/channel/UC33L-Y8asG7gju6f-4-Cl2g",
"id": "xgdps",
"endpoint": "http://xcggdpsserver.xyz/database/",
"pinned": true,
"timestampSuffix": " ago"
},
{
"name": "GDPS Editor 2.2",
"link": "https://discord.gg/4n8n98AkSk",
"author": "iAndy_HD3",
"authorLink": "https://www.youtube.com/channel/UCleHhypAuPn2o09N4ISyBxw",
"id": "gdpseditor",
"pinned": true,
"endpoint": "http://ps.fhgdps.com/GDPSEditor22/"
},
{
"name": "WGDPS",
"link": "http://wyliegdps02.7m.pl/",
"author": "Wylie",
"authorLink": "https://www.youtube.com/channel/UCG5I4-KAW3Kwzam4svLJWBA",
"id": "wgdps",
"endpoint": "http://wyliegdps02.7m.pl/database/"
},
{
"name": "ClarifyGDPS",
"link": "https://clarifygdps.com/",
"author": "Jouca",
"authorLink": "https://www.youtube.com/channel/UCXE8HB-B4tqvI0ibjXSJ52A",
"id": "clarify",
"endpoint": "http://joucagdpss.clarifygdps.com/",
"timestampSuffix": " ago"
},
{
"name": "1.6 GDPS",
"link": "https://discord.gg/eGWMmyk",
"author": "Cylyrii",
"authorLink": "https://www.youtube.com/channel/UCY-D_PGmZtR9HTeczwBxbrw",
"id": "16gdps",
"endpoint": "http://wayveyx.x10.mx/gdps/garlic/",
"onePointNine": true,
"weeklyLeaderboard": true
},
{
"name": "CnekGDPS",
"link": "http://cnekgdps.7m.pl/index.html/",
"author": "Cnek",
"authorLink": "https://www.youtube.com/channel/UCDgrf89BjVyrUYSxFIDxafw",
"id": "cnek",
"endpoint": "http://cnekgdps.7m.pl/cnekgdpsdtb/"
},
{
"name": "Zombie Dash",
"link": "http://zombiedashoficial.ddns.net/",
"author": "Ghost Power 13",
"authorLink": "https://www.youtube.com/channel/UCC_S4bHTIGVJiCfZsKU15Gw",
"id": "zombiedash",
"endpoint": "http://zombiedashoficial.ddns.net/"
},
{
"name": "GD Gravity",
"link": "https://discord.gg/qpUJgBC",
"author": "Sai",
"authorLink": "https://youtube.com/channel/UCvYEPVUVVLDhwfHCzgVdIIg",
"id": "gravity",
"endpoint": "http://gravity5.000webhostapp.com/"
},
{
"name": "RealistikGDPS",
"link": "http://rgdps.ussr.pl/",
"author": "RealistikDash",
"authorLink": "https://www.youtube.com/c/RealistikDash",
"id": "rgdps",
"endpoint": "http://rgdps.ussr.pl/gdpsdatabase/"
},
{
"name": "Supreme GDPS",
"link": "https://discord.gg/pAU42pbREb",
"author": "Optimal",
"authorLink": "https://youtube.com/c/Optimal7",
"id": "supreme",
"endpoint": "http://ps.fhgdps.com/supremegdps1/ "
},
{
"name": "Aurora Dash",
"link": "http://aurorgdpsgd.7m.pl",
"author": "Yayi Kawaii",
"authorLink": "https://www.youtube.com/channel/UCBH8Y_3SAYB-f-k7zFXLvtA",
"id": "aurora",
"endpoint": "http://aurorgdpsgd.7m.pl/database/"
},
{
"name": "GD Multiverse",
"link": "https://discord.gg/rJtAky72xE",
"author": "Nonixgames",
"authorLink": "https://youtube.com/c/Nonixgames",
"id": "multiverse",
"endpoint": "http://gdm2021y.000webhostapp.com/database/"
},
{
"name": "Resurrection GDPS",
"link": "http://gdpsresu.000webhostapp.com/",
"author": "Switchstep",
"authorLink": "https://www.youtube.com/channel/UCg9HipnGYtfwIax4bLTTzUQ",
"id": "resurrection",
"endpoint": "http://gdpsresu.000webhostapp.com/"
},
{
"name": "SilvrPS",
"link": "https://discord.gg/p2PStYUSGM",
"author": "silverra",
"authorLink": "https://www.youtube.com/channel/UCdKNL3PFoZKBkRTo41Ss_dg",
"id": "silvrps",
"endpoint": "http://silvrragdps.7m.pl/database/"
},
{
"name": "NEON GDPS",
"link": "https://discord.gg/zu6Uv95",
"author": "PjoseP",
"authorLink": "https://www.youtube.com/c/PjoseP",
"id": "neon",
"endpoint": "http://newgdpsneon.7m.pl/database/"
},
{
"name": "VPS",
"link": "https://discord.gg/WVVZPCsGQV",
"author": "Vultra",
"authorLink": "https://www.youtube.com/channel/UC6q0dlnMosjajrkSfSsOklQ",
"id": "vps",
"endpoint": "http://ps.fhgdps.com/VGDPSNEW6942/"
},
{
"name": "Rob's Abandoned Server",
"link": "http://robtopgames.com/",
"author": "RobTop",
"authorLink": "https://www.youtube.com/channel/UCz_yk8mDSAnxJq0ar66L4sw",
"id": "robtopgames",
"endpoint": "http://robtopgames.com/database/",
"onePointNine": true,
"timestampSuffix": " ago",
"overrides": {
"getGJLevels21": "getGJLevels",
"downloadGJLevel22": "downloadGJLevel"
}
}
]