From c44a76563c815e44012c62a39fcbd697cf2c6144 Mon Sep 17 00:00:00 2001 From: Kristian Knarvik Date: Thu, 18 Jan 2018 23:18:45 +0100 Subject: [PATCH] First commit --- Main.java | 21 +++++++++++++++++++++ README.md | 1 + Server.java | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ ServerType.java | 21 +++++++++++++++++++++ 4 files changed, 92 insertions(+) create mode 100644 Main.java create mode 100644 README.md create mode 100644 Server.java create mode 100644 ServerType.java diff --git a/Main.java b/Main.java new file mode 100644 index 0000000..45e3dcf --- /dev/null +++ b/Main.java @@ -0,0 +1,21 @@ +import java.lang.Runtime; +import java.util.ArrayList; +public class Main { + public ArrayList servers; + + public static void main(String[] args) { + + } + + public static void startServers() { + for (Server server : servers) { + if (server.isEnabled()) { + String path = server.getPath(); + ServerType = this.type; + + Runtime rt = Runtime.getRuntime(); + Process pr = rt.exec("java -Xmx" + $MemoryValue + " -Xms512M -jar " + '"' + $loc + "\\" + $Type + '" nogui'); + } + } + } +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c443ba5 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Minecraft-Server-Launcher \ No newline at end of file diff --git a/Server.java b/Server.java new file mode 100644 index 0000000..77f8db7 --- /dev/null +++ b/Server.java @@ -0,0 +1,49 @@ +import java.util.ArrayList; +public class Server { + private String name; + private String path; + private boolean enabled; + private ArrayList playerList; + private ServerType type; + private String serverVersion; + + public Server(String name) { + this.name = name; + this.path = ""; + this.isEnabled = false; + this.playerList = new ArrayList(); + this.type = null; + this.serverVersion = null; + } + + public void addPlayer(String name) { + this.playerList.add(name); + } + + public void removePlayer(String name) { + for (int i = 0; i < playerList.size(); i++) { + if (name.equals(playerList.get(i))) { + playerList.remove(i); + return; + } + } + } + + public String getPath() { + return this.path; + } + + public ServerType getType() { + return this.type; + } + + public String getVersion() { + return this.version; + } + + public boolean isEnabled() { + return this.enabled; + } + + +} \ No newline at end of file diff --git a/ServerType.java b/ServerType.java new file mode 100644 index 0000000..9b12c80 --- /dev/null +++ b/ServerType.java @@ -0,0 +1,21 @@ +public class ServerType { + private String name; + private ArrayList versions; + + public ServerType(String name, ArrayList versions) { + this.name = name; + this.versions = versions; + } + + public String getName() { + return this.name; + } + + public ArrayList getVersions() { + return this.versions; + } + + public boolean validVersion() { + + } +} \ No newline at end of file