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)
This commit is contained in:
ME1312 2018-09-14 21:05:39 -04:00
parent a687a2d1cb
commit a2e481efe7
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
4 changed files with 21 additions and 14 deletions

View File

@ -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<String, SubServer> servers = new HashMap<String, SubServer>();
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;

View File

@ -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);
}
}
}

View File

@ -9,6 +9,10 @@
<version>-PLACEHOLDER</version>
<packaging>jar</packaging>
<properties>
<galaxi.version>18w37b</galaxi.version>
</properties>
<repositories>
<repository>
<id>me1312-repo</id>
@ -17,11 +21,18 @@
</repositories>
<dependencies>
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiAPI</artifactId>
<version>${galaxi.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiEngine</artifactId>
<version>18w36d</version>
<scope>provided</scope>
<version>${galaxi.version}</version>
<scope>compile</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.msgpack</groupId>
@ -114,6 +125,10 @@
<outputDirectory>${basedir}/../Javadoc/SubServers.Host</outputDirectory>
<reportOutputDirectory>${basedir}/../Javadoc/SubServers.Host</reportOutputDirectory>
<additionalOptions>-Xdoclint:none</additionalOptions>
<includeDependencySources>true</includeDependencySources>
<dependencySourceIncludes>
<dependencySourceInclude>net.ME1312.Galaxi:GalaxiAPI:*</dependencySourceInclude>
</dependencySourceIncludes>
</configuration>
</execution>
</executions>

View File

@ -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<Version> versions = new LinkedList<Version>();