mirror of
https://github.com/SerendipityR-2022/EndMinecraftPlusV2.git
synced 2024-10-31 20:08:00 +00:00
允许自定义BotName随机方式 加入配置文件版本校验
This commit is contained in:
parent
8686f7943c
commit
f286881ab6
@ -62,11 +62,6 @@ public class ConfigUtil {
|
|||||||
|
|
||||||
CfgVer = config.getInt("CfgVer");
|
CfgVer = config.getInt("CfgVer");
|
||||||
|
|
||||||
if (!EndMinecraftPlusV2.CfgVer.equals(CfgVer)) {
|
|
||||||
LogUtil.doLog(1, "载入配置文件失败! 配置文件版本不匹配,请前往发布页更新配置文件。", null);
|
|
||||||
EndMinecraftPlusV2.Exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
AttackAddress = config.getString("AttackSettings.Address");
|
AttackAddress = config.getString("AttackSettings.Address");
|
||||||
AttackPort = config.getInt("AttackSettings.Port");
|
AttackPort = config.getInt("AttackSettings.Port");
|
||||||
AttackMethod = config.getInt("AttackSettings.Method");
|
AttackMethod = config.getInt("AttackSettings.Method");
|
||||||
@ -144,6 +139,11 @@ public class ConfigUtil {
|
|||||||
|
|
||||||
loadConfig();
|
loadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!EndMinecraftPlusV2.CfgVer.equals(CfgVer)) {
|
||||||
|
LogUtil.doLog(1, "载入配置文件失败! 配置文件版本不匹配,请前往发布页更新配置文件。", null);
|
||||||
|
EndMinecraftPlusV2.Exit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFileCharset(File file) {
|
public static String getFileCharset(File file) {
|
||||||
|
@ -42,6 +42,7 @@ public class BotAttack extends IAttack {
|
|||||||
public static int rejoin = 0;
|
public static int rejoin = 0;
|
||||||
public static int clickVerifies = 0;
|
public static int clickVerifies = 0;
|
||||||
public static List<String> alivePlayers = new ArrayList<>();
|
public static List<String> alivePlayers = new ArrayList<>();
|
||||||
|
public static HashMap<Session, ServerPlayerPositionRotationPacket> positionPacket = new HashMap<>();
|
||||||
protected boolean attack_motdbefore;
|
protected boolean attack_motdbefore;
|
||||||
protected boolean attack_tab;
|
protected boolean attack_tab;
|
||||||
protected Map<String, String> modList;
|
protected Map<String, String> modList;
|
||||||
@ -80,9 +81,23 @@ public class BotAttack extends IAttack {
|
|||||||
if (c.getSession().hasFlag("login")) {
|
if (c.getSession().hasFlag("login")) {
|
||||||
if (ConfigUtil.ChatSpam) {
|
if (ConfigUtil.ChatSpam) {
|
||||||
c.getSession().send(new ClientChatPacket(getRandMessage(clientName.get(c))));
|
c.getSession().send(new ClientChatPacket(getRandMessage(clientName.get(c))));
|
||||||
|
OtherUtils.doSleep(ConfigUtil.ChatDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
OtherUtils.doSleep(ConfigUtil.ChatDelay);
|
if (ConfigUtil.RandomTeleport) {
|
||||||
|
ServerPlayerPositionRotationPacket positionRotationPacket = positionPacket.get(c.getSession());
|
||||||
|
if (c.getSession().isConnected() && positionRotationPacket != null) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils.MultiVersionPacket.sendPosPacket(c.getSession(), positionRotationPacket.getX() + OtherUtils.getRandomInt(-10, 10), positionRotationPacket.getY() + OtherUtils.getRandomInt(2, 8), positionRotationPacket.getZ() + OtherUtils.getRandomInt(-10, 10), OtherUtils.getRandomFloat(0.00, 1.00), OtherUtils.getRandomFloat(0.00, 1.00));
|
||||||
|
Thread.sleep(500);
|
||||||
|
cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils.MultiVersionPacket.sendPosPacket(c.getSession(), positionRotationPacket.getX(), positionRotationPacket.getY(), positionRotationPacket.getZ(), OtherUtils.getRandomFloat(0.00, 1.00), OtherUtils.getRandomFloat(0.00, 1.00));
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (c.getSession().hasFlag("join")) {
|
} else if (c.getSession().hasFlag("join")) {
|
||||||
if (ConfigUtil.RegisterAndLogin) {
|
if (ConfigUtil.RegisterAndLogin) {
|
||||||
for (String cmd:ConfigUtil.RegisterCommands) {
|
for (String cmd:ConfigUtil.RegisterCommands) {
|
||||||
@ -399,6 +414,7 @@ public class BotAttack extends IAttack {
|
|||||||
MultiVersionPacket.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
|
MultiVersionPacket.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
|
||||||
session.send(new ClientPlayerMovementPacket(true));
|
session.send(new ClientPlayerMovementPacket(true));
|
||||||
MultiVersionPacket.sendClientTeleportConfirmPacket(session, packet);
|
MultiVersionPacket.sendClientTeleportConfirmPacket(session, packet);
|
||||||
|
positionPacket.put(session, packet);
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
|
|
||||||
} else if (recvPacket instanceof ServerChatPacket) {
|
} else if (recvPacket instanceof ServerChatPacket) {
|
||||||
|
@ -46,6 +46,8 @@ public class NewBotAttack extends IAttack {
|
|||||||
public static int rejoin = 0;
|
public static int rejoin = 0;
|
||||||
public static int clickVerifies = 0;
|
public static int clickVerifies = 0;
|
||||||
public static List<String> alivePlayers = new ArrayList<>();
|
public static List<String> alivePlayers = new ArrayList<>();
|
||||||
|
public static HashMap<Session,ServerPlayerPositionRotationPacket> positionPacket = new HashMap<>();
|
||||||
|
public static HashMap<Session,ClientboundPlayerPositionPacket> newPositionPacket = new HashMap<>();
|
||||||
protected boolean attack_motdbefore;
|
protected boolean attack_motdbefore;
|
||||||
protected boolean attack_tab;
|
protected boolean attack_tab;
|
||||||
protected Map<String, String> modList;
|
protected Map<String, String> modList;
|
||||||
@ -95,6 +97,38 @@ public class NewBotAttack extends IAttack {
|
|||||||
|
|
||||||
OtherUtils.doSleep(ConfigUtil.ChatDelay);
|
OtherUtils.doSleep(ConfigUtil.ChatDelay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ConfigUtil.RandomTeleport) {
|
||||||
|
if (ProtocolLibs.adaptAfter758) {
|
||||||
|
ClientboundPlayerPositionPacket positionRotationPacket = newPositionPacket.get(c);
|
||||||
|
|
||||||
|
if (c.isConnected() && positionRotationPacket != null) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
VersionSupport758.sendPosPacket(c, positionRotationPacket.getX() + OtherUtils.getRandomInt(-10, 10), positionRotationPacket.getY() + OtherUtils.getRandomInt(2, 8), positionRotationPacket.getZ() + OtherUtils.getRandomInt(-10, 10), OtherUtils.getRandomFloat(0.00, 1.00), OtherUtils.getRandomFloat(0.00, 1.00));
|
||||||
|
Thread.sleep(500);
|
||||||
|
VersionSupport758.sendPosPacket(c, positionRotationPacket.getX(), positionRotationPacket.getY(), positionRotationPacket.getZ(), OtherUtils.getRandomFloat(0.00, 1.00), OtherUtils.getRandomFloat(0.00, 1.00));
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ServerPlayerPositionRotationPacket positionRotationPacket = positionPacket.get(c);
|
||||||
|
|
||||||
|
if (c.isConnected() && positionRotationPacket != null) {
|
||||||
|
new Thread(() -> {
|
||||||
|
try {
|
||||||
|
cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils.MultiVersionPacket.sendPosPacket(c, positionRotationPacket.getX() + OtherUtils.getRandomInt(-10, 10), positionRotationPacket.getY() + OtherUtils.getRandomInt(2, 8), positionRotationPacket.getZ() + OtherUtils.getRandomInt(-10, 10), OtherUtils.getRandomFloat(0.00, 1.00), OtherUtils.getRandomFloat(0.00, 1.00));
|
||||||
|
Thread.sleep(500);
|
||||||
|
cn.serendipityr.EndMinecraftPlusV2.VersionControl.NewVersion.AttackUtils.MultiVersionPacket.sendPosPacket(c, positionRotationPacket.getX(), positionRotationPacket.getY(), positionRotationPacket.getZ(), OtherUtils.getRandomFloat(0.00, 1.00), OtherUtils.getRandomFloat(0.00, 1.00));
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}).start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} else if (c.hasFlag("join")) {
|
} else if (c.hasFlag("join")) {
|
||||||
if (ConfigUtil.RegisterAndLogin) {
|
if (ConfigUtil.RegisterAndLogin) {
|
||||||
for (String cmd:ConfigUtil.RegisterCommands) {
|
for (String cmd:ConfigUtil.RegisterCommands) {
|
||||||
@ -439,6 +473,7 @@ public class NewBotAttack extends IAttack {
|
|||||||
MultiVersionPacket.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
|
MultiVersionPacket.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
|
||||||
session.send(new ClientPlayerMovementPacket(true));
|
session.send(new ClientPlayerMovementPacket(true));
|
||||||
MultiVersionPacket.sendClientTeleportConfirmPacket(session, packet);
|
MultiVersionPacket.sendClientTeleportConfirmPacket(session, packet);
|
||||||
|
positionPacket.put(session, packet);
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
|
|
||||||
} else if (recvPacket instanceof ServerChatPacket) {
|
} else if (recvPacket instanceof ServerChatPacket) {
|
||||||
@ -508,6 +543,7 @@ public class NewBotAttack extends IAttack {
|
|||||||
VersionSupport758.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
|
VersionSupport758.sendPosPacket(session, packet.getX(), packet.getY(), packet.getZ(), packet.getYaw(), packet.getYaw());
|
||||||
session.send(new ServerboundMovePlayerStatusOnlyPacket(true));
|
session.send(new ServerboundMovePlayerStatusOnlyPacket(true));
|
||||||
VersionSupport758.sendClientTeleportConfirmPacket(session, packet);
|
VersionSupport758.sendClientTeleportConfirmPacket(session, packet);
|
||||||
|
newPositionPacket.put(session,packet);
|
||||||
} catch (Exception ignored) {}
|
} catch (Exception ignored) {}
|
||||||
} else if (ProtocolLibs.adaptAfter760 && VersionSupport760.checkServerChatPacket(recvPacket)) {
|
} else if (ProtocolLibs.adaptAfter760 && VersionSupport760.checkServerChatPacket(recvPacket)) {
|
||||||
List<String> result = VersionSupport760.clickVerifiesHandle(recvPacket, session, ConfigUtil.ClickVerifiesDetect, null);
|
List<String> result = VersionSupport760.clickVerifiesHandle(recvPacket, session, ConfigUtil.ClickVerifiesDetect, null);
|
||||||
|
Loading…
Reference in New Issue
Block a user