Skip to content

Commit

Permalink
修复重进绕过功能,补全提示
Browse files Browse the repository at this point in the history
  • Loading branch information
SerendipityR-2022 authored Aug 17, 2022
1 parent 08f091f commit b1e671f
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public void start() {
}
LogUtil.doLog(0, "当前连接数: " + clients.size() + "个", "BotAttack");
} catch (Exception e) {
LogUtil.doLog(1, "发生错误: " + e.getMessage(), null);
LogUtil.doLog(1, "发生错误: " + e, null);
}
}
});
Expand Down Expand Up @@ -175,7 +175,7 @@ private void createClients(final String ip, int port) {
if (this.attack_joinsleep > 0)
OtherUtils.doSleep(attack_joinsleep);
} catch (Exception e) {
LogUtil.doLog(1, "发生错误: " + e.getMessage(), null);
LogUtil.doLog(1, "发生错误: " + e, null);
}
}
}
Expand Down Expand Up @@ -210,6 +210,22 @@ public void disconnected(DisconnectedEvent e) {
for (int i = 0; i < ConfigUtil.RejoinCount; i++) {
createClient(ConfigUtil.AttackAddress, ConfigUtil.AttackPort, username, proxy);
rejoin++;

LogUtil.doLog(0,"[假人尝试重连] [" + username + "] [" + proxy + "]", "BotAttack");

OtherUtils.doSleep(ConfigUtil.RejoinDelay);

boolean canBreak = false;

for (Client client:clientName.keySet()) {
if (clientName.get(client).contains(username)) {
canBreak = true;
}
}

if (canBreak) {
break;
}
}
}
}
Expand Down Expand Up @@ -272,7 +288,9 @@ protected void handlePacket(Session session, Packet recvPacket, String username)
session.setFlag("join", true);
LogUtil.doLog(0, "[假人加入服务器] [" + username + "]", "BotAttack");
joined++;
alivePlayers.add(username);
if (!alivePlayers.contains(username)) {
alivePlayers.add(username);
}
MultiVersionPacket.sendClientSettingPacket(session, "zh_CN");
MultiVersionPacket.sendClientPlayerChangeHeldItemPacket(session, 1);
} else if (recvPacket instanceof ServerPlayerPositionRotationPacket) {
Expand Down Expand Up @@ -303,8 +321,13 @@ public static void clickVerifiesHandle(Message message, Session session, String
session.send(new ClientChatPacket(message.getStyle().getClickEvent().getValue()));
clickVerifies++;
} else {
LogUtil.doLog(0, "[服务端返回信息] [" + username + "] " + message, "BotAttack");
alivePlayers.add(username);
if (!message.getText().equals("")) {
LogUtil.doLog(0, "[服务端返回信息] [" + username + "] " + message, "BotAttack");
}

if (!alivePlayers.contains(username)) {
alivePlayers.add(username);
}
}

if (message.getExtra() != null && !message.getExtra().isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void start() {
OtherUtils.doSleep(attack_joinsleep);
}
} catch (Throwable e) {
LogUtil.doLog(0, "发生错误: " + e.getMessage(), "MotdAttack" + Thread.currentThread().getName());
LogUtil.doLog(0, "发生错误: " + e, "MotdAttack" + Thread.currentThread().getName());
errorTimes++;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void start() {
if (this.attack_maxconnect > 0 && (threads.size() > this.attack_maxconnect))
return;
} catch (Exception e) {
LogUtil.doLog(1,"发生错误: " + e.getMessage(), null);
LogUtil.doLog(1,"发生错误: " + e, null);
}
}
}
Expand Down Expand Up @@ -72,7 +72,7 @@ public Thread createThread(Proxy proxy, String ip, int port) {
LogUtil.doLog(0, "连接已断开。", "MotdAttackP" + Thread.currentThread().getName());
}
} catch (Throwable e) {
LogUtil.doLog(0, "发生错误: " + e.getMessage(), "MotdAttackP" + Thread.currentThread().getName());
LogUtil.doLog(0, "发生错误: " + e, "MotdAttackP" + Thread.currentThread().getName());
errorTimes++;
}

Expand Down
2 changes: 2 additions & 0 deletions src/cn/serendipityr/EndMinecraftPlusV2/Tools/ConfigUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class ConfigUtil {
public static List<String> RegisterCommands;
public static Integer RejoinCount;
public static List<String> RejoinDetect;
public static Long RejoinDelay;
public static List<String> ClickVerifiesDetect;
public static List<String> CustomChat;
public static Integer ChatDelay;
Expand Down Expand Up @@ -62,6 +63,7 @@ public void loadConfig() {
RegisterCommands = config.getStringList("BotSettings.RegisterCommands");
RejoinCount = config.getInt("BotSettings.RejoinCount");
RejoinDetect = config.getStringList("BotSettings.RejoinDetect");
RejoinDelay = config.getLong("BotSettings.RejoinDelay");
ClickVerifiesDetect = config.getStringList("BotSettings.ClickVerifiesDetect");
CustomChat = config.getStringList("BotSettings.CustomChat");
ChatDelay = config.getInt("BotSettings.ChatDelay");
Expand Down
4 changes: 2 additions & 2 deletions src/cn/serendipityr/EndMinecraftPlusV2/Tools/HTTPUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public static String sendGet(String url) {
result.append(line);
}
} catch (Exception e) {
LogUtil.doLog(1, "HTTP请求出错! 详细信息: " + e.getMessage(), null);
LogUtil.doLog(1, "HTTP请求出错! 详细信息: " + e, null);
} finally {
try {
if (in != null) {
in.close();
}
} catch (Exception e) {
LogUtil.doLog(1, "IO异常! 详细信息: " + e.getMessage(), null);
LogUtil.doLog(1, "IO异常! 详细信息: " + e, null);
}
}
return result.toString();
Expand Down
1 change: 1 addition & 0 deletions src/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ BotSettings:
BotName: "ImOldSix_$rnd"
BotCount: 1000
RejoinCount: 5
RejoinDelay: 2000
RejoinDetect:
- "AntiAttack"
ClickVerifiesDetect:
Expand Down

0 comments on commit b1e671f

Please sign in to comment.