From a2e481efe7da208c2bd5579885ba4ddb194f3824 Mon Sep 17 00:00:00 2001 From: ME1312 Date: Fri, 14 Sep 2018 21:05:39 -0400 Subject: [PATCH] Patch in GalaxiEngine by default This is to remove the confusion of what versions are compatable with eachother (it's not quite as easy as it is with BungeeCord) --- .../Bungee/Host/Internal/InternalHost.java | 2 ++ .../net/ME1312/SubServers/Bungee/Launch.java | 12 +----------- SubServers.Host/pom.xml | 19 +++++++++++++++++-- .../net/ME1312/SubServers/Host/ExHost.java | 2 +- 4 files changed, 21 insertions(+), 14 deletions(-) diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/Internal/InternalHost.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/Internal/InternalHost.java index 5475c0e1..fbca3894 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/Internal/InternalHost.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Host/Internal/InternalHost.java @@ -21,6 +21,7 @@ import java.util.*; * Internal Host Class */ public class InternalHost extends Host { + public static final boolean DRM_ALLOW = System.getProperty("RM.subservers", "true").equalsIgnoreCase("true"); private HashMap servers = new HashMap(); private String name; private boolean enabled; @@ -41,6 +42,7 @@ public class InternalHost extends Host { */ public InternalHost(SubPlugin plugin, String name, Boolean enabled, InetAddress address, String directory, String gitBash) { super(plugin, name, enabled, address, directory, gitBash); + if (!DRM_ALLOW) throw new IllegalStateException("SubServers' hosting capabilities have been disabled by your provider"); if (Util.isNull(plugin, name, enabled, address, directory, gitBash)) throw new NullPointerException(); this.plugin = plugin; this.name = name; diff --git a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java index 98d2c5a8..59ad9ce2 100644 --- a/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java +++ b/SubServers.Bungee/src/net/ME1312/SubServers/Bungee/Launch.java @@ -36,7 +36,7 @@ public final class Launch { System.out.println("*******************************************"); System.out.println(""); System.exit(1); - } else if (System.getProperty("RM.subservers", "true").equalsIgnoreCase("true")) { + } else { Security.setProperty("networkaddress.cache.ttl", "30"); Security.setProperty("networkaddress.cache.negative.ttl", "10"); final boolean patched = net.md_5.bungee.BungeeCord.class.getPackage().getImplementationTitle() != null && net.md_5.bungee.BungeeCord.class.getPackage().getImplementationTitle().equals("SubServers.Bungee"); @@ -123,16 +123,6 @@ public final class Launch { } } } - } else { - System.out.println(""); - System.out.println("*******************************************"); - System.out.println("*** SubServers code has been disallowed ***"); - System.out.println("*** to work on this machine. Check with ***"); - System.out.println("*** your provider for more information. ***"); - System.out.println("*** Attempting re-launch as BungeeCord. ***"); - System.out.println("*******************************************"); - System.out.println(""); - net.md_5.bungee.BungeeCordLauncher.class.getMethod("main", String[].class).invoke(null, (Object) args); } } } \ No newline at end of file diff --git a/SubServers.Host/pom.xml b/SubServers.Host/pom.xml index 9de8e512..adda9129 100644 --- a/SubServers.Host/pom.xml +++ b/SubServers.Host/pom.xml @@ -9,6 +9,10 @@ -PLACEHOLDER jar + + 18w37b + + me1312-repo @@ -17,11 +21,18 @@ + + net.ME1312.Galaxi + GalaxiAPI + ${galaxi.version} + compile + net.ME1312.Galaxi GalaxiEngine - 18w36d - provided + ${galaxi.version} + compile + true org.msgpack @@ -114,6 +125,10 @@ ${basedir}/../Javadoc/SubServers.Host ${basedir}/../Javadoc/SubServers.Host -Xdoclint:none + true + + net.ME1312.Galaxi:GalaxiAPI:* + diff --git a/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java b/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java index 4cd4d2bb..a8b2a047 100644 --- a/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java +++ b/SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java @@ -189,7 +189,7 @@ public final class ExHost { loadDefaults(); new Metrics(this); - engine.setUpdateChecker(() -> { + info.setUpdateChecker(() -> { try { YAMLSection tags = new YAMLSection(new JSONObject("{\"tags\":" + Util.readAll(new BufferedReader(new InputStreamReader(new URL("https://api.github.com/repos/ME1312/SubServers-2/git/refs/tags").openStream(), Charset.forName("UTF-8")))) + '}')); List versions = new LinkedList();