Merge #31
@@ -1,10 +1,10 @@
|
|||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
global.bds_api_start = true
|
global.bds_api_start = true:
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const bds = require("../index");
|
const bds = require("../index");
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const app = express();
|
const app = express();
|
||||||
const path = require("path")
|
const path = require("path");
|
||||||
var cors = require('cors');
|
var cors = require('cors');
|
||||||
const rateLimit = require("express-rate-limit");
|
const rateLimit = require("express-rate-limit");
|
||||||
|
|
||||||
|
@@ -8,13 +8,13 @@ module.exports.checkUser = (USERNAME) => {
|
|||||||
console.log(`Create file in with name: ${require("../index").bds_dir}/telegram_admin.json`)
|
console.log(`Create file in with name: ${require("../index").bds_dir}/telegram_admin.json`)
|
||||||
}
|
}
|
||||||
var adm = JSON.parse(admins);
|
var adm = JSON.parse(admins);
|
||||||
for(index in adm){
|
for(check_ in adm){
|
||||||
if (USERNAME == index){
|
if (USERNAME == check_){
|
||||||
return true
|
return true
|
||||||
} else if (index == "sh23_bot_not_config"){
|
} else if (check_ == "sh23_bot_not_config"){
|
||||||
console.warn("Allow all")
|
console.warn("Allow all")
|
||||||
return true
|
return true
|
||||||
}; index++;
|
}; check_++;
|
||||||
};
|
};
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
12
index.js
12
index.js
@@ -161,8 +161,8 @@ if (!(fs.existsSync(log_dir))){
|
|||||||
* @example change_platform("bedrock")
|
* @example change_platform("bedrock")
|
||||||
*/
|
*/
|
||||||
function platform_update(plate){
|
function platform_update(plate){
|
||||||
if (plate === "java") true
|
if (plate === "java") complet_ = true
|
||||||
else if (plate === "bedrock") true
|
else if (plate === "bedrock") complet_ = true
|
||||||
else throw new console.error(`platform not identified or does not exist, ${plate} informed platform`);
|
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")
|
const bds_config = path.join(bds_dir, "bds_config.json")
|
||||||
try {
|
try {
|
||||||
@@ -321,12 +321,12 @@ module.exports.token_register = () => {
|
|||||||
fs.readFile(path.join(bds_dir, "bds_tokens.json"), "utf8", function (err, data){
|
fs.readFile(path.join(bds_dir, "bds_tokens.json"), "utf8", function (err, data){
|
||||||
if (err){console.log(err);}
|
if (err){console.log(err);}
|
||||||
else {
|
else {
|
||||||
obj = JSON.parse(data);
|
objeto = JSON.parse(data);
|
||||||
var count = Object.keys(obj).length;
|
var count = Object.keys(obj).length;
|
||||||
var teste = {count, token};
|
var teste = {count, token};
|
||||||
obj.push(teste);
|
objeto.push(teste);
|
||||||
json = JSON.stringify(obj);
|
json_ = JSON.stringify(objeto);
|
||||||
fs.writeFileSync(path.join(bds_dir, "bds_tokens.json"), json, "utf8");}
|
fs.writeFileSync(path.join(bds_dir, "bds_tokens.json"), json_, "utf8");}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@@ -66,11 +66,10 @@ module.exports.Drive_backup = () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
zip.writeZip(name);
|
zip.writeZip(name);
|
||||||
let es = 0;
|
let es = 1;
|
||||||
for(es == "-0";es++;){
|
for(es == "0";es++;){
|
||||||
if (!(status_b)) break
|
if (!(status_b)) break
|
||||||
}
|
}
|
||||||
delete(status_b)
|
|
||||||
const js_ = {
|
const js_ = {
|
||||||
"file_path": name,
|
"file_path": name,
|
||||||
"file_name": `bds_backup_World_${today}.zip`,
|
"file_name": `bds_backup_World_${today}.zip`,
|
||||||
|
@@ -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})
|
start_server.stdout.on("data", function(data){global.bds_log_string += data})
|
||||||
Storage.setItem("bds_status", true);
|
Storage.setItem("bds_status", true);
|
||||||
global.bds_server_string = start_server;
|
global.bds_server_string = start_server;
|
||||||
|
Reference in New Issue
Block a user