From 2fc19bc92d1d67e766020ed3a4ed76e960edc613 Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 21 Jun 2021 22:02:53 +0200 Subject: [PATCH] Add Node3 --- src/de/steamwar/bungeecore/SubserverSystem.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index d002d2c..e35a134 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -239,7 +239,8 @@ public class SubserverSystem { List cmd = new ArrayList<>(); boolean jdk11 = serverJar.contains("1.15.2"); - if(!steamwarStartAvailable() && lixfelStartAvailable()){ + boolean notSteamwarStart = !steamwarStartAvailable(); + if (notSteamwarStart && remoteStartAvailable("lx")) { cmd.add("ssh"); cmd.add("-L"); cmd.add(port + ":localhost:" + port); @@ -247,6 +248,14 @@ public class SubserverSystem { cmd.add("cd"); cmd.add(directory.getPath()); cmd.add(";"); + } else if (notSteamwarStart && remoteStartAvailable("az")) { + cmd.add("ssh"); + cmd.add("-L"); + cmd.add(port + ":localhost:" + port); + cmd.add("az"); + cmd.add("cd"); + cmd.add(directory.getPath()); + cmd.add(";"); } if(jdk11) @@ -278,8 +287,8 @@ public class SubserverSystem { return LoadEvaluation.getCPULoad() < 0.8 && LoadEvaluation.getRamPercentage() < 0.8; } - private static boolean lixfelStartAvailable(){ - return LoadEvaluation.getRemoteCPULoad("lx") < 0.8 && LoadEvaluation.getRemoteRamPercentage("lx") < 0.8; + private static boolean remoteStartAvailable(String remote) { + return LoadEvaluation.getRemoteCPULoad(remote) < 0.8 && LoadEvaluation.getRemoteRamPercentage(remote) < 0.8; } private static boolean bauRunning(ProxiedPlayer p, UUID owner){