New package structure
This commit is contained in:
parent
80a04c946a
commit
207427506e
@ -1,10 +1,15 @@
|
|||||||
import serverlauncher.server.*;
|
import net.knarcraft.serverlauncher.server.*;
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.lang.Runtime;
|
import java.lang.Runtime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
//Java 9 required.
|
//Java 9 required.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A software for managing Minecraft servers.
|
||||||
|
* @author Kristian Knarvik
|
||||||
|
*/
|
||||||
public class Main {
|
public class Main {
|
||||||
private static ArrayList<Server> servers = new ArrayList<>();
|
private static ArrayList<Server> servers = new ArrayList<>();
|
||||||
private static ArrayList<ServerType> serverTypes = new ArrayList<>();
|
private static ArrayList<ServerType> serverTypes = new ArrayList<>();
|
@ -1,4 +1,4 @@
|
|||||||
package serverlauncher.server;
|
package net.knarcraft.serverlauncher.server;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
@ -9,7 +9,7 @@ import java.nio.file.StandardCopyOption;
|
|||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
//Contains all necessary information to create, run and manage a Minecraft server.
|
/* Contains all necessary information to create, run and manage a Minecraft server. */
|
||||||
public class Server {
|
public class Server {
|
||||||
private final String BASEURL = "https://knarcraft.net/Api/Download/bungeeminecraftserverlauncher/jars"; //The url we download jar files from.
|
private final String BASEURL = "https://knarcraft.net/Api/Download/bungeeminecraftserverlauncher/jars"; //The url we download jar files from.
|
||||||
private final String BUKKITURL = BASEURL + "/Bukkit/";
|
private final String BUKKITURL = BASEURL + "/Bukkit/";
|
||||||
@ -20,7 +20,7 @@ public class Server {
|
|||||||
private String path;
|
private String path;
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
private ArrayList<String> playerList;
|
private ArrayList<String> playerList;
|
||||||
private serverlauncher.server.ServerType type;
|
private ServerType type;
|
||||||
private String serverVersion;
|
private String serverVersion;
|
||||||
private String maxRam;
|
private String maxRam;
|
||||||
private long pid;
|
private long pid;
|
@ -1,12 +1,17 @@
|
|||||||
package serverlauncher.server;
|
package net.knarcraft.serverlauncher.server;
|
||||||
|
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
/**
|
/**
|
||||||
* Has a name and contains a list of valid server versions.
|
* Has a name and contains a list of valid server versions.
|
||||||
*/
|
*/
|
||||||
public class ServerType {
|
public class ServerType {
|
||||||
private String name;
|
private String name;
|
||||||
private String[] versions;
|
private String[] versions;
|
||||||
|
private URL versionURL;
|
||||||
|
private URL downloadURL;
|
||||||
|
private String srcStart;
|
||||||
|
private String srcEnd;
|
||||||
|
|
||||||
public ServerType(String name, String[] versions) {
|
public ServerType(String name, String[] versions) {
|
||||||
this.name = name;
|
this.name = name;
|
Loading…
Reference in New Issue
Block a user