Minor fixes

This commit is contained in:
Kristian Knarvik 2018-01-28 16:23:15 +01:00
parent 3b3600fb68
commit bcaf8640d4
2 changed files with 6 additions and 5 deletions

View File

@ -4,7 +4,6 @@ import net.knarcraft.serverlauncher.userinterface.GUI;
import java.io.*; import java.io.*;
import java.net.URL; import java.net.URL;
import java.nio.Buffer;
import java.util.Scanner; import java.util.Scanner;
import java.nio.file.*; import java.nio.file.*;
import java.util.ArrayList; import java.util.ArrayList;
@ -97,7 +96,7 @@ public class Server {
public static void stop() throws IOException { public static void stop() throws IOException {
for (Server server : servers) { for (Server server : servers) {
if (server.writer != null) { if (server.writer != null) {
if (server.type.getName() == "Bungee") { if (server.type.getName().equals("Bungee")) {
server.writer.write("end\n"); server.writer.write("end\n");
} else { } else {
server.writer.write("stop\n"); server.writer.write("stop\n");
@ -134,7 +133,9 @@ public class Server {
public static void startServers() { public static void startServers() {
System.out.println("Starting servers."); System.out.println("Starting servers.");
for (Server server : servers) { for (Server server : servers) {
server.run(); if (!server.run()) {
gui.setStatus("An error occurred. Start aborted");
}
} }
} }
@ -148,7 +149,7 @@ public class Server {
this.downloadJar(); this.downloadJar();
gui.setStatus("File downloaded"); gui.setStatus("File downloaded");
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
System.out.println("File was not found"); gui.setStatus("Error: Jar file not found");
return false; return false;
} }
try { try {

View File

@ -14,7 +14,7 @@ import java.io.*;
* @since 0.0.0.1 * @since 0.0.0.1
*/ */
class ServerTest { class ServerTest {
public static void main(String[] args) throws IOException { public static void main(String[] args) {
EventQueue.invokeLater(() -> { EventQueue.invokeLater(() -> {
try { try {
setup(); setup();