Fixes a bug causing the software to be stuck in the Stopping Servers state
Fixes the case where the software tries to stop servers while no servers are actually running. This also fixes #10
This commit is contained in:
parent
44d8d6ee6b
commit
133e335905
@ -60,10 +60,13 @@ public class ServerHandler {
|
||||
}
|
||||
|
||||
stoppingServers = true;
|
||||
int serversRunning = 0;
|
||||
|
||||
for (Collection collection : Main.getController().getCurrentProfile().getCollections()) {
|
||||
Server server = collection.getServer();
|
||||
BufferedWriter writer = server.getWriter();
|
||||
if (writer != null) {
|
||||
serversRunning++;
|
||||
if (server.isProxy()) {
|
||||
writer.write("end\n");
|
||||
} else {
|
||||
@ -74,7 +77,10 @@ public class ServerHandler {
|
||||
server.setStopped();
|
||||
}
|
||||
}
|
||||
//TODO: Set stoppingServers to false if no servers are actually running
|
||||
|
||||
if (serversRunning == 0) {
|
||||
stoppingServers = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user