修复某些情况下发送注册信息失败

This commit is contained in:
SerendipityR 2022-10-04 21:28:54 +08:00 committed by GitHub
parent bf878356d9
commit ab4077b1a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -26,6 +26,7 @@ import com.github.steveice10.packetlib.event.session.*;
import com.github.steveice10.packetlib.packet.Packet;
import com.github.steveice10.packetlib.tcp.TcpSessionFactory;
import io.netty.util.internal.ConcurrentSet;
import sun.rmi.runtime.Log;
import java.io.InputStream;
import java.io.OutputStream;
@ -102,8 +103,8 @@ public class BotAttack extends IAttack {
} else if (c.getSession().hasFlag("join")) {
if (ConfigUtil.RegisterAndLogin) {
for (String cmd:ConfigUtil.RegisterCommands) {
c.getSession().send(new ClientChatPacket(cmd.replace("$pwd",DataUtil.botRegPasswordsMap.get(clientName.get(c)))));
OtherUtils.doSleep(ConfigUtil.ChatDelay);
c.getSession().send(new ClientChatPacket(cmd.replace("$pwd",DataUtil.botRegPasswordsMap.get(clientName.get(c)))));
}
}

View File

@ -133,6 +133,8 @@ public class NewBotAttack extends IAttack {
} else if (c.hasFlag("join")) {
if (ConfigUtil.RegisterAndLogin) {
for (String cmd:ConfigUtil.RegisterCommands) {
OtherUtils.doSleep(ConfigUtil.ChatDelay);
if (ProtocolLibs.adaptAfter760) {
VersionSupport760.sendChatPacket(c, cmd.replace("$pwd",DataUtil.botRegPasswordsMap.get(clientName.get(c))));
} else if (ProtocolLibs.adaptAfter759) {
@ -142,8 +144,6 @@ public class NewBotAttack extends IAttack {
} else {
c.send(new ClientChatPacket(cmd.replace("$pwd",DataUtil.botRegPasswordsMap.get(clientName.get(c)))));
}
OtherUtils.doSleep(ConfigUtil.ChatDelay);
}
}

View File

@ -104,11 +104,13 @@ public class BotAttack extends IAttack {
} else if (c.getSession().hasFlag("join")) {
if (ConfigUtil.RegisterAndLogin) {
for (String cmd:ConfigUtil.RegisterCommands) {
c.getSession().send(new ClientChatPacket(cmd.replace("$pwd",DataUtil.botRegPasswordsMap.get(clientName.get(c)))));
OtherUtils.doSleep(ConfigUtil.ChatDelay);
c.getSession().send(new ClientChatPacket(cmd.replace("$pwd",DataUtil.botRegPasswordsMap.get(clientName.get(c)))));
}
}
LogUtil.doLog(0, "[" + clientName.get(c) + "] 注册信息已发送。", "BotAttack");
c.getSession().setFlag("login", true);
}
}