From d1f2a195f359735abbc99b0d32b596d094091672 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Wed, 20 Nov 2019 12:01:57 +0100 Subject: [PATCH] Disabling labymod spam + synchronising port search --- .../steamwar/bungeecore/SubserverSystem.java | 22 ++++++++++--------- .../bungeecore/listeners/mods/LabyMod.java | 2 -- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index dc9fafa..541889f 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -85,18 +85,20 @@ public class SubserverSystem { } private static int freePort(int start){ - int port = start; - boolean isFree = false; - while(!isFree){ - port++; - isFree = true; - for(Subserver server : Subserver.getServerList()){ - if(server.getServer().getAddress().getPort() == port){ - isFree = false; - break; + synchronized (Subserver.getServerList()){ + int port = start; + boolean isFree = false; + while(!isFree){ + port++; + isFree = true; + for(Subserver server : Subserver.getServerList()){ + if(server.getServer().getAddress().getPort() == port){ + isFree = false; + break; + } } } + return port; } - return port; } } diff --git a/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java b/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java index 43f1224..0594939 100644 --- a/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java +++ b/src/de/steamwar/bungeecore/listeners/mods/LabyMod.java @@ -43,7 +43,6 @@ public class LabyMod extends BasicListener { return; Pair value = readString(data, purpose.getKey()); - BungeeCore.log(value.getValue()); List mods = new LinkedList<>(); try{ @@ -56,7 +55,6 @@ public class LabyMod extends BasicListener { } Utils.handleMods(player, mods); - //TODO CCP & SHADOW } private Pair readString(byte[] array, int startPos){