SteamWar/BungeeCore
Archiviert
13
2

Merge pull request 'Add Node3' (#216) from Node3 into master

Reviewed-on: #216
Reviewed-by: Zeanon <thezeanon@gmail.com>
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2021-06-22 06:33:53 +02:00
Commit a8323d39dd

Datei anzeigen

@ -239,15 +239,25 @@ public class SubserverSystem {
List<String> cmd = new ArrayList<>(); List<String> cmd = new ArrayList<>();
boolean jdk11 = serverJar.contains("1.15.2"); boolean jdk11 = serverJar.contains("1.15.2");
if(!steamwarStartAvailable() && lixfelStartAvailable()){ boolean fallback = false;
if (!steamwarStartAvailable()) {
cmd.add("ssh"); cmd.add("ssh");
cmd.add("-L"); cmd.add("-L");
cmd.add(port + ":localhost:" + port); cmd.add(port + ":localhost:" + port);
if (remoteStartAvailable("lx")) {
cmd.add("lx"); cmd.add("lx");
} else if (remoteStartAvailable("az")) {
cmd.add("az");
} else {
fallback = true;
}
cmd.add("cd"); cmd.add("cd");
cmd.add(directory.getPath()); cmd.add(directory.getPath());
cmd.add(";"); cmd.add(";");
} }
if (fallback) {
cmd.clear();
}
if(jdk11) if(jdk11)
cmd.add("/usr/lib/jvm/java-11-openjdk-amd64/bin/java"); cmd.add("/usr/lib/jvm/java-11-openjdk-amd64/bin/java");
@ -278,8 +288,8 @@ public class SubserverSystem {
return LoadEvaluation.getCPULoad() < 0.8 && LoadEvaluation.getRamPercentage() < 0.8; return LoadEvaluation.getCPULoad() < 0.8 && LoadEvaluation.getRamPercentage() < 0.8;
} }
private static boolean lixfelStartAvailable(){ private static boolean remoteStartAvailable(String remote) {
return LoadEvaluation.getRemoteCPULoad("lx") < 0.8 && LoadEvaluation.getRemoteRamPercentage("lx") < 0.8; return LoadEvaluation.getRemoteCPULoad(remote) < 0.8 && LoadEvaluation.getRemoteRamPercentage(remote) < 0.8;
} }
private static boolean bauRunning(ProxiedPlayer p, UUID owner){ private static boolean bauRunning(ProxiedPlayer p, UUID owner){