Compare commits
7
Commits
v1.2.13
...
e8e3b4f9c0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8e3b4f9c0 | ||
|
|
7c1eb7cf24 | ||
|
|
ce9d01a47f | ||
|
|
b81b61187f | ||
|
|
5e109efc56 | ||
|
|
91e4d44170 | ||
|
|
e2a477e56f |
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
# Minecraft bot stress tester
|
# Minecraft bot stress tester
|
||||||
🤖 A simple open source app written in Java used for stress testing Minecraft servers with bots (fake players).
|
🤖 A simple open source app written in Java used for stress testing Minecraft servers with bots (fake players).
|
||||||
💥 It can be also used to test plugins or minigames.
|
💥 It can be also used to test plugins or minigames.
|
||||||
✔️ The MC version of the bots is 1.21.2, supports 1.21.3
|
✔️ The MC version of the bots is 1.21.7 (supports server 1.21.8)
|
||||||
For older MC versions please look in the [releases](https://github.com/crpmax/mc-bots/releases " releases").
|
For older MC versions please look in the [releases](https://github.com/crpmax/mc-bots/releases " releases").
|
||||||
|
|
||||||
## 🆒 Features
|
## 🆒 Features
|
||||||
@@ -21,7 +21,7 @@ Use of pre-compiled jar from [releases](https://github.com/crpmax/mc-bots/releas
|
|||||||
When running, you can write a chat message to the terminal to send it by all bots.
|
When running, you can write a chat message to the terminal to send it by all bots.
|
||||||
|
|
||||||
## 🧪 Example
|
## 🧪 Example
|
||||||
`java -jar mc-bots-1.2.12.jar -s 192.168.0.189:25565 -p BOT_ -d 4000 5000 -c 30 -r`
|
`java -jar mc-bots-1.2.17.jar -s 192.168.0.189:25565 -p BOT_ -d 4000 5000 -c 30 -r`
|
||||||
This will connect 30 bots to server at 192.168.0.189:25565 with delay 4000-5000 ms and will use real-looking nicknames prefixed with BOT_
|
This will connect 30 bots to server at 192.168.0.189:25565 with delay 4000-5000 ms and will use real-looking nicknames prefixed with BOT_
|
||||||
|
|
||||||
<img src="https://imgur.com/XWcckas.png" title="Connected bots" width="350px"/>
|
<img src="https://imgur.com/XWcckas.png" title="Connected bots" width="350px"/>
|
||||||
|
|||||||
+14
-11
@@ -3,10 +3,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'me.creepermaxcz.mc-bots'
|
group 'me.creepermaxcz.mc-bots'
|
||||||
version '1.2.13'
|
version '1.2.17'
|
||||||
|
|
||||||
sourceCompatibility = 1.17
|
|
||||||
targetCompatibility = 1.17
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -16,13 +13,19 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.geysermc.mcprotocollib:protocol:1.21.2-SNAPSHOT'
|
implementation 'org.geysermc.mcprotocollib:protocol:1.21.7-SNAPSHOT'
|
||||||
implementation 'net.kyori:adventure-text-serializer-gson:4.16.0'
|
implementation 'net.kyori:adventure-text-serializer-gson:4.24.0'
|
||||||
implementation 'commons-cli:commons-cli:1.5.0'
|
implementation 'commons-cli:commons-cli:1.9.0'
|
||||||
implementation 'com.diogonunes:JColor:5.2.0'
|
implementation 'com.diogonunes:JColor:5.5.1'
|
||||||
implementation 'dnsjava:dnsjava:3.4.3'
|
implementation 'dnsjava:dnsjava:3.5.3'
|
||||||
implementation 'org.slf4j:slf4j-nop:2.0.13'
|
implementation 'org.slf4j:slf4j-nop:2.0.17'
|
||||||
implementation 'org.jline:jline:3.22.0'
|
implementation 'org.jline:jline:3.30.4'
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(17)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
@@ -2,12 +2,14 @@ package me.creepermaxcz.mcbots;
|
|||||||
|
|
||||||
import org.geysermc.mcprotocollib.auth.GameProfile;
|
import org.geysermc.mcprotocollib.auth.GameProfile;
|
||||||
import org.geysermc.mcprotocollib.auth.SessionService;
|
import org.geysermc.mcprotocollib.auth.SessionService;
|
||||||
|
import org.geysermc.mcprotocollib.network.ClientSession;
|
||||||
import org.geysermc.mcprotocollib.network.ProxyInfo;
|
import org.geysermc.mcprotocollib.network.ProxyInfo;
|
||||||
import org.geysermc.mcprotocollib.network.Session;
|
import org.geysermc.mcprotocollib.network.Session;
|
||||||
import org.geysermc.mcprotocollib.network.event.session.DisconnectedEvent;
|
import org.geysermc.mcprotocollib.network.event.session.DisconnectedEvent;
|
||||||
import org.geysermc.mcprotocollib.network.event.session.SessionAdapter;
|
import org.geysermc.mcprotocollib.network.event.session.SessionAdapter;
|
||||||
|
import org.geysermc.mcprotocollib.network.factory.ClientNetworkSessionFactory;
|
||||||
import org.geysermc.mcprotocollib.network.packet.Packet;
|
import org.geysermc.mcprotocollib.network.packet.Packet;
|
||||||
import org.geysermc.mcprotocollib.network.tcp.TcpClientSession;
|
import org.geysermc.mcprotocollib.network.session.ClientNetworkSession;
|
||||||
import org.geysermc.mcprotocollib.protocol.MinecraftConstants;
|
import org.geysermc.mcprotocollib.protocol.MinecraftConstants;
|
||||||
import org.geysermc.mcprotocollib.protocol.MinecraftProtocol;
|
import org.geysermc.mcprotocollib.protocol.MinecraftProtocol;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.UnexpectedEncryptionException;
|
import org.geysermc.mcprotocollib.protocol.data.UnexpectedEncryptionException;
|
||||||
@@ -29,12 +31,10 @@ import java.util.regex.Pattern;
|
|||||||
|
|
||||||
public class Bot extends Thread {
|
public class Bot extends Thread {
|
||||||
|
|
||||||
MinecraftProtocol protocol = null;
|
|
||||||
|
|
||||||
private String nickname;
|
private String nickname;
|
||||||
private ProxyInfo proxy;
|
private ProxyInfo proxy;
|
||||||
private InetSocketAddress address;
|
private InetSocketAddress address;
|
||||||
private Session client;
|
private ClientSession client;
|
||||||
private boolean hasMainListener;
|
private boolean hasMainListener;
|
||||||
|
|
||||||
private double lastX, lastY, lastZ = -1;
|
private double lastX, lastY, lastZ = -1;
|
||||||
@@ -43,16 +43,6 @@ public class Bot extends Thread {
|
|||||||
|
|
||||||
private boolean manualDisconnecting = false;
|
private boolean manualDisconnecting = false;
|
||||||
|
|
||||||
public Bot(String nickname, InetSocketAddress address, ProxyInfo proxy) {
|
|
||||||
this.nickname = nickname;
|
|
||||||
this.address = address;
|
|
||||||
this.proxy = proxy;
|
|
||||||
|
|
||||||
Log.info("Creating bot", nickname);
|
|
||||||
protocol = new MinecraftProtocol(nickname);
|
|
||||||
client = new TcpClientSession(address.getHostString(), address.getPort(), protocol, proxy);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bot(MinecraftProtocol protocol, InetSocketAddress address, ProxyInfo proxy) {
|
public Bot(MinecraftProtocol protocol, InetSocketAddress address, ProxyInfo proxy) {
|
||||||
this.nickname = protocol.getProfile().getName();
|
this.nickname = protocol.getProfile().getName();
|
||||||
this.address = address;
|
this.address = address;
|
||||||
@@ -60,7 +50,11 @@ public class Bot extends Thread {
|
|||||||
|
|
||||||
Log.info("Creating bot", nickname);
|
Log.info("Creating bot", nickname);
|
||||||
|
|
||||||
client = new TcpClientSession(address.getHostString(), address.getPort(), protocol, proxy);
|
client = ClientNetworkSessionFactory.factory()
|
||||||
|
.setAddress(address.getHostString(), address.getPort())
|
||||||
|
.setProtocol(protocol)
|
||||||
|
.setProxy(proxy)
|
||||||
|
.create();
|
||||||
|
|
||||||
SessionService sessionService = new SessionService();
|
SessionService sessionService = new SessionService();
|
||||||
client.setFlag(MinecraftConstants.SESSION_SERVICE_KEY, sessionService);
|
client.setFlag(MinecraftConstants.SESSION_SERVICE_KEY, sessionService);
|
||||||
@@ -171,7 +165,8 @@ public class Bot extends Thread {
|
|||||||
0L,
|
0L,
|
||||||
null,
|
null,
|
||||||
0,
|
0,
|
||||||
new BitSet()
|
new BitSet(),
|
||||||
|
0
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
package me.creepermaxcz.mcbots;
|
package me.creepermaxcz.mcbots;
|
||||||
|
|
||||||
|
|
||||||
|
import org.geysermc.mcprotocollib.network.ClientSession;
|
||||||
import org.geysermc.mcprotocollib.network.Session;
|
import org.geysermc.mcprotocollib.network.Session;
|
||||||
import org.geysermc.mcprotocollib.network.event.session.DisconnectedEvent;
|
import org.geysermc.mcprotocollib.network.event.session.DisconnectedEvent;
|
||||||
import org.geysermc.mcprotocollib.network.event.session.SessionAdapter;
|
import org.geysermc.mcprotocollib.network.event.session.SessionAdapter;
|
||||||
import org.geysermc.mcprotocollib.network.tcp.TcpClientSession;
|
import org.geysermc.mcprotocollib.network.factory.ClientNetworkSessionFactory;
|
||||||
import org.geysermc.mcprotocollib.protocol.MinecraftConstants;
|
import org.geysermc.mcprotocollib.protocol.MinecraftConstants;
|
||||||
import org.geysermc.mcprotocollib.protocol.MinecraftProtocol;
|
import org.geysermc.mcprotocollib.protocol.MinecraftProtocol;
|
||||||
import org.geysermc.mcprotocollib.protocol.data.status.ServerStatusInfo;
|
import org.geysermc.mcprotocollib.protocol.data.status.ServerStatusInfo;
|
||||||
@@ -16,7 +17,7 @@ import java.net.InetSocketAddress;
|
|||||||
|
|
||||||
public class ServerInfo {
|
public class ServerInfo {
|
||||||
|
|
||||||
private final Session client;
|
private final ClientSession client;
|
||||||
private ServerStatusInfo serverStatusInfo;
|
private ServerStatusInfo serverStatusInfo;
|
||||||
private long ping;
|
private long ping;
|
||||||
private boolean done;
|
private boolean done;
|
||||||
@@ -24,7 +25,11 @@ public class ServerInfo {
|
|||||||
public ServerInfo(InetSocketAddress address) {
|
public ServerInfo(InetSocketAddress address) {
|
||||||
|
|
||||||
MinecraftProtocol protocol = new MinecraftProtocol();
|
MinecraftProtocol protocol = new MinecraftProtocol();
|
||||||
client = new TcpClientSession(address.getHostString(), address.getPort(), protocol, null);
|
|
||||||
|
client = ClientNetworkSessionFactory.factory()
|
||||||
|
.setAddress(address.getHostString(), address.getPort())
|
||||||
|
.setProtocol(protocol)
|
||||||
|
.create();
|
||||||
|
|
||||||
client.setFlag(MinecraftConstants.SERVER_INFO_HANDLER_KEY, (ServerInfoHandler) (session, info) -> {
|
client.setFlag(MinecraftConstants.SERVER_INFO_HANDLER_KEY, (ServerInfoHandler) (session, info) -> {
|
||||||
this.serverStatusInfo = info;
|
this.serverStatusInfo = info;
|
||||||
|
|||||||
Reference in new issue
Block a user