Skip to content

Commit

Permalink
Update default templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Dec 1, 2021
1 parent a0b8df4 commit aef7a16
Show file tree
Hide file tree
Showing 28 changed files with 51 additions and 119 deletions.
2 changes: 1 addition & 1 deletion SubServers.Bungee/common/pom.xml
Expand Up @@ -28,7 +28,7 @@
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiUtil</artifactId>
<version>21w44c</version>
<version>21w47d</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
1 change: 0 additions & 1 deletion SubServers.Bungee/pom.xml
Expand Up @@ -84,7 +84,6 @@
<copy file="${basedir}/../Artifacts/SubServers.Client.Universal.jar" tofile="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/client.jar" />
<mkdir dir="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/Templates" />
<zip basedir="${basedir}/../SubServers.Creator" destfile="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/Templates/forge.zip" includes="Forge/**" />
<zip basedir="${basedir}/../SubServers.Creator" destfile="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/Templates/paper.zip" includes="Paper/**" />
<zip basedir="${basedir}/../SubServers.Creator" destfile="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/Templates/purpur.zip" includes="Purpur/**" />
<zip basedir="${basedir}/../SubServers.Creator" destfile="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/Templates/spigot.zip" includes="Spigot/**" />
<zip basedir="${basedir}/../SubServers.Creator" destfile="${project.build.directory}/classes/net/ME1312/SubServers/Bungee/Library/Files/Templates/sponge.zip" includes="Sponge/**" />
Expand Down
Expand Up @@ -534,6 +534,11 @@ public final String getSignature() {
return signature;
}

@Override
public boolean equals(Object obj) {
return obj instanceof Host && signature.equals(((Host) obj).signature);
}

@Override
public void addExtra(String handle, Object value) {
Util.nullpo(handle, value);
Expand Down
Expand Up @@ -156,6 +156,11 @@ public final String getSignature() {
return signature;
}

@Override
public boolean equals(Object obj) {
return obj instanceof Proxy && signature.equals(((Proxy) obj).signature);
}

@Override
public void addExtra(String handle, Object value) {
Util.nullpo(handle, value);
Expand Down
Expand Up @@ -265,6 +265,11 @@ public final String getSignature() {
return signature;
}

@Override
public boolean equals(Object obj) {
return obj instanceof ServerImpl && signature.equals(((ServerImpl) obj).signature);
}

@Override
public void addExtra(String handle, Object value) {
Util.nullpo(handle, value);
Expand Down
Expand Up @@ -537,4 +537,9 @@ protected ServerTemplate loadTemplate(String name, boolean enabled, boolean inte
* Reload SubCreator
*/
public abstract void reload();

@Override
public boolean equals(Object obj) {
return obj instanceof SubCreator && getHost().getSignature().equals(((SubCreator) obj).getHost().getSignature());
}
}
Expand Up @@ -188,7 +188,12 @@ public List<SubServer> getCurrentIncompatibilities() {
return servers;
}

@SuppressWarnings({"deprecation", "unchecked"})
@Override
public boolean equals(Object obj) {
return obj instanceof SubServerImpl && super.equals(obj);
}

@SuppressWarnings("deprecation")
@Override
public ObjectMap<String> forSubData() {
ObjectMap<String> sinfo = super.forSubData();
Expand Down
23 changes: 8 additions & 15 deletions SubServers.Bungee/src/net/ME1312/SubServers/Bungee/SubProxy.java
Expand Up @@ -92,7 +92,7 @@ public final class SubProxy extends BungeeCommon implements Listener {
public SubProtocol subprotocol;
public SubDataServer subdata = null;
public SubServer sudo = null;
public static final Version version = Version.fromString("2.17.1a");
public static final Version version = Version.fromString("2.18a");

public final Proxy mProxy;
public boolean canSudo = false;
Expand Down Expand Up @@ -145,9 +145,6 @@ public final class SubProxy extends BungeeCommon implements Listener {
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/spigot.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Created ./SubServers/Templates/Spigot");

Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/paper.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Created ./SubServers/Templates/Paper");

Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/purpur.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Created ./SubServers/Templates/Purpur");

Expand All @@ -158,34 +155,30 @@ public final class SubProxy extends BungeeCommon implements Listener {
Logger.get("SubServers").info("Created ./SubServers/Templates/Sponge");
} else {
long stamp = Math.round(Math.random() * 100000);
Version version = new Version("2.16a+");
Version tv1 = new Version("2.16a+");
Version tv2 = new Version("2.18a+");

if (new File(dir, "Templates/Vanilla/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Vanilla/template.yml"))).get().getVersion("Version", version)).compareTo(version) != 0) {
if (new File(dir, "Templates/Vanilla/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Vanilla/template.yml"))).get().getVersion("Version", tv2)).compareTo(tv2) != 0) {
Files.move(new File(dir, "Templates/Vanilla").toPath(), new File(dir, "Templates/Vanilla." + stamp + ".x").toPath());
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/vanilla.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Updated ./SubServers/Templates/Vanilla");
}
if (new File(dir, "Templates/Spigot/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Spigot/template.yml"))).get().getVersion("Version", version)).compareTo(version) != 0) {
if (new File(dir, "Templates/Spigot/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Spigot/template.yml"))).get().getVersion("Version", tv1)).compareTo(tv1) != 0) {
Files.move(new File(dir, "Templates/Spigot").toPath(), new File(dir, "Templates/Spigot." + stamp + ".x").toPath());
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/spigot.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Updated ./SubServers/Templates/Spigot");
}
if (new File(dir, "Templates/Paper/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Paper/template.yml"))).get().getVersion("Version", version)).compareTo(version) != 0) {
Files.move(new File(dir, "Templates/Paper").toPath(), new File(dir, "Templates/Paper." + stamp + ".x").toPath());
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/paper.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Updated ./SubServers/Templates/Paper");
}
if (new File(dir, "Templates/Purpur/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Purpur/template.yml"))).get().getVersion("Version", version)).compareTo(version) != 0) {
if (new File(dir, "Templates/Purpur/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Purpur/template.yml"))).get().getVersion("Version", tv2)).compareTo(tv2) != 0) {
Files.move(new File(dir, "Templates/Purpur").toPath(), new File(dir, "Templates/Purpur." + stamp + ".x").toPath());
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/purpur.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Updated ./SubServers/Templates/Purpur");
}
if (new File(dir, "Templates/Forge/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Forge/template.yml"))).get().getVersion("Version", version)).compareTo(version) != 0) {
if (new File(dir, "Templates/Forge/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Forge/template.yml"))).get().getVersion("Version", tv2)).compareTo(tv2) != 0) {
Files.move(new File(dir, "Templates/Forge").toPath(), new File(dir, "Templates/Forge." + stamp + ".x").toPath());
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/forge.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Updated ./SubServers/Templates/Forge");
}
if (new File(dir, "Templates/Sponge/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Sponge/template.yml"))).get().getVersion("Version", version)).compareTo(version) != 0) {
if (new File(dir, "Templates/Sponge/template.yml").exists() && ((new YAMLConfig(new File(dir, "Templates/Sponge/template.yml"))).get().getVersion("Version", tv1)).compareTo(tv1) != 0) {
Files.move(new File(dir, "Templates/Sponge").toPath(), new File(dir, "Templates/Sponge." + stamp + ".x").toPath());
Directories.unzip(SubProxy.class.getResourceAsStream("/net/ME1312/SubServers/Bungee/Library/Files/Templates/sponge.zip"), new File(dir, "Templates"));
Logger.get("SubServers").info("Updated ./SubServers/Templates/Sponge");
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Client/Bukkit/src/plugin.yml
@@ -1,6 +1,6 @@
name: SubServers-Client-Bukkit
main: net.ME1312.SubServers.Client.Bukkit.SubPlugin
version: "2.17.1a"
version: "2.18a"
authors: ["ME1312"]
softdepend: [TitleAPI, PlaceholderAPI]
website: "https://github.com/ME1312/SubServers-2"
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Client/Common/pom.xml
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiUtil</artifactId>
<version>21w44c</version>
<version>21w47d</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Expand Up @@ -47,7 +47,7 @@
/**
* SubServers Client Plugin Class
*/
@Plugin(id = "subservers-client-sponge", name = "SubServers-Client-Sponge", authors = "ME1312", version = "2.17.1a", url = "https://github.com/ME1312/SubServers-2", description = "Take control of the server manager — from your servers")
@Plugin(id = "subservers-client-sponge", name = "SubServers-Client-Sponge", authors = "ME1312", version = "2.18a", url = "https://github.com/ME1312/SubServers-2", description = "Take control of the server manager — from your servers")
public final class SubPlugin {
HashMap<Integer, SubDataClient> subdata = new HashMap<Integer, SubDataClient>();
Pair<Long, Map<String, Map<String, String>>> lang = null;
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Console/src/bungee.yml
@@ -1,4 +1,4 @@
name: SubServers-Console
main: net.ME1312.SubServers.Console.ConsolePlugin
version: 2.17.1a
version: 2.18a
author: ME1312
2 changes: 1 addition & 1 deletion SubServers.Creator/Forge/template.yml
@@ -1,4 +1,4 @@
Version: '2.16a+'
Version: '2.18a+'
Template:
Enabled: true
Icon: 'anvil'
Expand Down
52 changes: 0 additions & 52 deletions SubServers.Creator/Paper/build.sh

This file was deleted.

2 changes: 0 additions & 2 deletions SubServers.Creator/Paper/eula.txt

This file was deleted.

10 changes: 0 additions & 10 deletions SubServers.Creator/Paper/server.properties

This file was deleted.

3 changes: 0 additions & 3 deletions SubServers.Creator/Paper/spigot.yml

This file was deleted.

12 changes: 0 additions & 12 deletions SubServers.Creator/Paper/template.yml

This file was deleted.

2 changes: 1 addition & 1 deletion SubServers.Creator/Purpur/template.yml
@@ -1,4 +1,4 @@
Version: '2.16a+'
Version: '2.18a+'
Template:
Enabled: true
Icon: 'purpur_block'
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Creator/Vanilla/build.sh
Expand Up @@ -24,7 +24,7 @@ if [[ -z "$cache" ]] || [[ ! -f "$cache/Vanilla-$version.jar" ]]; then
fi
mkdir VanillaCord
echo Downloading the VanillaCord Launcher...
__DL VanillaCord/VanillaCord.jar https://dev.me1312.net/jenkins/job/VanillaCord/job/master/lastSuccessfulBuild/artifact/artifacts/VanillaCord.jar; __RETURN=$?
__DL VanillaCord/VanillaCord.jar https://dev.me1312.net/jenkins/job/VanillaCord/lastSuccessfulBuild/artifact/artifacts/VanillaCord.jar; __RETURN=$?
if [[ $__RETURN -eq 0 ]]; then
cd VanillaCord
echo Launching VanillaCord
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Creator/Vanilla/template.yml
@@ -1,4 +1,4 @@
Version: '2.16a+'
Version: '2.18a+'
Template:
Enabled: true
Icon: 'bukkit:grass'
Expand Down
4 changes: 2 additions & 2 deletions SubServers.Host/pom.xml
Expand Up @@ -30,13 +30,13 @@
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiEngine</artifactId>
<version>21w44c</version>
<version>21w47d</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.ME1312.Galaxi</groupId>
<artifactId>GalaxiUI</artifactId>
<version>21w44c</version>
<version>21w47d</version>
<scope>runtime</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion SubServers.Host/src/net/ME1312/SubServers/Host/ExHost.java
Expand Up @@ -42,7 +42,7 @@
/**
* SubServers.Host Main Class
*/
@App(name = "SubServers.Host", version = "2.17.1a", authors = "ME1312", website = "https://github.com/ME1312/SubServers-2", description = "Host subservers on separate machines")
@App(name = "SubServers.Host", version = "2.18a", authors = "ME1312", website = "https://github.com/ME1312/SubServers-2", description = "Host subservers on separate machines")
public final class ExHost {
HashMap<Integer, SubDataClient> subdata = new HashMap<Integer, SubDataClient>();
Pair<Long, Map<String, Map<String, String>>> lang = null;
Expand Down
Expand Up @@ -1008,12 +1008,10 @@ private void selectServers(CommandSender sender, String[] rargs, int index, bool
i++;
}

LinkedList<Server> history = new LinkedList<Server>();
LinkedList<Server> servers = new LinkedList<Server>();
LinkedList<SubServer> subservers = new LinkedList<SubServer>();
for (Server server : select) {
if (!history.contains(server)) {
history.add(server);
if (!servers.contains(server)) {
servers.add(server);
if (server instanceof SubServer)
subservers.add((SubServer) server);
Expand Down
Expand Up @@ -74,7 +74,7 @@ public final class ExProxy extends BungeeCommon implements Listener {
public final Plugin plugin;
public final SubAPI api = new SubAPI(this);
public SubProtocol subprotocol;
public static final Version version = Version.fromString("2.17.1a");
public static final Version version = Version.fromString("2.18a");

public final boolean isPatched;
public long lastReload = -1;
Expand Down
Expand Up @@ -761,12 +761,10 @@ private void selectServers(CommandSender sender, String[] rargs, int index, bool
i++;
}

LinkedList<Server> history = new LinkedList<Server>();
LinkedList<Server> servers = new LinkedList<Server>();
LinkedList<SubServer> subservers = new LinkedList<SubServer>();
for (Server server : select) {
if (!history.contains(server)) {
history.add(server);
if (!servers.contains(server)) {
servers.add(server);
if (server instanceof SubServer)
subservers.add((SubServer) server);
Expand Down
Expand Up @@ -64,7 +64,7 @@
import java.util.*;
import java.util.concurrent.TimeUnit;

@Plugin(id = "subservers-sync", name = "SubServers-Sync", authors = "ME1312", version = "2.17.1a/pr1", url = "https://github.com/ME1312/SubServers-2", description = "Dynamically sync player and server connection info over multiple proxy instances")
@Plugin(id = "subservers-sync", name = "SubServers-Sync", authors = "ME1312", version = "2.18a", url = "https://github.com/ME1312/SubServers-2", description = "Dynamically sync player and server connection info over multiple proxy instances")
public class ExProxy {

HashMap<Integer, SubDataClient> subdata = new HashMap<Integer, SubDataClient>();
Expand Down
Expand Up @@ -766,12 +766,10 @@ private void selectServers(CommandSource sender, String[] rargs, int index, bool
i++;
}

LinkedList<Server> history = new LinkedList<Server>();
LinkedList<Server> servers = new LinkedList<Server>();
LinkedList<SubServer> subservers = new LinkedList<SubServer>();
for (Server server : select) {
if (!history.contains(server)) {
history.add(server);
if (!servers.contains(server)) {
servers.add(server);
if (server instanceof SubServer)
subservers.add((SubServer) server);
Expand Down

0 comments on commit aef7a16

Please sign in to comment.