Trigger reconnect sequence for linking errors, too

This commit is contained in:
ME1312 2023-08-12 00:07:05 -04:00
parent 78f50e77b2
commit ad24b0deb3
No known key found for this signature in database
GPG Key ID: FEFFE2F698E88FA8
13 changed files with 18 additions and 18 deletions

View File

@ -67,7 +67,7 @@ public class InternalSubCreator extends SubCreator {
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) {
@ -82,6 +82,7 @@ public class InternalSubCreator extends SubCreator {
(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) {
@ -96,6 +97,7 @@ public class InternalSubCreator extends SubCreator {
(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 {
@ -265,7 +267,7 @@ public class InternalSubCreator extends SubCreator {
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;

View File

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

View File

@ -75,8 +75,7 @@ public class PacketLinkServer implements InitialPacket, PacketObjectIn<Integer>,
Bukkit.getLogger().info("SubData > Use the server \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
plugin.onDisable();
client.getConnection().close();
}
}
}

View File

@ -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"

View File

@ -79,8 +79,7 @@ public class PacketLinkServer implements InitialPacket, PacketObjectIn<Integer>,
log.info("Use the server \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
plugin.disable(null);
client.getConnection().close();
}
}
}

View File

@ -48,7 +48,7 @@ import static net.ME1312.SubServers.Client.Sponge.Library.AccessMode.NO_COMMANDS
/**
* 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;

View File

@ -42,7 +42,7 @@ import java.util.jar.Manifest;
/**
* 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;

View File

@ -272,7 +272,7 @@ public class SubCreatorImpl {
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) {
@ -288,6 +288,7 @@ public class SubCreatorImpl {
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;
@ -460,7 +461,7 @@ public class SubCreatorImpl {
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;

View File

@ -57,8 +57,7 @@ public class PacketLinkExHost implements InitialPacket, PacketObjectIn<Integer>,
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();
}
}
}

View File

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

View File

@ -65,7 +65,7 @@ public class PacketLinkProxy implements InitialPacket, PacketObjectIn<Integer>,
Logger.get("SubData").info("Use the proxy \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
client.getConnection().close();
}
}
}

View File

@ -64,7 +64,7 @@ import java.nio.charset.Charset;
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>();

View File

@ -65,7 +65,7 @@ public class PacketLinkProxy implements InitialPacket, PacketObjectIn<Integer>,
Logger.get("SubData").info("Use the proxy \"Name\" option to override auto-linking");
}
} catch (Exception e) {}
new IllegalStateException().printStackTrace();
client.getConnection().close();
}
}
}