Bump @the-bds-maneger/server_versions from 3.0.1 to 4.0.1 #442

Merged
dependabot[bot] merged 3 commits from dependabot/npm_and_yarn/the-bds-maneger/server_versions-4.0.1 into main 2022-09-13 13:52:05 +00:00
6 changed files with 84 additions and 65 deletions
Showing only changes of commit d3d31f6d3d - Show all commits

View File

@ -2,7 +2,7 @@ import * as path from "node:path";
import * as fsOld from "node:fs";
import * as fs from "node:fs/promises";
import { promisify } from "node:util";
import { getBedrockZip } from "@the-bds-maneger/server_versions";
import { platformManeger } from "@the-bds-maneger/server_versions";
import admZip from "adm-zip";
import { exec, execAsync } from "./childPromisses";
import { actions, actionConfig } from "./globalPlatfroms";
@ -21,11 +21,7 @@ export const player = /\[.*\]\s+Player\s+((dis|)connected):\s+(.*),\s+xuid:\s+([
export const compressWorld = /\[.*\]\s+Running\s+AutoCompaction/;
export async function installServer(version: string|boolean) {
let arch = process.arch;
if (process.platform === "linux" && process.arch !== "x64") {
if (await execAsync("command -v qemu-x86_64-static").then(() => true).catch(() => false)||await execAsync("command -v box64").then(() => true).catch(() => false)) arch = "x64";
}
const zip = new admZip(await getBedrockZip(version, arch));
const zip = new admZip(await platformManeger.bedrock.getBedrockZip(version, {}));
if (!fsOld.existsSync(serverPath)) await fs.mkdir(serverPath, {recursive: true});
// Remover files
for (const file of await fs.readdir(serverPath).then(files => files.filter(file => !saveFileFolder.test(file)))) await fs.rm(path.join(serverPath, file), {recursive: true, force: true});

View File

@ -1,7 +1,7 @@
import * as path from "node:path";
import * as fs from "node:fs/promises";
import * as fsOld from "node:fs";
import { getJavaJar } from "@the-bds-maneger/server_versions";
import { platformManeger } from "@the-bds-maneger/server_versions";
import { serverRoot, logRoot } from './pathControl';
import { exec } from "./childPromisses";
import { actions, actionConfig } from './globalPlatfroms';
@ -13,7 +13,7 @@ export const portListen = /\[.*\]:\s+Starting\s+Minecraft\s+server\s+on\s+(([0-9
export async function installServer(version: string|boolean) {
if (!fsOld.existsSync(serverPath)) await fs.mkdir(serverPath, {recursive: true});
await fs.writeFile(jarPath, await getJavaJar(version));
await fs.writeFile(jarPath, await platformManeger.java.getJar(version));
}
const serverConfig: actionConfig[] = [
@ -35,7 +35,7 @@ const serverConfig: actionConfig[] = [
port: parseInt(port),
type: "TCP",
host: host,
protocol: /::/.test(host?.trim())?"IPv6":/[0-9]+\.[0-9]+/.test(host?.trim())?"IPv4":"IPV4/IPv6"
protocol: "IPV4/IPv6"
});
}
},

View File

@ -3,7 +3,7 @@ import * as fs from "node:fs/promises";
import * as os from "node:os";
import * as tar from "tar";
import { existsSync as fsExistsSync } from "node:fs";
import { getPocketminePhar, versionAPIs } from "@the-bds-maneger/server_versions";
import { platformManeger, versionURLs } from "@the-bds-maneger/server_versions";
import { execFileAsync, exec } from './childPromisses';
import { logRoot, serverRoot } from "./pathControl";
import { getBuffer } from "./httpRequest";
@ -53,7 +53,7 @@ async function buildPhp() {
}
async function installPhp(): Promise<void> {
const file = (await getBuffer(`${versionAPIs[0]}/pocketmine/bin?os=${process.platform}&arch=${process.arch}`).then(res => JSON.parse(res.toString("utf8")) as {url: string, name: string}[]))[0];
const file = (await getBuffer(`${versionURLs[0]}/pocketmine/bin?os=${process.platform}&arch=${process.arch}`).then(res => JSON.parse(res.toString("utf8")) as {url: string, name: string}[]))[0];
if (!file) return buildPhp();
if (fsExistsSync(path.resolve(serverPath, "bin"))) await fs.rm(path.resolve(serverPath, "bin"), {recursive: true});
await fs.mkdir(path.resolve(serverPath, "bin"), {recursive: true});
@ -83,7 +83,7 @@ async function installPhp(): Promise<void> {
export async function installServer(version: string|boolean) {
if (!fsExistsSync(serverPath)) await fs.mkdir(serverPath, {recursive: true});
await installPhp();
await fs.writeFile(serverPhar, await getPocketminePhar(version));
await fs.writeFile(serverPhar, await platformManeger.pocketmine.getPhar(version));
}
// [16:47:35.405] [Server thread/INFO]: Minecraft network interface running on 0.0.0.0:19132

View File

@ -1,7 +1,7 @@
import * as path from "node:path";
import * as fs from "node:fs/promises";
import * as fsOld from "node:fs";
import { getSpigotJar } from "@the-bds-maneger/server_versions";
import { platformManeger } from "@the-bds-maneger/server_versions";
import { serverRoot, logRoot } from './pathControl';
import { exec } from "./childPromisses";
import { actions, actionConfig } from './globalPlatfroms';
@ -12,7 +12,7 @@ export const portListen = /\[.*\]:\s+Starting\s+Minecraft\s+server\s+on\s+(([0-9
export async function installServer(version: string|boolean) {
if (!fsOld.existsSync(serverPath)) await fs.mkdir(serverPath, {recursive: true});
await fs.writeFile(jarPath, await getSpigotJar(version));
await fs.writeFile(jarPath, await platformManeger.spigot.getJar(version));
}
const serverConfig: actionConfig[] = [