diff --git a/.gitignore b/.gitignore
index b3aa7c5a..6d768083 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,6 +42,7 @@ crashlytics-build.properties
/Artifacts/-Icon/
/Artifacts/-Lite/
/Artifacts/*.jar
+/BungeeCord/
/Javadoc/
/SubServers.Test/
/build.ant
diff --git a/Artifacts/ServerContainer.class b/Artifacts/ServerContainer.class
new file mode 100644
index 00000000..7d568835
Binary files /dev/null and b/Artifacts/ServerContainer.class differ
diff --git a/README.md b/README.md
index 9265dd06..60307668 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ SubServers 2 is a rewrite of SubServers, the Server Management Platform.
These are some quick links for common resources of SubServers 2.
### How to Install
-> [https://github.com/ME1312/SubServers-2/wiki/Install](https://github.com/ME1312/SubServers-2/wiki/Install)
+> [https://github.com/ME1312/SubServers-2/wiki/Install](https://github.com/ME1312/SubServers-2/wiki/Installation)
### Snapshot Downloads
> [https://dev.me1312.net/jenkins/job/SubServers Platform](https://dev.me1312.net/jenkins/job/SubServers%20Platform)
diff --git a/SubServers.Bungee/pom.xml b/SubServers.Bungee/pom.xml
index 05a77f00..91f4dae8 100644
--- a/SubServers.Bungee/pom.xml
+++ b/SubServers.Bungee/pom.xml
@@ -30,20 +30,20 @@
net.ME1312.Galaxi
GalaxiUtil
- 20w08c
+ 20w15a
compile
true
net.ME1312.Galaxi
GalaxiEngine
- 20w08c
+ 20w15a
provided
net.ME1312.SubData
Server
- 20w07d
+ 20w15a
compile
true
@@ -162,7 +162,7 @@
SubServers.Bungee Javadoc
SubServers.Bungee Javadoc
- public
+ protected
./
${basedir}/../Javadoc/SubServers.Bungee
${basedir}/../Javadoc/SubServers.Bungee
diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Event/SubEditServerEvent.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Event/SubEditServerEvent.java
index 93f49ebd..a61121e7 100644
--- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Event/SubEditServerEvent.java
+++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Event/SubEditServerEvent.java
@@ -3,7 +3,7 @@ package net.ME1312.SubServers.Bungee.Event;
import net.ME1312.SubServers.Bungee.Host.Server;
import net.ME1312.Galaxi.Library.Map.ObjectMap;
import net.ME1312.Galaxi.Library.Map.ObjectMapValue;
-import net.ME1312.Galaxi.Library.NamedContainer;
+import net.ME1312.Galaxi.Library.Container.NamedContainer;
import net.ME1312.SubServers.Bungee.Library.SubEvent;
import net.ME1312.Galaxi.Library.Util;
import net.md_5.bungee.api.plugin.Cancellable;
diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalHost.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalHost.java
index 0f3d2e1f..0d5c05a5 100644
--- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalHost.java
+++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalHost.java
@@ -31,14 +31,14 @@ public class ExternalHost extends Host implements ClientHandler {
private HashMap subdata = new HashMap();
private HashMap servers = new HashMap();
private String name;
- protected boolean available;
+ boolean available;
private boolean enabled;
private InetAddress address;
private SubCreator creator;
private String directory;
private LinkedList queue;
private boolean clean;
- protected SubProxy plugin;
+ SubProxy plugin;
/**
* Creates an External Host
@@ -93,7 +93,7 @@ public class ExternalHost extends Host implements ClientHandler {
for (Integer channel : Util.getBackwards(subdata, (SubDataClient) client)) setSubData(null, channel);
}
- protected void queue(PacketOut... packet) {
+ void queue(PacketOut... packet) {
for (PacketOut p : packet) if (getSubData()[0] == null || !available) {
queue.add(p);
} else {
@@ -167,7 +167,7 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public SubServer addSubServer(UUID player, String name, boolean enabled, int port, String motd, boolean log, String directory, String executable, String stopcmd, boolean hidden, boolean restricted) throws InvalidServerException {
if (plugin.api.getServers().keySet().contains(name.toLowerCase())) throw new InvalidServerException("A Server already exists with this name!");
- ExternalSubServer server = new ExternalSubServer(this, name, enabled, port, motd, log, directory, executable, stopcmd, hidden, restricted);
+ ExternalSubServer server = ExternalSubServer.construct(this, name, enabled, port, motd, log, directory, executable, stopcmd, hidden, restricted);
SubAddServerEvent event = new SubAddServerEvent(player, this, server);
plugin.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
@@ -184,18 +184,18 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public boolean removeSubServer(UUID player, String name) throws InterruptedException {
if (Util.isNull(name)) throw new NullPointerException();
- String server = servers.get(name.toLowerCase()).getName();
+ SubServer server = servers.get(name.toLowerCase());
- SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, getSubServer(server));
+ SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, server);
plugin.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- if (getSubServer(server).isRunning()) {
- getSubServer(server).stop();
- getSubServer(server).waitFor();
+ if (server.isRunning()) {
+ server.stop();
+ server.waitFor();
}
- queue(new PacketExRemoveServer(server, data -> {
+ queue(new PacketExRemoveServer(name.toLowerCase(), data -> {
if (data.getInt(0x0001) == 0 || data.getInt(0x0001) == 1) {
- servers.remove(server.toLowerCase());
+ servers.remove(name.toLowerCase());
}
}));
return true;
@@ -205,17 +205,17 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public boolean forceRemoveSubServer(UUID player, String name) throws InterruptedException {
if (Util.isNull(name)) throw new NullPointerException();
- String server = servers.get(name.toLowerCase()).getName();
+ SubServer server = servers.get(name.toLowerCase());
- SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, getSubServer(server));
+ SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, server);
plugin.getPluginManager().callEvent(event);
- if (getSubServer(server).isRunning()) {
- getSubServer(server).stop();
- getSubServer(server).waitFor();
+ if (server.isRunning()) {
+ server.stop();
+ server.waitFor();
}
- queue(new PacketExRemoveServer(server, data -> {
+ queue(new PacketExRemoveServer(name.toLowerCase(), data -> {
if (data.getInt(0x0001) == 0 || data.getInt(0x0001) == 1) {
- servers.remove(server.toLowerCase());
+ servers.remove(name.toLowerCase());
}
}));
return true;
@@ -224,14 +224,15 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public boolean recycleSubServer(UUID player, String name) throws InterruptedException {
if (Util.isNull(name)) throw new NullPointerException();
- String server = servers.get(name.toLowerCase()).getName();
+ SubServer s = servers.get(name.toLowerCase());
+ String server = s.getName();
- SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, getSubServer(server));
+ SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, s);
plugin.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- if (getSubServer(server).isRunning()) {
- getSubServer(server).stop();
- getSubServer(server).waitFor();
+ if (s.isRunning()) {
+ s.stop();
+ s.waitFor();
}
Logger.get("SubServers").info("Saving...");
@@ -263,12 +264,14 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public boolean forceRecycleSubServer(UUID player, String name) throws InterruptedException {
if (Util.isNull(name)) throw new NullPointerException();
- String server = servers.get(name.toLowerCase()).getName();
+ SubServer s = servers.get(name.toLowerCase());
+ String server = s.getName();
- SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, getSubServer(server));
+ SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, s);
plugin.getPluginManager().callEvent(event);
- if (getSubServer(server).isRunning()) {
- getSubServer(server).terminate();
+ if (s.isRunning()) {
+ s.stop();
+ s.waitFor();
}
Logger.get("SubServers").info("Saving...");
@@ -287,7 +290,6 @@ public class ExternalHost extends Host implements ClientHandler {
Logger.get("SubServers").info("Moving Files...");
queue(new PacketExDeleteServer(server, info, true, data -> {
if (data.getInt(0x0001) == 0 || data.getInt(0x0001) == 1) {
- for (String group : getSubServer(server).getGroups()) getSubServer(server).removeGroup(group);
servers.remove(server.toLowerCase());
Logger.get("SubServers").info("Deleted SubServer: " + server);
} else {
@@ -300,14 +302,15 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public boolean deleteSubServer(UUID player, String name) throws InterruptedException {
if (Util.isNull(name)) throw new NullPointerException();
- String server = servers.get(name.toLowerCase()).getName();
+ SubServer s = servers.get(name.toLowerCase());
+ String server = s.getName();
SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, getSubServer(server));
plugin.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
- if (getSubServer(server).isRunning()) {
- getSubServer(server).stop();
- getSubServer(server).waitFor();
+ if (s.isRunning()) {
+ s.stop();
+ s.waitFor();
}
Logger.get("SubServers").info("Saving...");
@@ -339,12 +342,14 @@ public class ExternalHost extends Host implements ClientHandler {
@Override
public boolean forceDeleteSubServer(UUID player, String name) throws InterruptedException {
if (Util.isNull(name)) throw new NullPointerException();
- String server = servers.get(name.toLowerCase()).getName();
+ SubServer s = servers.get(name.toLowerCase());
+ String server = s.getName();
SubRemoveServerEvent event = new SubRemoveServerEvent(player, this, getSubServer(server));
plugin.getPluginManager().callEvent(event);
- if (getSubServer(server).isRunning()) {
- getSubServer(server).terminate();
+ if (s.isRunning()) {
+ s.stop();
+ s.waitFor();
}
Logger.get("SubServers").info("Saving...");
@@ -363,7 +368,6 @@ public class ExternalHost extends Host implements ClientHandler {
Logger.get("SubServers").info("Removing Files...");
queue(new PacketExDeleteServer(server, info, false, data -> {
if (data.getInt(0x0001) == 0 || data.getInt(0x0001) == 1) {
- for (String group : getSubServer(server).getGroups()) getSubServer(server).removeGroup(group);
servers.remove(server.toLowerCase());
Logger.get("SubServers").info("Deleted SubServer: " + server);
} else {
diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalSubCreator.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalSubCreator.java
index ee0de72c..ace31faa 100644
--- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalSubCreator.java
+++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/External/ExternalSubCreator.java
@@ -4,6 +4,8 @@ import com.google.common.collect.Range;
import net.ME1312.Galaxi.Library.*;
import net.ME1312.Galaxi.Library.Callback.Callback;
import net.ME1312.Galaxi.Library.Callback.ReturnCallback;
+import net.ME1312.Galaxi.Library.Container.Container;
+import net.ME1312.Galaxi.Library.Container.NamedContainer;
import net.ME1312.SubData.Server.SubDataClient;
import net.ME1312.SubServers.Bungee.Event.SubCreateEvent;
import net.ME1312.SubServers.Bungee.Event.SubCreatedEvent;
@@ -103,7 +105,7 @@ public class ExternalSubCreator extends SubCreator {
if (!event.isCancelled()) {
Container address = new Container<>("$address$");
ReturnCallback