Merge #31

Merged
Sirherobrine23 merged 14 commits from main into stable 2021-02-09 17:53:17 +00:00
5 changed files with 15 additions and 16 deletions
Showing only changes of commit 705155d8cb - Show all commits

View File

@@ -1,10 +1,10 @@
module.exports = () => {
global.bds_api_start = true
global.bds_api_start = true:
const express = require("express");
const bds = require("../index");
const fs = require("fs");
const app = express();
const path = require("path")
const path = require("path");
var cors = require('cors');
const rateLimit = require("express-rate-limit");

View File

@@ -8,13 +8,13 @@ module.exports.checkUser = (USERNAME) => {
console.log(`Create file in with name: ${require("../index").bds_dir}/telegram_admin.json`)
}
var adm = JSON.parse(admins);
for(index in adm){
if (USERNAME == index){
for(check_ in adm){
if (USERNAME == check_){
return true
} else if (index == "sh23_bot_not_config"){
} else if (check_ == "sh23_bot_not_config"){
console.warn("Allow all")
return true
}; index++;
}; check_++;
};
return false
}

View File

@@ -161,8 +161,8 @@ if (!(fs.existsSync(log_dir))){
* @example change_platform("bedrock")
*/
function platform_update(plate){
if (plate === "java") true
else if (plate === "bedrock") true
if (plate === "java") complet_ = true
else if (plate === "bedrock") complet_ = true
else throw new console.error(`platform not identified or does not exist, ${plate} informed platform`);
const bds_config = path.join(bds_dir, "bds_config.json")
try {
@@ -321,12 +321,12 @@ module.exports.token_register = () => {
fs.readFile(path.join(bds_dir, "bds_tokens.json"), "utf8", function (err, data){
if (err){console.log(err);}
else {
obj = JSON.parse(data);
objeto = JSON.parse(data);
var count = Object.keys(obj).length;
var teste = {count, token};
obj.push(teste);
json = JSON.stringify(obj);
fs.writeFileSync(path.join(bds_dir, "bds_tokens.json"), json, "utf8");}
objeto.push(teste);
json_ = JSON.stringify(objeto);
fs.writeFileSync(path.join(bds_dir, "bds_tokens.json"), json_, "utf8");}
});
})
})

View File

@@ -66,11 +66,10 @@ module.exports.Drive_backup = () => {
}
});
zip.writeZip(name);
let es = 0;
for(es == "-0";es++;){
let es = 1;
for(es == "0";es++;){
if (!(status_b)) break
}
delete(status_b)
const js_ = {
"file_path": name,
"file_name": `bds_backup_World_${today}.zip`,

View File

@@ -53,7 +53,7 @@ module.exports.start = () => {
}
}
})
if (typeof bds_log_string !== "undefined"){delete(bds_log_string)}
if (typeof bds_log_string !== "undefined"){bds_log_string = ""}
start_server.stdout.on("data", function(data){global.bds_log_string += data})
Storage.setItem("bds_status", true);
global.bds_server_string = start_server;