Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
shikoshib committed Jul 24, 2023
1 parent a847d3c commit 9f7402f
Show file tree
Hide file tree
Showing 48 changed files with 2,068 additions and 78 deletions.
11 changes: 1 addition & 10 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
{
"headers": {
"Content-Type":"application/x-www-form-urlencoded",
"user-agent":"",
"Accept-Encoding":"*",
"Accept":"*/*"
},
"server":"http://www.boomlings.com/database/",
"secret":"Wmfd2893gb7"
}
{"headers":{"Content-Type":"application/x-www-form-urlencoded","user-agent":"","Accept-Encoding":"*","Accept":"*/*"},"server":"http://www.boomlings.com/database/","secret":"Wmfd2893gb7"}
38 changes: 38 additions & 0 deletions functions/blockUser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
/**
* Blocks the specified user.
* @param {*} target - Target's player ID or username.
* @param {*} username - Blocking person's player ID or username.
* @param {*} password - Blocking person's password.
*/
blockUser:
async function(target, username, password) {
if(!target) throw new Error("Please provide a target's player ID or username!");
if(!username) throw new Error("Please provide your player ID or username!");
if(!password) throw new Error("Please provide your password!");

const {gjReq} = require("../misc/gjReq.js");
const {gjWReq} = require("../misc/gjWReq.js");
const { searchUsers } = require("./searchUsers.js");

let user = await searchUsers(username);
let targetObj = await searchUsers(target);

const {gjp} = require("../misc/gjp.js");

const data = {
secret: "Wmfd2893gb7",
targetAccountID: targetObj.accountID,
accountID: user.accountID,
gjp: gjp(password)
}

let res = await gjReq("blockGJUser20", data);
if(res.data == -1) throw new Error(-1);

if(res.data == "error code: 1005") res = await gjWReq("blockUser", `${target}?user=${username}&password=${password}`);
if(res.status == 403) throw new Error(res.data.error);

return res.data;
}
}
38 changes: 38 additions & 0 deletions functions/deleteAccountPost.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
module.exports = {
/**
* Deletes the account post, specified by its ID (returned by `uploadAccountPost()` function).
* @param {*} id - The account post ID.
* @param {*} str - Deleting person's player ID or username.
* @param {*} password - Deleting person's password.
*/
deleteAccountPost:
async function(id, str, password) {
if(!id) throw new Error("Please provide an account post ID!");
if(!str) throw new Error("Please provide a user ID or name!");
if(!password) throw new Error("Please provide a password!");

const {gjReq} = require("../misc/gjReq.js");
const {gjWReq} = require("../misc/gjWReq.js");
const { searchUsers } = require("./searchUsers.js");

let user = await searchUsers(str);

const XOR = require("../misc/xor.js");
const xor = new XOR();

let data = {
accountID: user.accountID,
secret: "Wmfd2893gb7",
gjp: xor.encrypt(password, 37526),
commentID: id,
};

let res = await gjReq("deleteGJAccComment20", data);
if(res.data == -1) throw new Error(-1);

if(res.data == "error code: 1005") res = await gjWReq("deleteAccountPost", `?id=${id}&user=${str}&password=${password}`);
if(res.status == 403) throw new Error(res.data.error);

return res.data;
}
}
31 changes: 31 additions & 0 deletions functions/deleteComment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
module.exports = {
deleteComment:
async function(id, lvl, str, password) {
if(!id) throw new Error("Please provide a comment ID!");
if(!lvl) throw new Error("Please provide a level ID!");
if(!str) throw new Error("Please provide a user ID or name!");
if(!password) throw new Error("Please provide a password!");

const {gjReq} = require("../misc/gjReq.js");
const {gjWReq} = require("../misc/gjWReq.js");
const { searchUsers } = require("./searchUsers.js");

let user = await searchUsers(str);

const XOR = require("../misc/xor.js");
const xor = new XOR();

let data = {
accountID: user.accountID,
secret: "Wmfd2893gb7",
levelID: lvl,
gjp: xor.encrypt(password, 37526),
commentID: id,
};

let res = await gjReq("deleteGJComment20", data);
if(res.data == -1) throw new Error(-1);

return 1;
}
}
36 changes: 36 additions & 0 deletions functions/deleteLevel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
module.exports = {
/**
* Deletes the specified level.
* @param {*} lvl - The ID of a level to delete.
* @param {*} str - The username or player ID of a creator.
* @param {*} password - The password of a creator.
*/
deleteLevel:
async function(lvl, str, password) {
if(!lvl) throw new Error("Please provide a level ID!");
if(!str) throw new Error("Please provide a user ID or name!");
if(!password) throw new Error("Please provide a password!");

const {gjReq} = require("../misc/gjReq.js");
const {gjWReq} = require("../misc/gjWReq.js");
const { searchUsers } = require("./searchUsers.js");
const {gjp} = require("../misc/gjp.js");

let user = await searchUsers(str);

let data = {
accountID: user.accountID,
secret: "Wmfv2898gc9",
levelID: lvl,
gjp: gjp(password),
};

let res = await gjReq("deleteGJLevelUser20", data);
if(res.data == -1) throw new Error(-1);

if(res.data == "error code: 1005") res = await gjWReq("deleteLevel", `${lvl}?user=${str}&password=${password}`);
if(res.status == 403) throw new Error(res.data.error);

return res.data;
}
}
165 changes: 165 additions & 0 deletions functions/dlLevel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
module.exports = {
/**
* Downloads the level.
* @param {*} level - The level ID to download.
*/
dlLevel:
async function(level) {
const {decB64} = require("../misc/decB64.js");
const zlib = require("zlib");
if(!level) throw new Error("Please provide a level ID.");
if(isNaN(level)) throw new Error("The level parameter should be a number.");

const {gjReq} = require("../misc/gjReq.js");
const {gjWReq} = require("../misc/gjWReq.js");
const { server } = require("../config.json");

const XOR = require("../misc/xor.js");
let xor = new XOR()

const data = {
levelID: level.toString().trim(),
secret: "Wmfd2893gb7"
}

let res = await gjReq('downloadGJLevel22', data);
if(res.data == -1) throw new Error("-1 This level is not found.");

if(res.data == "error code: 1005") {
res = await gjWReq("dlLevel", level);
if(res.status == 403) throw new Error(res.data.error);
return res.data;
}

let spl = res.data.split(":");
let levelInfo = [];
for(let i =0;i<spl.length;i++) {
if(i%2!=0) {
levelInfo.push(spl[i-1]+`:`+spl[i]);
}
}

let id = levelInfo[0].split("1:")[1];
let name = levelInfo[1].split("2:")[1];
let description = decB64(levelInfo[2].split("3:")[1])
let levelStr = levelInfo[3].split("4:")[1];
let version = levelInfo[4].split("5:")[1];
let difficulty = levelInfo[7].split("9:")[1];
let downloads = levelInfo[8].split("10:")[1];
let gameVersion = levelInfo[10].split("13:")[1];
let likes = levelInfo[11].split("14:")[1];
let demonBool = levelInfo[12].split("17:")[1];
let stars = levelInfo[15].split("18:")[1];
let ftrd = levelInfo[16].split("19:")[1];
let epic = levelInfo[17].split("42:")[1];
let objs = levelInfo[18].split("45:")[1];
let length = levelInfo[19].split("15:")[1];
let copiedID = levelInfo[20].split("30:")[1];
let twoPlayer = levelInfo[21].split("31:")[1];
let uploaded = levelInfo[22].split("28:")[1];
let updated = levelInfo[23].split("29:")[1];
let coins = levelInfo[26].split("37:")[1];
let verifiedCoins = levelInfo[27].split("38:")[1];
let starsRequested = levelInfo[28].split("39:")[1];
let ldm = levelInfo[31].split("40:")[1];
let password = xor.decrypt(levelInfo[32].split("27:")[1].split("#")[0], 26364);

if(password.length == 7) password = password.replace("1", "");

let disliked = likes.includes("-") ? true : false;

let featured = Boolean(Number(ftrd));

let difficultyDecoding = {
"-10": "Auto",
"0": "Unrated",
"10": "Easy",
"20": "Normal",
"30": "Hard",
"40": "Harder",
"50": "Insane"
}

if(Boolean(Number(demonBool))) {
difficultyDecoding = {
"10": "Easy Demon",
"20": "Medium Demon",
"30": "Hard Demon",
"40": "Insane Demon",
"50": "Extreme Demon"
}
}

const lengthDecoding = {
"0": "Tiny",
"1": "Short",
"2": "Medium",
"3": "Long",
"4": "XL"
}

const decodeGameVersion = {
"1": "Pre-1.7",
"2": "Pre-1.7",
"3": "Pre-1.7",
"4": "Pre-1.7",
"5": "Pre-1.7",
"6": "Pre-1.7",
"7": "Pre-1.7",
"10": "1.7",
"18": "1.8",
"19": "1.9",
"20": "2.0",
"21": "2.1"
}

let objects;

zlib.unzip(Buffer.from(levelStr, "base64"), (err, buffer) => {
const raw_data = buffer.toString();
const objArray = raw_data.split(";");
objArray.shift();
objects = objArray.length - 1;
});

if(description == '') description = "(No description provided)";

const { getLevelByID } = require("./getLevelByID.js");
let getLvl = await getLevelByID(id);
let result = {
id: Number(id),
name: name,
description: description,
creator: getLvl.creator,
level_version: Number(version),
difficulty: difficultyDecoding[difficulty],
stars: Number(stars),
downloads: Number(downloads),
likes: Number(likes),
disliked: disliked,
length: lengthDecoding[length],
password: password,
demon: Boolean(Number(demonBool)),
featured: featured,
epic: Boolean(Number(epic)),
objects: objects,
uploaded: uploaded,
updated: updated,
stars_requested: Number(starsRequested),
game_version: decodeGameVersion[gameVersion],
ldm: Boolean(Number(ldm)),
copied: Number(copiedID),
large: Number(objs) > 40000 ? true : false,
two_p: Boolean(Number(twoPlayer)),
coins: Number(coins),
verified_coins: Boolean(Number(verifiedCoins)),
song: getLvl.song,
}

if(getLvl.pointercrate != undefined && server.includes("boomlings.com/database")) {
result.pointercrate = getLvl.pointercrate;
}

return result;
}
}
43 changes: 43 additions & 0 deletions functions/dlMessage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
/**
* Downloads the message specified by its ID.
* @param {*} id - The message ID.
* @param {*} user - The downloading person's player ID or username.
* @param {*} pass - The downloading person's password.
*/
dlMessage:
async function(id, user, pass) {
if(!id) throw new Error("Please provide a message ID!");
if(Number(id) == NaN) throw new Error("The message ID should be a number!");
if(!user) throw new Error("Please provide your player ID or username!");
if(!pass) throw new Error("Please provide your password!");

const {gjReq} = require("../misc/gjReq.js");
const {gjWReq} = require("../misc/gjWReq.js");
const {secret} = require("../config.json");
const { searchUsers } = require("./searchUsers.js");
const {gjp} = require("../misc/gjp.js");
let GJDecode = require("../misc/GJDecode.js");
let {decMessage} = GJDecode();

let userObj = await searchUsers(user);

const data = {
accountID: userObj.accountID,
gjp: gjp(pass),
secret: secret,
messageID: id
}

let res = await gjReq("downloadGJMessage20", data);
if(res.data == -1) throw new Error(-1);

if(res.data == "error code: 1005") {
res = await gjWReq("dlMessage", `${id}?user=${user}&password=${pass}`);
if(res.status == 403) throw new Error(res.data.error);
return res.data;
}

return decMessage(res.data);
}
}

0 comments on commit 9f7402f

Please sign in to comment.