Reewrite project #430

Merged
Sirherobrine23 merged 13 commits from reewriteProject into main 2022-08-31 10:03:14 +00:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit a383e21306 - Show all commits

View File

@ -89,7 +89,7 @@ export async function installServer(version: string|boolean) {
} }
// [16:47:35.405] [Server thread/INFO]: Minecraft network interface running on 0.0.0.0:19132 // [16:47:35.405] [Server thread/INFO]: Minecraft network interface running on 0.0.0.0:19132
export const portListen = /\[.*\]:\s+Minecraft\s+network\s+interface\s+running\s+on\s+(([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|[A-Za-z0-9:]+|):([0-9]+))/; export const portListen = /\[.*\]:\s+Minecraft\s+network\s+interface\s+running\s+on\s+(([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+|\[[A-Za-z0-9:]+\]|):([0-9]+))/;
export const started = /\[.*\].*\s+Done\s+\(.*\)\!.*/; export const started = /\[.*\].*\s+Done\s+\(.*\)\!.*/;
export const player = /[.*]:\s+(.*)\s+(.*)\s+the\s+game/gi; export const player = /[.*]:\s+(.*)\s+(.*)\s+the\s+game/gi;
@ -101,10 +101,10 @@ const serverConfig: actionConfig[] = [
if (!portParse) return; if (!portParse) return;
const [,, host, port] = portParse; const [,, host, port] = portParse;
done({ done({
port: parseInt(port), protocol: /::/.test(host?.trim())?"IPv6":/[0-9]+\.[0-9]+/.test(host?.trim())?"IPv4":"IPV4/IPv6",
host: host?.trim(),
type: "UDP", type: "UDP",
protocol: "IPV4/IPv6" port: parseInt(port),
host: host?.trim()
}); });
} }
}, },

View File

@ -8,6 +8,7 @@ describe("Pocketmine", () => {
await installServer("latest"); await installServer("latest");
const serverManeger = await startServer(); const serverManeger = await startServer();
serverManeger.on("log_stdout", console.log); serverManeger.on("log_stdout", console.log);
serverManeger.on("log_stderr", console.info);
serverManeger.on("portListening", console.log); serverManeger.on("portListening", console.log);
serverManeger.on("log_stdout", data => { serverManeger.on("log_stdout", data => {
if(/set-up.*wizard/.test(data)) { if(/set-up.*wizard/.test(data)) {