mirror of
https://github.com/SerendipityR-2022/EndMinecraftPlusV2.git
synced 2024-09-19 15:23:26 +00:00
Fix: 修复逻辑错误,自动移除错误代理
This commit is contained in:
parent
0605c8f355
commit
85f3f7948d
@ -99,7 +99,7 @@ AdvancedSettings:
|
|||||||
# 自动重连设置
|
# 自动重连设置
|
||||||
Rejoin:
|
Rejoin:
|
||||||
# 重新加入前模拟刷新服务器列表
|
# 重新加入前模拟刷新服务器列表
|
||||||
GetMotdBeforeRejoin: true
|
GetMotdBeforeRejoin: false
|
||||||
GetMotdCount: 5
|
GetMotdCount: 5
|
||||||
GetMotdDelay: 500
|
GetMotdDelay: 500
|
||||||
# 自动重连次数/间隔
|
# 自动重连次数/间隔
|
||||||
|
@ -198,15 +198,6 @@ public class BotManager {
|
|||||||
botHandler.setClientTimeout(client, ConfigUtil.ConnectTimeout);
|
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);
|
botHandler.connect(client, proxy);
|
||||||
|
|
||||||
while (botHandler.checkClientStatus(client)) {
|
while (botHandler.checkClientStatus(client)) {
|
||||||
@ -455,6 +446,17 @@ public class BotManager {
|
|||||||
Object client = botHandler.createClient(proxy, userName);
|
Object client = botHandler.createClient(proxy, userName);
|
||||||
BotManager.clientList.put(client, userName);
|
BotManager.clientList.put(client, userName);
|
||||||
botHandler.setClientTimeout(client, ConfigUtil.ConnectTimeout);
|
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);
|
botHandler.connect(client, proxy);
|
||||||
|
|
||||||
while (botHandler.checkClientStatus(client)) {
|
while (botHandler.checkClientStatus(client)) {
|
||||||
|
@ -47,7 +47,12 @@ public class UniverseMethods {
|
|||||||
int size = ProxyUtil.proxies.size();
|
int size = ProxyUtil.proxies.size();
|
||||||
String p = ProxyUtil.proxies.get(BotManager.clientList.size() % size);
|
String p = ProxyUtil.proxies.get(BotManager.clientList.size() % size);
|
||||||
String[] _p = p.split(":");
|
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) {
|
public static Proxy.Type getProxyType(int type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user