From 9dae263d9b79250e36e5cf296ce3ece5ca1e897b Mon Sep 17 00:00:00 2001 From: Travis CI Date: Sat, 22 Jun 2019 23:18:17 +0200 Subject: [PATCH] Adding blocking stop() --- src/de/steamwar/bungeecore/Subserver.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/de/steamwar/bungeecore/Subserver.java b/src/de/steamwar/bungeecore/Subserver.java index 13d4135..6a3b4a8 100644 --- a/src/de/steamwar/bungeecore/Subserver.java +++ b/src/de/steamwar/bungeecore/Subserver.java @@ -85,19 +85,23 @@ public class Subserver implements Runnable, Listener { } } - static void shutdown(){ + public void stop(){ + writer.println("stop"); try { - while (!serverList.isEmpty()) { - Subserver server = serverList.get(0); - server.writer.println("stop"); - server.p.waitFor(); - } + p.waitFor(); }catch(InterruptedException e){ - logger.log(Level.SEVERE, "Subserver shutdown interrupted!", e); + logger.log(Level.SEVERE, "Subserver stop interrupted!", e); Thread.currentThread().interrupt(); } } + static void shutdown(){ + while (!serverList.isEmpty()) { + Subserver server = serverList.get(0); + server.stop(); + } + } + private boolean onServer(ProxiedPlayer p){ return cachedPlayers.contains(p) || players.contains(p); }