diff --git a/Main/src/config.yml b/Main/src/config.yml index b113597..aca4483 100644 --- a/Main/src/config.yml +++ b/Main/src/config.yml @@ -99,7 +99,7 @@ AdvancedSettings: # 自动重连设置 Rejoin: # 重新加入前模拟刷新服务器列表 - GetMotdBeforeRejoin: true + GetMotdBeforeRejoin: false GetMotdCount: 5 GetMotdDelay: 500 # 自动重连次数/间隔 diff --git a/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/Bot/BotManager.java b/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/Bot/BotManager.java index 01d0dff..895d95d 100644 --- a/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/Bot/BotManager.java +++ b/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/Bot/BotManager.java @@ -198,15 +198,6 @@ public class BotManager { botHandler.setClientTimeout(client, ConfigUtil.ConnectTimeout); // 连接到服务器 - if (!doubleAttack && ConfigUtil.GetMotdBeforeRejoin) { - for (int i = 0; i < ConfigUtil.GetMotdCount; i++) { - try { - new UniverseMethods().getMotd(proxy, ConfigUtil.AttackAddress, ConfigUtil.AttackPort); - } catch (Throwable ignored) { - } - OtherUtils.doSleep(ConfigUtil.GetMotdDelay); - } - } botHandler.connect(client, proxy); while (botHandler.checkClientStatus(client)) { @@ -455,6 +446,17 @@ public class BotManager { Object client = botHandler.createClient(proxy, userName); BotManager.clientList.put(client, userName); botHandler.setClientTimeout(client, ConfigUtil.ConnectTimeout); + + if (ConfigUtil.GetMotdBeforeRejoin) { + for (int a = 0; a < ConfigUtil.GetMotdCount; a++) { + try { + new UniverseMethods().getMotd(proxy, ConfigUtil.AttackAddress, ConfigUtil.AttackPort); + } catch (Throwable ignored) { + } + OtherUtils.doSleep(ConfigUtil.GetMotdDelay); + } + } + botHandler.connect(client, proxy); while (botHandler.checkClientStatus(client)) { diff --git a/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/UniverseMethods.java b/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/UniverseMethods.java index 687f5f5..812a913 100644 --- a/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/UniverseMethods.java +++ b/VersionFactory/src/cn/serendipityr/EndMinecraftPlusV2/MultipleVersion/UniverseMethods.java @@ -47,7 +47,12 @@ public class UniverseMethods { int size = ProxyUtil.proxies.size(); String p = ProxyUtil.proxies.get(BotManager.clientList.size() % size); String[] _p = p.split(":"); - return new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1]))); + try { + return new Proxy(proxyType, new InetSocketAddress(_p[0], Integer.parseInt(_p[1]))); + } catch (Exception e) { + ProxyUtil.proxies.remove(p); + } + return getProxy(proxyType); } public static Proxy.Type getProxyType(int type) {