Fixes issue #1
This commit is contained in:
parent
0f01a64f07
commit
379d1ed051
@ -4,7 +4,6 @@ import net.knarcraft.serverlauncher.profile.Collection;
|
||||
import net.knarcraft.serverlauncher.profile.Profile;
|
||||
import net.knarcraft.serverlauncher.server.Server;
|
||||
import net.knarcraft.serverlauncher.server.ServerType;
|
||||
import net.knarcraft.serverlauncher.userinterface.GUI;
|
||||
import net.knarcraft.serverlauncher.userinterface.ServerConsoles;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
@ -79,6 +78,9 @@ public class Main {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (!server.getProcess().isAlive()) {
|
||||
server.stopped();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -131,6 +131,12 @@ public class Server {
|
||||
return this.playerList;
|
||||
}
|
||||
|
||||
public void stopped() {
|
||||
process = null;
|
||||
writer = null;
|
||||
reader = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A representation of the name of a jarfile.
|
||||
*/
|
||||
@ -298,11 +304,11 @@ public class Server {
|
||||
|
||||
public String read() throws IOException {
|
||||
String line;
|
||||
if ((line = reader.readLine()) != null) {
|
||||
return line;
|
||||
} else {
|
||||
return "";
|
||||
StringBuilder text = new StringBuilder();
|
||||
while (reader.ready() && (line = reader.readLine()) != null) {
|
||||
text.append(line).append("\n");
|
||||
}
|
||||
return text.toString().trim();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,6 +1,5 @@
|
||||
package net.knarcraft.serverlauncher.userinterface;
|
||||
|
||||
import net.knarcraft.serverlauncher.Main;
|
||||
import net.knarcraft.serverlauncher.profile.Profile;
|
||||
import net.knarcraft.serverlauncher.server.Server;
|
||||
import net.knarcraft.serverlauncher.server.ServerType;
|
||||
|
Loading…
Reference in New Issue
Block a user