From 84c2c2f825b83ccc091a8cbb986b0615c5aaa4a0 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 30 Oct 2020 15:16:34 +0100 Subject: [PATCH] Fix port clash Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/SubserverSystem.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/de/steamwar/bungeecore/SubserverSystem.java b/src/de/steamwar/bungeecore/SubserverSystem.java index 66493aa..3fcb39a 100644 --- a/src/de/steamwar/bungeecore/SubserverSystem.java +++ b/src/de/steamwar/bungeecore/SubserverSystem.java @@ -41,6 +41,15 @@ public class SubserverSystem { private static final String SERVER_PATH = BACKBONE + "server/"; private static final String EVENT_PATH = BACKBONE + "event/"; + private static final int firstArenaPort; + + static { + if(BungeeCore.EVENT_MODE) + firstArenaPort = 6000; + else + firstArenaPort = 2500; + } + /** * This function starts every arena (even test- and eventarenas). * @@ -80,10 +89,10 @@ public class SubserverSystem { */ public static Subserver startArena(ArenaMode modus, String map, int eventFightID, int checkSchemID, String serverName, String mapName, UUID player1, UUID player2, boolean ranked){ //Generate missing parameters - int port = freePort(2500); + int port = freePort(firstArenaPort); if(serverName == null) - serverName = modus.getDisplayName() + (port - 2500); + serverName = modus.getDisplayName() + (port - firstArenaPort); if(mapName == null) mapName = serverName;