From 317df7b7a853a037cc7d2fef192741d73a66a7af Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 22 Oct 2021 20:13:31 +0200 Subject: [PATCH] Improved stability Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/BungeeCore.java | 4 ++-- src/de/steamwar/bungeecore/Node.java | 2 +- src/de/steamwar/bungeecore/sql/SteamwarUser.java | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java index e834234..65fd3ce 100644 --- a/src/de/steamwar/bungeecore/BungeeCore.java +++ b/src/de/steamwar/bungeecore/BungeeCore.java @@ -92,8 +92,8 @@ public class BungeeCore extends Plugin { new BrandListener(); new Node.LocalNode(); - new Node.RemoteNode("lx"); - new Node.RemoteNode("az"); + //new Node.RemoteNode("lx"); + //new Node.RemoteNode("az"); commands.put("/tp", null); commands.put("/bc", null); diff --git a/src/de/steamwar/bungeecore/Node.java b/src/de/steamwar/bungeecore/Node.java index f9a9e0c..8f8d95f 100644 --- a/src/de/steamwar/bungeecore/Node.java +++ b/src/de/steamwar/bungeecore/Node.java @@ -33,7 +33,7 @@ import java.util.logging.Level; public abstract class Node { private static final List OPENJDK8_ARGS = Arrays.asList("-Dlog4j.configurationFile=log4j2.xml", "-server", "-Xms128M", "-XX:+UseCompressedOops", "-XX:+TieredCompilation", "-XX:TargetSurvivorRatio=90", "-XX:SurvivorRatio=8", "-XX:MaxTenuringThreshold=15", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseBiasedLocking", "-XX:UseSSE=3", "-XX:+UseCodeCacheFlushing", "-XX:+UseThreadPriorities", "-XX:+AggressiveOpts", "-XX:+ReduceSignalUsage", "-XX:+UseInterpreter", "-XX:+UseSharedSpaces", "-XX:AllocatePrefetchStyle=1", "-XX:+AlwaysCompileLoopMethods", "-XX:+UseConcMarkSweepGC", "-XX:+RewriteFrequentPairs", "-XX:+OptimizeStringConcat", "-XX:+CMSCleanOnEnter", "-XX:+UseInlineCaches", "-XX:ThreadPriorityPolicy=42", "-XX:SharedReadOnlySize=30m", "-XX:+UseFastEmptyMethods", "-XX:+UseFastAccessorMethods"); - private static final List OPENJ9_ARGS = Arrays.asList("-Xsyslog:none", "-Xtrace:none", "-Xdisableexplicitgc", "-XX:+AlwaysPreTouch", "-XX:+CompactStrings", "-Dlog4j.configurationFile=log4j2.xml"); + private static final List OPENJ9_ARGS = Arrays.asList("-Xgc:excessiveGCratio=80", "-Xsyslog:none", "-Xtrace:none", "-Xdisableexplicitgc", "-XX:+AlwaysPreTouch", "-XX:+CompactStrings", "-Dlog4j.configurationFile=log4j2.xml"); private static final double MIN_FREE_MEM = 4.0 * 1024 * 1024; // 4 GiB private static final List nodes = new ArrayList<>(); diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index e721913..ccc174e 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -37,10 +37,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; import java.time.format.DateTimeFormatter; -import java.util.HashMap; -import java.util.Map; -import java.util.Scanner; -import java.util.UUID; +import java.util.*; import java.util.logging.Level; @@ -207,8 +204,8 @@ public class SteamwarUser { final URL url = new URL(API_URL + playerName); String uuid = jsonParser.parse(new Scanner(url.openConnection().getInputStream()).nextLine()).getAsJsonObject().get("id").getAsString(); return UUID.fromString(uuid.replaceFirst("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")); - } catch (IOException e) { - BungeeCore.get().getLogger().log(Level.SEVERE, "Could not get offline player UUID", e); + } catch (NoSuchElementException | IOException e) { + BungeeCore.get().getLogger().log(Level.SEVERE, "Could not get offline player UUID " + playerName, e); return null; } } -- 2.39.2