From 0233b8fecbf31bcee628a0ea0833784065c05e77 Mon Sep 17 00:00:00 2001 From: oatmealine Date: Mon, 27 Jan 2020 08:00:46 +0300 Subject: [PATCH] add a bit of new variables and fixes --- src/downloadGJLevel22.ts | 2 -- src/getGJLevels21.ts | 10 +++++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/downloadGJLevel22.ts b/src/downloadGJLevel22.ts index 7025771..ab74da9 100644 --- a/src/downloadGJLevel22.ts +++ b/src/downloadGJLevel22.ts @@ -33,8 +33,6 @@ module.exports = (app) : void => { extraData += `,${level.password},${0 /* featured id */}`; response += `${hashes.hashSolo2(extraData)}#${extraData}`; - console.log(response); - res.status(200).send(response); }); }; \ No newline at end of file diff --git a/src/getGJLevels21.ts b/src/getGJLevels21.ts index b8b3997..3aca8b9 100644 --- a/src/getGJLevels21.ts +++ b/src/getGJLevels21.ts @@ -80,6 +80,10 @@ module.exports = (app) : void => { case 4: // recent levels.sort((a, b) => b.timestamp || 0 - a.timestamp || 0); break; + case 6: // featured + levels.filter(l => l.featured); + levels.sort((a, b) => b.timestamp || 0 - a.timestamp || 0); + break; case 7: // ~ M a G i C ~ levels.filter(l => { l.objects || 0 > 1000; @@ -95,6 +99,10 @@ module.exports = (app) : void => { case 12: // TODO: followed case 13: // TODO: friends levels.filter(() => false); + break; + case 16: // epic + levels.filter(l => l.epic); + levels.sort((a, b) => b.timestamp || 0 - a.timestamp || 0); } let offset = Math.max(Number(req.body.page) * levelsPerPage - 1, 0); @@ -104,7 +112,7 @@ module.exports = (app) : void => { let results = foundLevels .map(l => - `1:${l.id}:2:${l.name}:5:0:6:16:8:10:9:${l.difficulty}:10:${l.downloads}:12:1:13:21:14:${l.likes}:17:0:43:0:25:${Number(l.auto)}:18:${l.stars}:19:0:42:0:45:10:3:${l.description}:15:1:30:0:31:0:37:0:38:0:39:0:46:1:47:2:40:0:35:0` + `1:${l.id}:2:${l.name}:5:${l.version}:6:${l.userID}:8:10:9:${l.difficulty}:10:${l.downloads}:12:${l.audioTrack}:13:${l.gameVersion}:14:${l.likes}:17:${Number(l.difficulty >= 60)}:43:${Math.max(l.difficulty - 60, 0)}:25:${Number(l.auto)}:18:${l.stars}:19:${Number(l.featured)}:42:${Number(l.epic)}:45:${l.objects}:3:${l.description}:15:${l.length}:30:${l.original}:31:0:37:${l.coins}:38:${Number(l.ratedCoins)}:39:${l.requestedStars}:46:1:47:2:40:${Number(l.hasLDM)}:35:${l.songID}` ) .join('|');