13
0

Adding blocking stop()

Dieser Commit ist enthalten in:
Travis CI 2019-06-22 23:18:17 +02:00
Ursprung 0d13d3cbb3
Commit 9dae263d9b

Datei anzeigen

@ -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);
}