mirror of
https://github.com/ME1312/SubServers-2.git
synced 2025-02-17 20:21:33 +01:00
Don't remote reload SubData
It doesn't make any sense to be doing this...
This commit is contained in:
parent
2841bdf061
commit
c261be2215
@ -25,7 +25,7 @@ public class PacketInExReload implements PacketObjectIn<Integer> {
|
|||||||
@Override
|
@Override
|
||||||
public void receive(SubDataSender client, ObjectMap<Integer> data) {
|
public void receive(SubDataSender client, ObjectMap<Integer> data) {
|
||||||
if (data != null && data.contains(0x0000)) Bukkit.getLogger().warning("SubData > Received request for a plugin reload: " + data.getString(0x0000));
|
if (data != null && data.contains(0x0000)) Bukkit.getLogger().warning("SubData > Received request for a plugin reload: " + data.getString(0x0000));
|
||||||
else Bukkit.getLogger().warning("SubData > Received request for a plugin reload");
|
// else Bukkit.getLogger().warning("SubData > Received request for a plugin reload");
|
||||||
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
|
||||||
try {
|
try {
|
||||||
plugin.reload(true);
|
plugin.reload(true);
|
||||||
|
@ -85,12 +85,38 @@ public final class SubPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
getServer().getMessenger().registerOutgoingPluginChannel(this, "BungeeCord");
|
||||||
|
reload(false);
|
||||||
|
|
||||||
|
subdata.put(0, null);
|
||||||
subprotocol = SubProtocol.get();
|
subprotocol = SubProtocol.get();
|
||||||
subprotocol.registerCipher("DHE", DHE.get(128));
|
subprotocol.registerCipher("DHE", DHE.get(128));
|
||||||
subprotocol.registerCipher("DHE-128", DHE.get(128));
|
subprotocol.registerCipher("DHE-128", DHE.get(128));
|
||||||
subprotocol.registerCipher("DHE-192", DHE.get(192));
|
subprotocol.registerCipher("DHE-192", DHE.get(192));
|
||||||
subprotocol.registerCipher("DHE-256", DHE.get(256));
|
subprotocol.registerCipher("DHE-256", DHE.get(256));
|
||||||
reload(false);
|
subprotocol.setBlockSize(config.get().getMap("Settings").getMap("SubData").getLong("Block-Size", (long) DataSize.MB));
|
||||||
|
api.name = config.get().getMap("Settings").getMap("SubData").getString("Name", System.getenv("name"));
|
||||||
|
|
||||||
|
if (config.get().getMap("Settings").getMap("SubData").getRawString("Password", "").length() > 0) {
|
||||||
|
subprotocol.registerCipher("AES", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-128", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-192", new AES(192, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-256", new AES(256, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
|
||||||
|
System.out.println("SubData > AES Encryption Available");
|
||||||
|
}
|
||||||
|
if (new UniversalFile(getDataFolder(), "subdata.rsa.key").exists()) {
|
||||||
|
try {
|
||||||
|
subprotocol.registerCipher("RSA", new RSA(new UniversalFile(getDataFolder(), "subdata.rsa.key")));
|
||||||
|
System.out.println("SubData > RSA Encryption Available");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reconnect = true;
|
||||||
|
System.out.println("SubData > ");
|
||||||
|
System.out.println("SubData > Connecting to /" + config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391"));
|
||||||
|
connect(null);
|
||||||
|
|
||||||
if (!config.get().getMap("Settings").getBoolean("API-Only-Mode", false)) {
|
if (!config.get().getMap("Settings").getBoolean("API-Only-Mode", false)) {
|
||||||
CommandMap cmd = Util.reflect(Bukkit.getServer().getClass().getDeclaredField("commandMap"), Bukkit.getServer());
|
CommandMap cmd = Util.reflect(Bukkit.getServer().getClass().getDeclaredField("commandMap"), Bukkit.getServer());
|
||||||
@ -130,51 +156,11 @@ public final class SubPlugin extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void reload(boolean notifyPlugins) throws IOException {
|
public void reload(boolean notifyPlugins) throws IOException {
|
||||||
reconnect = false;
|
|
||||||
resetDate = Calendar.getInstance().getTime().getTime();
|
resetDate = Calendar.getInstance().getTime().getTime();
|
||||||
ArrayList<SubDataClient> tmp = new ArrayList<SubDataClient>();
|
|
||||||
tmp.addAll(subdata.values());
|
|
||||||
for (SubDataClient client : tmp) if (client != null) {
|
|
||||||
client.close();
|
|
||||||
Util.isException(client::waitFor);
|
|
||||||
}
|
|
||||||
subdata.clear();
|
|
||||||
subdata.put(0, null);
|
|
||||||
|
|
||||||
ConfigUpdater.updateConfig(new UniversalFile(getDataFolder(), "config.yml"));
|
ConfigUpdater.updateConfig(new UniversalFile(getDataFolder(), "config.yml"));
|
||||||
config.reload();
|
config.reload();
|
||||||
|
|
||||||
subprotocol.unregisterCipher("AES");
|
|
||||||
subprotocol.unregisterCipher("AES-128");
|
|
||||||
subprotocol.unregisterCipher("AES-192");
|
|
||||||
subprotocol.unregisterCipher("AES-256");
|
|
||||||
subprotocol.unregisterCipher("RSA");
|
|
||||||
|
|
||||||
subprotocol.setBlockSize(config.get().getMap("Settings").getMap("SubData").getLong("Block-Size", (long) DataSize.MB));
|
|
||||||
api.name = config.get().getMap("Settings").getMap("SubData").getString("Name", System.getenv("name"));
|
|
||||||
|
|
||||||
if (config.get().getMap("Settings").getMap("SubData").getRawString("Password", "").length() > 0) {
|
|
||||||
subprotocol.registerCipher("AES", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-128", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-192", new AES(192, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-256", new AES(256, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
|
|
||||||
System.out.println("SubData > AES Encryption Available");
|
|
||||||
}
|
|
||||||
if (new UniversalFile(getDataFolder(), "subdata.rsa.key").exists()) {
|
|
||||||
try {
|
|
||||||
subprotocol.registerCipher("RSA", new RSA(new UniversalFile(getDataFolder(), "subdata.rsa.key")));
|
|
||||||
System.out.println("SubData > RSA Encryption Available");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reconnect = true;
|
|
||||||
System.out.println("SubData > ");
|
|
||||||
System.out.println("SubData > Connecting to /" + config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391"));
|
|
||||||
connect(null);
|
|
||||||
|
|
||||||
if (notifyPlugins) {
|
if (notifyPlugins) {
|
||||||
List<Runnable> listeners = api.reloadListeners;
|
List<Runnable> listeners = api.reloadListeners;
|
||||||
if (listeners.size() > 0) {
|
if (listeners.size() > 0) {
|
||||||
|
@ -30,7 +30,7 @@ public class PacketInExReload implements PacketObjectIn<Integer> {
|
|||||||
public void receive(SubDataSender client, ObjectMap<Integer> data) {
|
public void receive(SubDataSender client, ObjectMap<Integer> data) {
|
||||||
Logger log = Util.getDespiteException(() -> Util.reflect(SubDataClient.class.getDeclaredField("log"), client.getConnection()), null);
|
Logger log = Util.getDespiteException(() -> Util.reflect(SubDataClient.class.getDeclaredField("log"), client.getConnection()), null);
|
||||||
if (data != null && data.contains(0x0000)) log.warning("Received request for a plugin reload: " + data.getString(0x0000));
|
if (data != null && data.contains(0x0000)) log.warning("Received request for a plugin reload: " + data.getString(0x0000));
|
||||||
else log.warning("Received request for a plugin reload");
|
// else log.warning("Received request for a plugin reload");
|
||||||
Sponge.getScheduler().createTaskBuilder().async().execute(() -> {
|
Sponge.getScheduler().createTaskBuilder().async().execute(() -> {
|
||||||
try {
|
try {
|
||||||
plugin.reload(true);
|
plugin.reload(true);
|
||||||
|
@ -104,12 +104,39 @@ public final class SubPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
running = true;
|
running = true;
|
||||||
|
reload(false);
|
||||||
|
|
||||||
|
subdata.put(0, null);
|
||||||
subprotocol = SubProtocol.get();
|
subprotocol = SubProtocol.get();
|
||||||
subprotocol.registerCipher("DHE", DHE.get(128));
|
subprotocol.registerCipher("DHE", DHE.get(128));
|
||||||
subprotocol.registerCipher("DHE-128", DHE.get(128));
|
subprotocol.registerCipher("DHE-128", DHE.get(128));
|
||||||
subprotocol.registerCipher("DHE-192", DHE.get(192));
|
subprotocol.registerCipher("DHE-192", DHE.get(192));
|
||||||
subprotocol.registerCipher("DHE-256", DHE.get(256));
|
subprotocol.registerCipher("DHE-256", DHE.get(256));
|
||||||
reload(false);
|
subprotocol.setBlockSize(config.get().getMap("Settings").getMap("SubData").getLong("Block-Size", (long) DataSize.MB));
|
||||||
|
api.name = config.get().getMap("Settings").getMap("SubData").getString("Name", System.getenv("name"));
|
||||||
|
Logger log = LoggerFactory.getLogger("SubData");
|
||||||
|
|
||||||
|
if (config.get().getMap("Settings").getMap("SubData").getRawString("Password", "").length() > 0) {
|
||||||
|
subprotocol.registerCipher("AES", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-128", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-192", new AES(192, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-256", new AES(256, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
|
||||||
|
log.info("AES Encryption Available");
|
||||||
|
}
|
||||||
|
if (new UniversalFile(dir, "subdata.rsa.key").exists()) {
|
||||||
|
try {
|
||||||
|
subprotocol.registerCipher("RSA", new RSA(new UniversalFile(dir, "subdata.rsa.key")));
|
||||||
|
log.info("RSA Encryption Available");
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reconnect = true;
|
||||||
|
log.info(" ");
|
||||||
|
log.info("Connecting to /" + config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391"));
|
||||||
|
connect(null);
|
||||||
|
|
||||||
if (!config.get().getMap("Settings").getBoolean("API-Only-Mode", false)) {
|
if (!config.get().getMap("Settings").getBoolean("API-Only-Mode", false)) {
|
||||||
//gui = new InternalUIHandler(this);
|
//gui = new InternalUIHandler(this);
|
||||||
@ -143,52 +170,11 @@ public final class SubPlugin {
|
|||||||
|
|
||||||
|
|
||||||
public void reload(boolean notifyPlugins) throws IOException {
|
public void reload(boolean notifyPlugins) throws IOException {
|
||||||
reconnect = false;
|
|
||||||
resetDate = Calendar.getInstance().getTime().getTime();
|
resetDate = Calendar.getInstance().getTime().getTime();
|
||||||
ArrayList<SubDataClient> tmp = new ArrayList<SubDataClient>();
|
|
||||||
tmp.addAll(subdata.values());
|
|
||||||
for (SubDataClient client : tmp) if (client != null) {
|
|
||||||
client.close();
|
|
||||||
Util.isException(client::waitFor);
|
|
||||||
}
|
|
||||||
subdata.clear();
|
|
||||||
subdata.put(0, null);
|
|
||||||
|
|
||||||
ConfigUpdater.updateConfig(new UniversalFile(dir, "config.yml"));
|
ConfigUpdater.updateConfig(new UniversalFile(dir, "config.yml"));
|
||||||
config.reload();
|
config.reload();
|
||||||
|
|
||||||
subprotocol.unregisterCipher("AES");
|
|
||||||
subprotocol.unregisterCipher("AES-128");
|
|
||||||
subprotocol.unregisterCipher("AES-192");
|
|
||||||
subprotocol.unregisterCipher("AES-256");
|
|
||||||
subprotocol.unregisterCipher("RSA");
|
|
||||||
|
|
||||||
subprotocol.setBlockSize(config.get().getMap("Settings").getMap("SubData").getLong("Block-Size", (long) DataSize.MB));
|
|
||||||
api.name = config.get().getMap("Settings").getMap("SubData").getString("Name", System.getenv("name"));
|
|
||||||
Logger log = LoggerFactory.getLogger("SubData");
|
|
||||||
|
|
||||||
if (config.get().getMap("Settings").getMap("SubData").getRawString("Password", "").length() > 0) {
|
|
||||||
subprotocol.registerCipher("AES", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-128", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-192", new AES(192, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-256", new AES(256, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
|
|
||||||
log.info("AES Encryption Available");
|
|
||||||
}
|
|
||||||
if (new UniversalFile(dir, "subdata.rsa.key").exists()) {
|
|
||||||
try {
|
|
||||||
subprotocol.registerCipher("RSA", new RSA(new UniversalFile(dir, "subdata.rsa.key")));
|
|
||||||
log.info("RSA Encryption Available");
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reconnect = true;
|
|
||||||
log.info(" ");
|
|
||||||
log.info("Connecting to /" + config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391"));
|
|
||||||
connect(null);
|
|
||||||
|
|
||||||
if (notifyPlugins) {
|
if (notifyPlugins) {
|
||||||
List<Runnable> listeners = api.reloadListeners;
|
List<Runnable> listeners = api.reloadListeners;
|
||||||
if (listeners.size() > 0) {
|
if (listeners.size() > 0) {
|
||||||
|
@ -170,17 +170,44 @@ public final class ExHost {
|
|||||||
Util.reflect(SubLoggerImpl.class.getDeclaredField("logn"), null, config.get().getMap("Settings").getBoolean("Network-Log", true));
|
Util.reflect(SubLoggerImpl.class.getDeclaredField("logn"), null, config.get().getMap("Settings").getBoolean("Network-Log", true));
|
||||||
Util.reflect(SubLoggerImpl.class.getDeclaredField("logc"), null, config.get().getMap("Settings").getBoolean("Console-Log", true));
|
Util.reflect(SubLoggerImpl.class.getDeclaredField("logc"), null, config.get().getMap("Settings").getBoolean("Console-Log", true));
|
||||||
|
|
||||||
|
loadDefaults();
|
||||||
engine.getPluginManager().loadPlugins(new UniversalFile(engine.getRuntimeDirectory(), "Plugins"));
|
engine.getPluginManager().loadPlugins(new UniversalFile(engine.getRuntimeDirectory(), "Plugins"));
|
||||||
|
|
||||||
running = true;
|
running = true;
|
||||||
creator = new SubCreatorImpl(this);
|
creator = new SubCreatorImpl(this);
|
||||||
|
reload(false);
|
||||||
|
|
||||||
|
subdata.put(0, null);
|
||||||
subprotocol = SubProtocol.get();
|
subprotocol = SubProtocol.get();
|
||||||
subprotocol.registerCipher("DHE", DHE.get(128));
|
subprotocol.registerCipher("DHE", DHE.get(128));
|
||||||
subprotocol.registerCipher("DHE-128", DHE.get(128));
|
subprotocol.registerCipher("DHE-128", DHE.get(128));
|
||||||
subprotocol.registerCipher("DHE-192", DHE.get(192));
|
subprotocol.registerCipher("DHE-192", DHE.get(192));
|
||||||
subprotocol.registerCipher("DHE-256", DHE.get(256));
|
subprotocol.registerCipher("DHE-256", DHE.get(256));
|
||||||
loadDefaults();
|
subprotocol.setBlockSize(config.get().getMap("Settings").getMap("SubData").getLong("Block-Size", (long) DataSize.MB));
|
||||||
reload(false);
|
api.name = config.get().getMap("Settings").getMap("SubData").getString("Name", null);
|
||||||
|
Logger log = new Logger("SubData");
|
||||||
|
|
||||||
|
if (config.get().getMap("Settings").getMap("SubData").getRawString("Password", "").length() > 0) {
|
||||||
|
subprotocol.registerCipher("AES", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-128", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-192", new AES(192, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
subprotocol.registerCipher("AES-256", new AES(256, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
||||||
|
|
||||||
|
log.info.println("AES Encryption Available");
|
||||||
|
}
|
||||||
|
if (new UniversalFile(engine.getRuntimeDirectory(), "subdata.rsa.key").exists()) {
|
||||||
|
try {
|
||||||
|
subprotocol.registerCipher("RSA", new RSA(new UniversalFile(engine.getRuntimeDirectory(), "subdata.rsa.key")));
|
||||||
|
log.info.println("RSA Encryption Available");
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error.println(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reconnect = true;
|
||||||
|
log.info.println();
|
||||||
|
log.info.println("Connecting to /" + config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391"));
|
||||||
|
connect(log.toPrimitive(), null);
|
||||||
|
|
||||||
new Metrics(this);
|
new Metrics(this);
|
||||||
info.setUpdateChecker(() -> {
|
info.setUpdateChecker(() -> {
|
||||||
@ -224,52 +251,11 @@ public final class ExHost {
|
|||||||
|
|
||||||
public void reload(boolean notifyPlugins) throws IOException {
|
public void reload(boolean notifyPlugins) throws IOException {
|
||||||
resetDate = Calendar.getInstance().getTime().getTime();
|
resetDate = Calendar.getInstance().getTime().getTime();
|
||||||
reconnect = false;
|
|
||||||
ArrayList<SubDataClient> tmp = new ArrayList<SubDataClient>();
|
|
||||||
tmp.addAll(subdata.values());
|
|
||||||
for (SubDataClient client : tmp) if (client != null) {
|
|
||||||
client.close();
|
|
||||||
Util.isException(client::waitFor);
|
|
||||||
}
|
|
||||||
subdata.clear();
|
|
||||||
subdata.put(0, null);
|
|
||||||
|
|
||||||
ConfigUpdater.updateConfig(new UniversalFile(engine.getRuntimeDirectory(), "config.yml"));
|
ConfigUpdater.updateConfig(new UniversalFile(engine.getRuntimeDirectory(), "config.yml"));
|
||||||
config.reload();
|
config.reload();
|
||||||
creator.load(false);
|
creator.load(false);
|
||||||
|
|
||||||
subprotocol.unregisterCipher("AES");
|
|
||||||
subprotocol.unregisterCipher("AES-128");
|
|
||||||
subprotocol.unregisterCipher("AES-192");
|
|
||||||
subprotocol.unregisterCipher("AES-256");
|
|
||||||
subprotocol.unregisterCipher("RSA");
|
|
||||||
|
|
||||||
subprotocol.setBlockSize(config.get().getMap("Settings").getMap("SubData").getLong("Block-Size", (long) DataSize.MB));
|
|
||||||
api.name = config.get().getMap("Settings").getMap("SubData").getString("Name", null);
|
|
||||||
Logger log = new Logger("SubData");
|
|
||||||
|
|
||||||
if (config.get().getMap("Settings").getMap("SubData").getRawString("Password", "").length() > 0) {
|
|
||||||
subprotocol.registerCipher("AES", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-128", new AES(128, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-192", new AES(192, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
subprotocol.registerCipher("AES-256", new AES(256, config.get().getMap("Settings").getMap("SubData").getRawString("Password")));
|
|
||||||
|
|
||||||
log.info.println("AES Encryption Available");
|
|
||||||
}
|
|
||||||
if (new UniversalFile(engine.getRuntimeDirectory(), "subdata.rsa.key").exists()) {
|
|
||||||
try {
|
|
||||||
subprotocol.registerCipher("RSA", new RSA(new UniversalFile(engine.getRuntimeDirectory(), "subdata.rsa.key")));
|
|
||||||
log.info.println("RSA Encryption Available");
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error.println(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
reconnect = true;
|
|
||||||
log.info.println();
|
|
||||||
log.info.println("Connecting to /" + config.get().getMap("Settings").getMap("SubData").getRawString("Address", "127.0.0.1:4391"));
|
|
||||||
connect(log.toPrimitive(), null);
|
|
||||||
|
|
||||||
if (notifyPlugins) {
|
if (notifyPlugins) {
|
||||||
engine.getPluginManager().executeEvent(new GalaxiReloadEvent(engine));
|
engine.getPluginManager().executeEvent(new GalaxiReloadEvent(engine));
|
||||||
}
|
}
|
||||||
@ -280,7 +266,7 @@ public final class ExHost {
|
|||||||
if (disconnect == null || (this.reconnect && reconnect > 0 && disconnect.key() != DisconnectReason.PROTOCOL_MISMATCH && disconnect.key() != DisconnectReason.ENCRYPTION_MISMATCH)) {
|
if (disconnect == null || (this.reconnect && reconnect > 0 && disconnect.key() != DisconnectReason.PROTOCOL_MISMATCH && disconnect.key() != DisconnectReason.ENCRYPTION_MISMATCH)) {
|
||||||
long reset = resetDate;
|
long reset = resetDate;
|
||||||
Timer timer = new Timer(SubAPI.getInstance().getAppInfo().getName() + "::SubData_Reconnect_Handler");
|
Timer timer = new Timer(SubAPI.getInstance().getAppInfo().getName() + "::SubData_Reconnect_Handler");
|
||||||
if (disconnect != null) ;
|
if (disconnect != null) log.info("Attempting reconnect in " + reconnect + " seconds");
|
||||||
timer.scheduleAtFixedRate(new TimerTask() {
|
timer.scheduleAtFixedRate(new TimerTask() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
@ -28,7 +28,7 @@ public class PacketInExReload implements PacketObjectIn<Integer> {
|
|||||||
public void receive(SubDataSender client, ObjectMap<Integer> data) {
|
public void receive(SubDataSender client, ObjectMap<Integer> data) {
|
||||||
Logger log = Util.getDespiteException(() -> Util.reflect(SubDataClient.class.getDeclaredField("log"), client.getConnection()), null);
|
Logger log = Util.getDespiteException(() -> Util.reflect(SubDataClient.class.getDeclaredField("log"), client.getConnection()), null);
|
||||||
if (data != null && data.contains(0x0000)) log.warning("Received request for a plugin reload: " + data.getString(0x0000));
|
if (data != null && data.contains(0x0000)) log.warning("Received request for a plugin reload: " + data.getString(0x0000));
|
||||||
else log.warning("Received request for a plugin reload");
|
// else log.warning("Received request for a plugin reload");
|
||||||
new Thread(() -> {
|
new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
host.reload(true);
|
host.reload(true);
|
||||||
|
Loading…
Reference in New Issue
Block a user