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