Skip to content

Commit

Permalink
Trigger reconnect sequence for linking errors, too
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed Aug 12, 2023
1 parent 78f50e7 commit ad24b0d
Show file tree
Hide file tree
Showing 13 changed files with 18 additions and 18 deletions.
Expand Up @@ -67,7 +67,7 @@ private class CreatorTask extends Thread {
private final LinkedList<String> replace;
private final HashMap<String, String> replacements;
private final Consumer<SubServer> callback;
private Boolean install;
private boolean install;
private Process process;

private CreatorTask(UUID player, String name, ServerTemplate template, Version version, int port, Consumer<SubServer> callback) {
Expand All @@ -82,6 +82,7 @@ private CreatorTask(UUID player, String name, ServerTemplate template, Version v
(this.replace = new LinkedList<String>()).add("/server.properties");
this.replacements = new HashMap<String, String>();
this.callback = callback;
this.install = true;
}

private CreatorTask(UUID player, SubServer server, ServerTemplate template, Version version, Consumer<SubServer> callback) {
Expand All @@ -96,6 +97,7 @@ private CreatorTask(UUID player, SubServer server, ServerTemplate template, Vers
(this.replace = new LinkedList<String>()).add("/server.properties");
this.replacements = new HashMap<String, String>();
this.callback = callback;
this.install = true;
}

private ObjectMap<String> build(File dir, ServerTemplate template, List<ServerTemplate> history, List<ServerTemplate> stack) throws SubCreatorException {
Expand Down Expand Up @@ -265,7 +267,7 @@ public void run() {
ReplacementScanner replacements = new ReplacementScanner(this.replacements);
if (config != null) {
try {
if (install != Boolean.FALSE) generateClient(dir, template.getType(), name);
if (install) generateClient(dir, template.getType(), name);
replacements.replace(dir, replace.toArray(new String[0]));
} catch (Exception e) {
config = null;
Expand Down
Expand Up @@ -94,7 +94,7 @@ public final class SubProxy extends BungeeCommon implements Listener {
public SubDataServer subdata = null;
public SubServer sudo = null;
public final Collection<Channel> listeners = super.listeners;
public static final Version version = Version.fromString("2.19a");
public static final Version version = Version.fromString("2.20a");

public final Proxy mProxy;
public boolean canSudo = false;
Expand Down
Expand Up @@ -75,8 +75,7 @@ public void receive(SubDataSender client, ObjectMap<Integer> data) {
Bukkit.getLogger().info("SubData > Use the server \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
plugin.onDisable();
client.getConnection().close();
}
}
}
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.19a"
version: "2.20a"
authors: ["ME1312"]
softdepend: [TitleAPI, PlaceholderAPI]
website: "https://github.com/ME1312/SubServers-2"
Expand Down
Expand Up @@ -79,8 +79,7 @@ public void receive(SubDataSender client, ObjectMap<Integer> data) {
log.info("Use the server \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
plugin.disable(null);
client.getConnection().close();
}
}
}
Expand Up @@ -48,7 +48,7 @@
/**
* SubServers Client Plugin Class
*/
@Plugin(id = "subservers-client-sponge", name = "SubServers-Client-Sponge", authors = "ME1312", version = "2.19a", 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.20a", 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.Host/src/net/ME1312/SubServers/Host/ExHost.java
Expand Up @@ -42,7 +42,7 @@
/**
* SubServers.Host Main Class
*/
@App(name = "SubServers.Host", version = "2.19a", authors = "ME1312", website = "https://github.com/ME1312/SubServers-2", description = "Host subservers on separate machines")
@App(name = "SubServers.Host", version = "2.20a", 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 @@ -272,7 +272,7 @@ private class CreatorTask extends Thread {
private final SubLoggerImpl log;
private final LinkedList<String> replace;
private final HashMap<String, String> replacements;
private Boolean install;
private boolean install;
private Process process;

private CreatorTask(UUID player, String name, ServerTemplate template, Version version, int port, Boolean mode, UUID address, UUID tracker) {
Expand All @@ -288,6 +288,7 @@ private CreatorTask(UUID player, String name, ServerTemplate template, Version v
this.log = new SubLoggerImpl(null, this, name + File.separator + ((update == null)?"Creator":"Updater"), address, new Container<Boolean>(true), null);
this.replacements = new HashMap<String, String>();
(this.replace = new LinkedList<String>()).add("/server.properties");
this.install = true;
this.address = address;
this.tracker = tracker;

Expand Down Expand Up @@ -460,7 +461,7 @@ public void run() {
ReplacementScanner replacements = new ReplacementScanner(this.replacements);
if (config != null) {
try {
if (install != Boolean.FALSE) generateClient(dir, template.getType(), name);
if (install) generateClient(dir, template.getType(), name);
replacements.replace(dir, replace.toArray(new String[0]));
} catch (Exception e) {
config = null;
Expand Down
Expand Up @@ -57,8 +57,7 @@ public void receive(SubDataSender client, ObjectMap<Integer> data) throws Throwa
setReady(client.getConnection());
} else {
log.severe("Could not link name with host" + ((data.contains(0x0002))?": "+data.getString(0x0002):'.'));
DebugUtil.logException(new IllegalStateException(), log);
GalaxiEngine.getInstance().stop();
client.getConnection().close();
}
}
}
Expand Up @@ -76,7 +76,7 @@ public final class ExProxy extends BungeeCommon implements Listener {
public final SubAPI api = new SubAPI(this);
public SubProtocol subprotocol;
public final Collection<Channel> listeners = super.listeners;
public static final Version version = Version.fromString("2.19a");
public static final Version version = Version.fromString("2.20a");

public final boolean isPatched;
public long lastReload = -1;
Expand Down
Expand Up @@ -65,7 +65,7 @@ public void receive(SubDataSender client, ObjectMap<Integer> data) {
Logger.get("SubData").info("Use the proxy \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
client.getConnection().close();
}
}
}
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.19a", 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.20a", 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 @@ -65,7 +65,7 @@ public void receive(SubDataSender client, ObjectMap<Integer> data) {
Logger.get("SubData").info("Use the proxy \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
client.getConnection().close();
}
}
}

0 comments on commit ad24b0d

Please sign in to comment.