diff --git a/.Build/test/ci.js b/.Build/test/ci.js index 8cd01ac..2e7d75b 100644 --- a/.Build/test/ci.js +++ b/.Build/test/ci.js @@ -2,12 +2,12 @@ try { const bds = require("../../index"); await bds.download("latest", true); - console.log("Api:", await bds.api()); - console.log("Backup:", await bds.backup()); - console.log("Detect Server:", await bds.detect()); - console.log("Kill Server:", await bds.kill()); - console.log("Get Config:", await bds.get_config()); - console.log("Start:", await bds.start()); + console.log("Api:", bds.api()); + console.log("Backup:", bds.backup()); + console.log("Detect Server:", bds.detect()); + console.log("Kill Server:", bds.kill()); + console.log("Get Config:", bds.get_config()); + console.log("Start:", bds.start()); setTimeout(() => { console.log("Kill Server:", bds.kill()); }, 1 * 30 * 1000); diff --git a/.github/workflows/tag_version.yml b/.github/workflows/tag_version.yml index 214596f..7dea2e7 100644 --- a/.github/workflows/tag_version.yml +++ b/.github/workflows/tag_version.yml @@ -1,9 +1,8 @@ name: Npm Packages Stable and Docker Image on: - push: - tags: - - v** - - V** + release: + types: + - created env: DOCKER_ARCH: linux/amd64,linux/arm64,linux/arm/v7 @@ -11,7 +10,7 @@ env: jobs: npm: runs-on: ubuntu-latest - if: ${{ github.actor }} == ${{ github.repository_owner }} + if: ${{ github.actor }} == ${{ github.repository_owner }} && (contains('tag', ${{ github.ref }}) && contains('v', ${{ github.ref }}) || contains('V', ${{ github.ref }})) steps: - uses: actions/checkout@master - uses: actions/setup-node@v2.4.0 @@ -25,7 +24,12 @@ jobs: - name: Publish run: npm publish env: - NODE_AUTH_TOKEN: "${{ secrets.NPM_ORG_TOKEN }}" + NODE_AUTH_TOKEN: '${{ secrets.NPM_ORG_TOKEN }}' + + - name: Remove Dev Versions + run: npm run remove_dev_versions + env: + NODE_AUTH_TOKEN: '${{ secrets.NPM_ORG_TOKEN }}' docker_core: needs: [npm] diff --git a/.gitignore b/.gitignore index de9db14..99a5e25 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,7 @@ node_modules/ Bds_Maneger .dccache docs/ +the-bds-maneger-core-*.tgz # Bds Maneger Core Binaries bds_maneger diff --git a/.npmignore b/.npmignore index 99693aa..0a1aa9b 100644 --- a/.npmignore +++ b/.npmignore @@ -1,6 +1,14 @@ # Log *.log +# Develop files +.devcontainer/ +.vscode/ +.Build/ + +# Linters +.eslint* + # test files *.test *test*.js* @@ -12,5 +20,8 @@ git* .git* # Docker -.dockerignore -Docker* \ No newline at end of file +.docker* +Docker* + +# Npm +the-bds-maneger-core*.tgz \ No newline at end of file diff --git a/BdsManegerInfo.json b/BdsManegerInfo.json index 32e3166..7396513 100644 --- a/BdsManegerInfo.json +++ b/BdsManegerInfo.json @@ -8,10 +8,39 @@ "temp_host": { "url": "http://hosts.bdsmaneger.com:3020" }, - "download": { + "Fetchs": { "php": "https://raw.githubusercontent.com/The-Bds-Maneger/Php_Static_Binary/main/binarys.json", "servers": "https://raw.githubusercontent.com/The-Bds-Maneger/external_files/main/Server.json" }, + "IgnoreLog": { + "bedrock": [ + { + "value": "Running AutoCompaction", + "regex": true + } + ], + "java": [], + "pocketmine": [], + "spigot": [] + }, + "StartedServer": { + "bedrock": { + "value": "Server started", + "regex": true + }, + "java": { + "value": null, + "regex": false + }, + "pocketmine": { + "value": null, + "regex": false + }, + "spigot": { + "value": null, + "regex": false + } + }, "Servers": { "bedrock": { "stop": "stop", diff --git a/DockerConfig.yaml b/DockerConfig.yaml index d0f98f0..bc72ef5 100644 --- a/DockerConfig.yaml +++ b/DockerConfig.yaml @@ -4,7 +4,7 @@ tag: bdsmaneger/core:dev target: bdscore buildx: enable: false - platform: linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64 + platform: linux/amd64,linux/arm/v7,linux/arm64 # Docker Run envs env: @@ -47,5 +47,6 @@ ports: # More options options: build: [] - run: [] + run: + - "-v $(pwd)/Test:/root/bds_core" runArgv: [] diff --git a/Dockerfile b/Dockerfile index d50cee7..3765834 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,17 +15,6 @@ FROM bdsbase AS bdscore # Create Volume to Storage Server And Config VOLUME [ "/root/bds_core" ] -# Copy Bds Maneger Core -WORKDIR /opt/backend_core_scripts/ - -# Install Core dependencies -COPY package*.json ./ -RUN npm install - -# Copy BdsManger Core -COPY ./ ./ -RUN chmod a+x -v bin/* - # Set default ENVs to Bds Core ENV PLAYERS="5" \ WORLD_NAME="The Ultimate Server" \ @@ -40,5 +29,16 @@ ENV PLAYERS="5" \ # Bds Maneger Core required ports EXPOSE 19132/udp 19133/udp 1932/tcp +# Copy Bds Maneger Core +WORKDIR /opt/backend_core_scripts/ + +# Install Core dependencies +COPY package*.json ./ +RUN npm install + +# Copy BdsManger Core +COPY ./ ./ +RUN chmod a+x -v bin/* + # Set Entrypint ENTRYPOINT [ "node", "./bin/Docker.js" ] diff --git a/README.md b/README.md index 782c746..e88bc89 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,23 @@ # Bds Maneger Core -Create manage a server for Minecraft Bedrock, java and derivatives with an integration in NodeJs in which we deliver a versatile REST API for integration with large projects up to independent projects. +Bds Maneger Core is a javascript core in Nodejs that manages several types of server seftware for Minecraft Bedrock and Java. Bds Maneger Core has integrated with a REST API with full integration with Bds Maneger Core in addition to CLI and One bot versions for the telegram. Any contribution is welcome, but before a look at [CONTRIBUTING.md](CONTRIBUTING.md), [Bds Manager Core code of conduct](CODE_OF_CONDUCT.md) -## More important information for users before 1.10.0+ +## Requirements for Bds Maneger Core -In Version 1.11.0 there was a big change in the way to get the new settings and that left a good part of the program broken, so for those who are going to upgrade to the latest versions of Bds maneger Core will have to change the settings manually. +### All + +* [Nodejs 14+](https://nodejs.org/en/download/) +* [OpenJDK 16+](https://www.oracle.com/java/technologies/javase-jdk16-downloads.html) + +### Windows 10+ + +* [Microsoft Visual Studio C++ (The Bds Maneger Documentation)]() ## Documentation -We have a separate repository for all Bds Maneger Project documentation, link here from the main page, Repository link +We have a separate repository for all Bds Maneger Project documentation, [link here from the main page](), [Repository link](https://github.com/The-Bds-Maneger/Bds-Manager-Project-Documentation) ## Badges @@ -19,50 +26,65 @@ We have a separate repository for all Bds Maneger Project documentation, {console.log(Tokens+":", "Bds API Token:", token.token); Tokens++}); + } else { + console.log("No Tokens Found"); + } +} function StartServer(){ console.log("The entire log can be accessed via the api and/or the docker log"); @@ -13,32 +25,35 @@ function StartServer(){ ServerStarted.log(a => process.stdout.write(a)); ServerStarted.exit(process.exit); BdsCore.api(); - new CronJob("0 */1 * * *", async () => { - try { - const CurrentLocalVersion = BdsCore.getBdsConfig().server.versions[GetPlatform()], - CurrentRemoteVersion = Object.getOwnPropertyNames((await (await fetch(BdsInfo.download.servers)).json())[GetPlatform()])[0]; - if (CurrentLocalVersion !== CurrentRemoteVersion) { - let currenttime = `Hello we are starting the server upgrade from version ${CurrentLocalVersion} to version ${CurrentRemoteVersion}, you have 20 seconds to exit the server` - console.log("Update Server:", currenttime); - ServerStarted.say(currenttime); - let countdown = 20; - while (countdown > 1) { - currenttime = `${countdown} seconds remaining to stop Server!`; + ShowToken(); + if (process.env.UPDATE_SERVER === "true") { + new CronJob("0 */1 * * *", async () => { + try { + const CurrentLocalVersion = BdsCore.getBdsConfig().server.versions[GetPlatform()], + CurrentRemoteVersion = Object.getOwnPropertyNames((await (await fetch(BdsInfo.Fetchs.servers)).json())[GetPlatform()])[0]; + if (CurrentLocalVersion !== CurrentRemoteVersion) { + let currenttime = `Hello we are starting the server upgrade from version ${CurrentLocalVersion} to version ${CurrentRemoteVersion}, you have 20 seconds to exit the server` + console.log("Update Server:", currenttime); + ServerStarted.say(currenttime); + let countdown = 20; + while (countdown > 1) { + currenttime = `${countdown} seconds remaining to stop Server!`; + console.log(currenttime); + ServerStarted.say(currenttime); + countdown--; + await new Promise(resolve => setTimeout(resolve, 1000)); + } + currenttime = "Stopping the server" console.log(currenttime); ServerStarted.say(currenttime); - countdown--; - await new Promise(resolve => setTimeout(resolve, 1000)); + await new Promise(resolve => setTimeout(resolve, 600)); + ServerStarted.stop(); } - currenttime = "Stopping the server" - console.log(currenttime); - ServerStarted.say(currenttime); - await new Promise(resolve => setTimeout(resolve, 600)); - ServerStarted.stop(); + } catch (err) { + console.log(err); } - } catch (err) { - console.log(err); - } - }); + }); + } } // Check Installed Server @@ -53,22 +68,24 @@ if (Object.getOwnPropertyNames(AllVersions).filter(platform => AllVersions[platf StartServer(); }); } else { - // Check for Update - if (AllVersions[GetPlatform()] === Object.getOwnPropertyNames(Servers[GetPlatform()])[0]) { - console.log("The entire log can be accessed via the api and/or the docker log"); - const ServerStarted = BdsCore.start(); - ServerStarted.log(a => process.stdout.write(a)); - ServerStarted.exit(process.exit); - BdsCore.api(); - } else { - BdsCore.download(true, true, (err) => { - if (err) { - console.log(err); - process.exit(1); - } - StartServer(); - }); - } + (async () => { + // Check for Update + if (AllVersions[GetPlatform()] === Object.getOwnPropertyNames((await (await fetch(BdsInfo.Fetchs.servers)).json())[GetPlatform()])[0]) { + console.log("The entire log can be accessed via the api and/or the docker log"); + const ServerStarted = BdsCore.start(); + ServerStarted.log(a => process.stdout.write(a)); + ServerStarted.exit(process.exit); + BdsCore.api(); + } else { + BdsCore.download(true, true, (err) => { + if (err) { + console.log(err); + process.exit(1); + } + StartServer(); + }); + } + })(); } } else { console.log("Server is not installed, starting server implementation"); @@ -94,6 +111,7 @@ if (Object.getOwnPropertyNames(AllVersions).filter(platform => AllVersions[platf port: 19132, portv6: 19133, } + BdsCore.bds_maneger_token_register(["admin"]); BdsCore.set_config(ServerConfig); StartServer(); }); diff --git a/bin/bds_maneger.js b/bin/bds_maneger.js index 9aeb4c6..3e0fee9 100755 --- a/bin/bds_maneger.js +++ b/bin/bds_maneger.js @@ -8,10 +8,11 @@ const argv = require("minimist")(process.argv.slice(2)); if (Object.getOwnPropertyNames(argv).length <= 1) argv.help = true const bds = require("../index"); -const { valid_platform } = require("../lib/BdsSystemInfo"); +const SystemInfo = require("../lib/BdsSystemInfo"); const { bds_dir, GetServerVersion, GetPlatform, UpdatePlatform, GetServerPaths, GetPaths } = require("../lib/BdsSettings"); const commandExits = require("../lib/commandExist"); const download = require("../src/BdsServersDownload"); +const BdsConfigAndInfo = require("../BdsManegerInfo.json"); // Options const @@ -32,8 +33,8 @@ if (kill) bds.kill(); // Set Bds Platform if (server) UpdatePlatform(server); -function StartServer(){ - const { Servers } = require("../lib/ServerURL"); +async function StartServer(){ + const Servers = (await (await fetch(BdsConfigAndInfo.Fetchs.servers)).json()); // Check Server Update if (Versions[GetPlatform()] !== null) { if (Versions[GetPlatform()] !== Servers.latest[GetPlatform()]) { @@ -143,10 +144,10 @@ if (SystemCheck) { "*", "**************************************************************", "* Servers currently available:", - `* - Bedrock: ${valid_platform.bedrock}`, - `* - Java: ${valid_platform.java}`, - `* - Pocketmine-MP: ${valid_platform.pocketmine}`, - `* - JSPrismarine: ${valid_platform.jsprismarine}`, + `* - Bedrock: ${SystemInfo.valid_platform.bedrock}`, + `* - Java: ${SystemInfo.valid_platform.java}`, + `* - Pocketmine-MP: ${SystemInfo.valid_platform.pocketmine}`, + `* - JSPrismarine: ${SystemInfo.valid_platform.jsprismarine}`, "*", "**************************************************************" ]; @@ -156,38 +157,39 @@ if (SystemCheck) { // Download server if (bds_version){ - try { - if (argv.interactive) { - const LoadVersion = require("../lib/ServerURL").Servers[GetPlatform()] - const Version = Object.getOwnPropertyNames(LoadVersion) - - const StartQuestion = (Readline) => { - Readline.question("Select a version to download: ", input => { - if (Version[parseInt(input) - 1]) { - Readline.close(); - download(Version[parseInt(input) - 1], true, function(){ - if (start) return StartServer(); - console.log("Installation was successful, so start the server with the -s option"); - process.exit(0); - }) - } else { - console.log("Invalid Option"); - StartQuestion(Readline); - } - }); + (async () => { + try { + if (argv.interactive) { + const LoadVersion = (await (await fetch(BdsConfigAndInfo.Fetchs.servers)).json())[GetPlatform()] + const Version = Object.getOwnPropertyNames(LoadVersion) + + const StartQuestion = (Readline) => { + Readline.question("Select a version to download: ", input => { + if (Version[parseInt(input) - 1]) { + Readline.close(); + download(Version[parseInt(input) - 1], true, function(){ + if (start) return StartServer(); + console.log("Installation was successful, so start the server with the -s option"); + process.exit(0); + }) + } else { + console.log("Invalid Option"); + StartQuestion(Readline); + } + }); + } + + console.log(`Selected platform: ${GetPlatform()}, Total available versions: ${Version.length}`); + console.log("Option Version"); + + for (let option in Version) console.log(`${parseInt(option) + 1} -------- ${Version[option]}`); + StartQuestion(readline.createInterface({input: process.stdin,output: process.stdout})); } - - console.log(`Selected platform: ${GetPlatform()}, Total available versions: ${Version.length}`); - console.log("Option Version"); - - for (let option in Version) console.log(`${parseInt(option) + 1} -------- ${Version[option]}`); - StartQuestion(readline.createInterface({input: process.stdin,output: process.stdout})); - } - else bds.download(bds_version, true, function(){ - if (start) StartServer(); - }) - } - catch (error) {console.error(error);process.exit(165);} + else bds.download(bds_version, true, function(){ + if (start) StartServer(); + }) + } catch (error) {console.error(error);process.exit(165);} + })(); } // Start server diff --git a/bin/telegram_bot.js b/bin/telegram_bot.js index 37ff279..5073f60 100755 --- a/bin/telegram_bot.js +++ b/bin/telegram_bot.js @@ -1,11 +1,12 @@ +#!/usr/bin/env node const fs = require("fs"); const { Telegraf, Markup } = require("telegraf"); const bds = require("../index"); const { GetPlatform, GetPaths, GetTelegramToken } = require("../lib/BdsSettings"); const { GetKernel, arch, system } = require("../lib/BdsSystemInfo"); const { Detect } = require("../src/CheckKill"); -const { Servers } = require("../lib/ServerURL"); -const { CheckTelegramUser } = require("../src/UsersAndtokenChecks") +const { CheckTelegramUser } = require("../src/UsersAndtokenChecks"); +const BdsInfo = require("../BdsManegerInfo.json"); // Bot Start And Help messages const HelpAndStart = [ @@ -203,7 +204,7 @@ bot.command("download", async ctx => { ctx.reply(`Sucess install ${GetPlatform()} with version ${version}`); } else { await ctx.deleteMessage(); - const KeyboardVersion = Markup.keyboard(Object.getOwnPropertyNames(Servers[GetPlatform()]).map(version => { + const KeyboardVersion = Markup.keyboard(Object.getOwnPropertyNames((await (await fetch(BdsInfo.Fetchs.servers)).json())[GetPlatform()]).map(version => { return { text: `/download ${version}` } diff --git a/lib/BdsSettings.js b/lib/BdsSettings.js index d286ee4..75318a6 100644 --- a/lib/BdsSettings.js +++ b/lib/BdsSettings.js @@ -2,10 +2,7 @@ const { join, resolve, basename } = require("path"); const { existsSync, writeFileSync, mkdirSync, readFileSync } = require("fs"); const { homedir } = require("os"); const { valid_platform } = require("./BdsSystemInfo"); -const yaml = { - parse: require("js-yaml").load, - stringify: require("js-yaml").dump -} +const yaml = require("js-yaml"); // PATHs const home = homedir(); @@ -34,6 +31,7 @@ var Config = { platform: default_platformConfig, BackupCron: [ { + enabled: false, cron: "0 1 * * */3", Azure: false, Oracle: false, @@ -71,7 +69,6 @@ var Config = { ban: [ { username: "Steve", - telegram: true, bedrock: true, java: true, pocketmine: true, @@ -80,7 +77,6 @@ var Config = { }, { username: "Alex", - telegram: true, bedrock: true, java: true, pocketmine: true, @@ -89,7 +85,6 @@ var Config = { }, { username: "steve", - telegram: true, bedrock: true, java: true, pocketmine: true, @@ -98,7 +93,6 @@ var Config = { }, { username: "alex", - telegram: true, bedrock: true, java: true, pocketmine: true, @@ -108,17 +102,18 @@ var Config = { ], telegram: { admins: ["all_users"], + ban: ["Steve_mine_mine"], token: null } } // Config const ConfigPath = join(resolve(homedir(), "bds_core"), "BdsConfig.yaml") -function SaveConfig(){writeFileSync(ConfigPath, yaml.stringify(Config));} +function SaveConfig(){writeFileSync(ConfigPath, yaml.dump(Config));} if (existsSync(ConfigPath)) Config = { ...Config, - ...yaml.parse(readFileSync(ConfigPath, "utf8")) -}; else writeFileSync(ConfigPath, yaml.stringify(Config)) + ...yaml.load(readFileSync(ConfigPath, "utf8")) +}; else writeFileSync(ConfigPath, yaml.dump(Config)) process.on("exit", () => SaveConfig()) // Paths @@ -131,7 +126,6 @@ const ServersPaths = { bedrock: join(Config.paths.servers, "Bedrock"), java: join(Config.paths.servers, "Java"), pocketmine: join(Config.paths.servers, "Pocketmine-MP"), - jsprismarine: join(Config.paths.servers, "JSPrismarine"), dragonfly: join(Config.paths.servers, "Dragonfly_go"), spigot: join(Config.paths.servers, "Spigot") } @@ -181,9 +175,6 @@ function UpdatePlatform(platform = Config.server.platform){ } else if (/spigot/.test(platform)) { Config.server.platform = "spigot"; SaveConfig() - } else if (/jsprismarine/.test(platform)) { - Config.server.platform = "jsprismarine"; - SaveConfig() } else throw new Error("platform no Exists") return platform } diff --git a/lib/BdsSystemInfo.js b/lib/BdsSystemInfo.js index dd571ea..3fd1039 100644 --- a/lib/BdsSystemInfo.js +++ b/lib/BdsSystemInfo.js @@ -2,7 +2,11 @@ const { execSync } = require("child_process"); const { release } = require("os"); const { readdirSync } = require("fs"); const commadExist = require("./commandExist"); -const { PHPBin, Servers } = require("./ServerURL"); +const fetchSync = require("@the-bds-maneger/fetchsync"); + +// Load JSON for Server and PHP Zip files +const PHPBin = fetchSync("https://raw.githubusercontent.com/The-Bds-Maneger/Php_Static_Binary/main/binarys.json").json(), + Servers = fetchSync("https://raw.githubusercontent.com/The-Bds-Maneger/external_files/main/Server.json").json(); // System Architect (x64, aarch64 and others) var arch; diff --git a/lib/ServerURL.js b/lib/ServerURL.js deleted file mode 100644 index 7599107..0000000 --- a/lib/ServerURL.js +++ /dev/null @@ -1,5 +0,0 @@ -const fetchSync = require("@the-bds-maneger/fetchsync"); -module.exports = { - Servers: fetchSync("https://raw.githubusercontent.com/The-Bds-Maneger/external_files/main/Server.json").json(), - PHPBin: fetchSync("https://raw.githubusercontent.com/The-Bds-Maneger/Php_Static_Binary/main/binarys.json").json() -} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index bc0db4f..817e099 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@the-bds-maneger/core", - "version": "1.13.4", + "version": "1.13.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@the-bds-maneger/core", - "version": "1.13.4", + "version": "1.13.5", "license": "AGPL-3.0-or-later", "dependencies": { "@azure/storage-blob": "^12.6.0", diff --git a/package.json b/package.json index 45ab61e..4bd2878 100644 --- a/package.json +++ b/package.json @@ -19,8 +19,8 @@ "Docker": "node .Build/DockerImage.js" }, "bin": { - "bds_maneger": "./bin/bds_maneger.js", - "bds_telegram": "./bin/telegram_bot.js" + "bds_maneger": "bin/bds_maneger.js", + "bds_telegram": "bin/telegram_bot.js" }, "repository": { "type": "git", diff --git a/src/BdsBackup.js b/src/BdsBackup.js index 0689d42..171f627 100644 --- a/src/BdsBackup.js +++ b/src/BdsBackup.js @@ -11,7 +11,7 @@ function Backup() { bedrock: GetServerPaths("bedrock"), java: GetServerPaths("java"), pocketmine: GetServerPaths("pocketmine"), - jsprismarine: GetServerPaths("jsprismarine") + spigot: GetServerPaths("spigot"), } const CurrentDate = new Date(); const name = `Bds_Maneger_Core_Backups_${CurrentDate.getDate()}-${CurrentDate.getMonth()}-${CurrentDate.getFullYear()}.zip` diff --git a/src/BdsManegerServer.js b/src/BdsManegerServer.js index 4ae0efb..8da91b0 100644 --- a/src/BdsManegerServer.js +++ b/src/BdsManegerServer.js @@ -22,7 +22,9 @@ function start() { command: String, args: [], cwd: String, - env: process.env, + env: { + ...process.env + }, } // Minecraft Bedrock Oficial @@ -85,11 +87,17 @@ function start() { // Post Start if (GetPlatform() === "java") { - const eula_file = path.join(GetServerPaths("java"), "eula.txt"); - console.log(fs.readFileSync(eula_file, "utf8")); - if (fs.readFileSync(eula_file, "utf8").includes("eula=false")) { - fs.writeFileSync(eula_file, fs.readFileSync(eula_file, "utf8").replaceAll("eula=false", "eula=true")); - throw new Error("Restart application/CLI") + const eula_file_path = path.join(GetServerPaths("java"), "eula.txt"); + if (fs.existsSync(eula_file_path)) { + const eula_file = fs.readFileSync(eula_file_path, "utf8"); + console.log(eula_file); + if (eula_file.includes("eula=false")) { + fs.writeFileSync(eula_file_path, eula_file.replace(/eula=false/gi, "eula=true")); + throw new Error("Restart application/CLI") + } + } else { + console.log("EULA file not found"); + throw new Error("EULA file not found") } } diff --git a/src/BdsServersDownload.js b/src/BdsServersDownload.js index b569b57..845f44d 100644 --- a/src/BdsServersDownload.js +++ b/src/BdsServersDownload.js @@ -18,14 +18,9 @@ module.exports = async function (version, force_install, callback) { bds_dir_dragonfly = GetServerPaths("dragonfly"); // JSON Configs and others - const Servers = (await (await fetch(Extra.download.servers)).json()); + const Servers = (await (await fetch(Extra.Fetchs.servers)).json()); const ServerVersion = GetServerVersion(); const CurrentPlatform = GetPlatform(); - if (force_install === true) { - ServerVersion.java = "latest"; - ServerVersion.bedrock = "latest" - ServerVersion.pocketmine = "latest" - } if (!(version) || version === true || version === "true" || version === "latest") version = Servers.latest[CurrentPlatform] var url; @@ -152,7 +147,7 @@ module.exports = async function (version, force_install, callback) { async function php_download() { const bds_dir_pocketmine = GetServerPaths("pocketmine"); - const PHPBin = (await (await fetch(Extra.download.php)).json()); + const PHPBin = (await (await fetch(Extra.Fetchs.php)).json()); const phpFolder = resolve(bds_dir_pocketmine, "bin"); const phpExtensiosnsDir = resolve(bds_dir_pocketmine, "bin/php7/lib/php/extensions");