Compare commits

...

6 Commits

Author SHA1 Message Date
Alexander Medvedev
8d3619f838 add one more option 2026-08-28 11:57:18 +02:00
Alexander Medvedev
85ff0f4e28 fix it finally 2026-08-19 09:52:50 +02:00
Alexander Medvedev
0e4faf82d6 some fixes 2026-08-18 13:45:05 +02:00
Alexander Medvedev
253ad6f336 fix: build 2026-08-17 19:06:18 +02:00
Alexander Medvedev
4f493976ea Port 26.2 2026-06-25 14:01:53 +02:00
Alexander Medvedev
a7296b4522 update to 26.1 2026-04-19 21:28:35 +02:00
6 changed files with 2139 additions and 995 deletions

View File

@ -17,7 +17,7 @@ jobs:
toolchain:
- stable
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
@ -29,7 +29,7 @@ jobs:
toolchain:
- stable
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --all-features
@ -42,7 +42,7 @@ jobs:
toolchain:
- stable
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- uses: Swatinem/rust-cache@v2
- run: cargo test --verbose

1433
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -10,15 +10,21 @@ codegen-units = 1
[dependencies]
# log
log = "0.4"
simple_logger = "5.1.0"
simple_logger = "5.2.0"
# CLI
clap = { version = "4.5.56", features = ["derive"] }
clap = { version = "4.6.6", features = ["derive"] }
# Networking
tokio = { version = "1.49.0", features = ["net", "io-util"] }
tokio = { version = "1.53.1", features = ["net", "io-util"] }
pumpkin-protocol = { git = "https://github.com/Pumpkin-MC/Pumpkin", package = "pumpkin-protocol", default-features = false, features = ["serverbound", "clientbound"]}
pumpkin-util = { git = "https://github.com/Pumpkin-MC/Pumpkin", package = "pumpkin-util"}
pumpkin-data = { git = "https://github.com/Pumpkin-MC/Pumpkin", package = "pumpkin-data"}
crossbeam = "0.8.4"
uuid = "1.20.0"
uuid = "1.25.0"
rand = { git = "https://github.com/rust-random/rand"}
rsa = { version = "=0.10.0-rc.18", default-features = false, features = ["std", "encoding"] }
[patch."https://github.com/Pumpkin-MC/Pumpkin"]
pumpkin-protocol = { path = "../Pumpkin/crates/pumpkin-protocol" }
pumpkin-util = { path = "../Pumpkin/crates/pumpkin-util" }
pumpkin-data = { path = "../Pumpkin/crates/pumpkin-data" }

View File

@ -1,7 +1,7 @@
<div align="center">
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
![Current version)](https://img.shields.io/badge/current_version-1.21.11-blue)
![Current version)](https://img.shields.io/badge/current_version-1.26-blue)
A tool to stress test Minecraft servers by simulating numerous bot connections, helping identify performance bottlenecks and stability issues.
![Screenshot_20250223_154536](https://github.com/user-attachments/assets/b1379060-e375-44dc-95a3-91f1f2fb52dd)
@ -39,6 +39,10 @@ Here's a detailed breakdown of all available command-line arguments:
- The timeout (in milliseconds) for each bot connection.
- Example: `--delay 500` (500 milliseconds delay)
- **`--enable_spam_message <false/true>` (Optional, Default: `true`):**
- Enable periodic chat spam messages.
- Example: `--enable_spam_message true`
- **`--spam_message "<message>"` (Optional, Default: `Please do not spam!`):**
- Will send a Chat message with the specified `spam_message_delay`.
- Example: `--spam_message "Hello, I'm a Robot"`
@ -46,15 +50,21 @@ Here's a detailed breakdown of all available command-line arguments:
- **`--spam_message_delay_min <delay>` (Optional, Default: `150`):**
- The minimal delay (in milliseconds) between spam message.
- Example: `--spam_message_delay_min 100` (100 milliseconds delay)
- **`--spam_message_delay_max <delay>` (Optional, Default: `350`):**
- **`--spam_message_delay_max <delay>` (Optional, Default: `250`):**
- The maximal delay (in milliseconds) between spam message.
- Example: `--spam_message_delay_max 100` (100 milliseconds delay)
- **`--spam_message_delay_max <delay>` (Optional, Default: `350`):**
- The maximal delay (in milliseconds) between spam message.
- Example: `--spam_message_delay_max 100` (100 milliseconds delay)
- Example: `--spam_message_delay_max 250` (250 milliseconds delay)
- **`--enable_rotation <false/true>` (Optional, Default: `true`):**
- Enable random head rotations.
- Example: `--enable_rotation true`
- **`--enable_swing <false/true>` (Optional, Default: `true`):**
- Enable random arm swings.
- Example: `--enable_swing true`
- Example: `--enable_swing true`
- **`--enable_movement <false/true>` (Optional, Default: `true`):**
- Enable random bot movement and walking.
- Example: `--enable_movement true`
- **`--enable_jumping <false/true>` (Optional, Default: `true`):**
- Enable jumping while moving.
- Example: `--enable_jumping true`
- **`--enable_physics <false/true>` (Optional, Default: `true`):**
- Enable physics simulation (gravity, friction, inertia, server knockback).
- Example: `--enable_physics true`

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
use std::{net::SocketAddr, sync::Arc, time::Duration};
use std::{net::SocketAddr, sync::Arc, sync::atomic::Ordering, time::Duration};
use clap::Parser;
use client::Client;
@ -18,17 +18,25 @@ pub struct Args {
#[arg(short, long, default_value_t = 5000)]
pub timeout: u64,
#[arg(long, default_value = "Please do not spam!")]
#[arg(long, default_value_t = true, default_missing_value = "true", num_args = 0..=1, action = clap::ArgAction::Set, alias = "enable_spam_message")]
pub enable_spam_message: bool,
#[arg(long, default_value = "Please do not spam!", alias = "spam_message")]
pub spam_message: Option<String>,
#[arg(long, default_value_t = 150)]
#[arg(long, default_value_t = 150, alias = "spam_message_delay_min")]
pub spam_message_delay_min: u32,
#[arg(long, default_value_t = 250)]
#[arg(long, default_value_t = 250, alias = "spam_message_delay_max")]
pub spam_message_delay_max: u32,
#[arg(long, default_value_t = true)]
#[arg(long, default_value_t = true, default_missing_value = "true", num_args = 0..=1, action = clap::ArgAction::Set, alias = "enable_rotation")]
pub enable_rotation: bool,
#[arg(long, default_value_t = true)]
#[arg(long, default_value_t = true, default_missing_value = "true", num_args = 0..=1, action = clap::ArgAction::Set, alias = "enable_swing")]
pub enable_swing: bool,
#[arg(long, default_value_t = true, default_missing_value = "true", num_args = 0..=1, action = clap::ArgAction::Set, alias = "enable_movement")]
pub enable_movement: bool,
#[arg(long, default_value_t = true, default_missing_value = "true", num_args = 0..=1, action = clap::ArgAction::Set, alias = "enable_jumping")]
pub enable_jumping: bool,
#[arg(long, default_value_t = true, default_missing_value = "true", num_args = 0..=1, action = clap::ArgAction::Set, alias = "enable_physics")]
pub enable_physics: bool,
}
#[tokio::main]
@ -62,7 +70,7 @@ async fn main() {
"Bot {} connection to {} timed out after {}ms",
i + 1,
address,
bot_count
args.timeout
);
continue;
}
@ -71,21 +79,25 @@ async fn main() {
client.join_server(address, format!("BOT_{i}")).await;
let cloned_args = args.clone();
let join_handle = tokio::spawn(async move {
let mut tick_interval = tokio::time::interval(Duration::from_millis(5));
let client_tick = client.clone();
let tick_handle = tokio::spawn(async move {
let mut tick_interval = tokio::time::interval(Duration::from_millis(50));
tick_interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Skip);
loop {
tokio::select! {
res = client.process_packets() => {
if !res { break; }
}
_ = tick_interval.tick() => {
client.tick(&cloned_args).await;
}
}
while !client_tick.closed.load(Ordering::Relaxed) {
tick_interval.tick().await;
client_tick.tick(&cloned_args).await;
}
});
join_handles.push(join_handle);
let client_proc = client.clone();
let proc_handle = tokio::spawn(async move {
while client_proc.process_packets().await {
// Keep reading and processing incoming packets without cancellation
}
});
join_handles.push(tick_handle);
join_handles.push(proc_handle);
log::info!("{}/{} Bots Joined", i + 1, bot_count);
}
// Graceful shutdown on Ctrl+C