Skip to content

Commit 6c2930d

Browse files
authored
Merge pull request #51 from Titlehhhh/dev
Last Pull
2 parents f5f8d4e + 84f0cb5 commit 6c2930d

File tree

119 files changed

+2901
-3495
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+2901
-3495
lines changed

README.md

Lines changed: 92 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,108 @@
1-
[![Discord Banner](https://img.shields.io/badge/discord-join%20chat-46BC99)](https://discord.gg/HVDzx4rCgg)
1+
<h1 align="center">
2+
<img src="https://raw.githubusercontent.com/Titlehhhh/Minecraft-Holy-Client/master/mhc.svg" alt="Minecraft Holy Client">
3+
</h1>
24

3-
*На данный момент программа находится в предварительной версии, поэтому некоторые функции нестабильны. Подробнее можно узнать [здесь](preview.md).*
45

5-
# Minecraft Holy Client
6+
<h4 align="center">A high-performance platform for running stress-testing minecraft bots.</h4>
67

7-
Высокопроизводительная платформа для запуска стресс-тест ботов Minecraft, написанная на C#.
8+
<p align="center">
9+
<a href="https://github.com/Titlehhhh/Minecraft-Holy-Client/commits/master">
10+
<img src="https://img.shields.io/github/last-commit/Titlehhhh/Minecraft-Holy-Client.svg?style=flat-square&logo=github&logoColor=white"
11+
alt="GitHub last commit">
12+
<a href="https://github.com/Titlehhhh/Minecraft-Holy-Client/issues">
13+
<img src="https://img.shields.io/github/issues-raw/Titlehhhh/Minecraft-Holy-Client.svg?style=flat-square&logo=github&logoColor=white"
14+
alt="GitHub issues">
15+
<a href="https://github.com/Titlehhhh/Minecraft-Holy-Client/pulls">
16+
<img src="https://img.shields.io/github/issues-pr-raw/Titlehhhh/Minecraft-Holy-Client.svg?style=flat-square&logo=github&logoColor=white"
17+
alt="GitHub pull requests">
18+
<a href="https://discord.gg/HVDzx4rCgg">
19+
<img src="https://img.shields.io/badge/discord-join%20chat-46BC99"
20+
alt="Discord">
21+
<a href="https://github.com/Titlehhhh/Minecraft-Holy-Client/releases">
22+
<img src="https://img.shields.io/github/downloads/Titlehhhh/Minecraft-Holy-Client/total.svg"
23+
alt="Download">
824

9-
## Get Started
25+
26+
</p>
1027

11-
[Скачайте в релизах](https://github.com/Titlehhhh/Minecraft-Holy-Client/releases) последнюю версию Minecraft Holy Client и запустите её.
1228

13-
После запуска приложения Вас встретит окно с главной страницей.
14-
![image](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/4d582c49-13bd-44c7-81b4-f6ebd5b924cd)
29+
<p align="center">
30+
<a href="#installation">Installation</a> •
31+
<a href="#launch">Launch</a> •
32+
<a href="#features">Features</a> •
33+
<a href="#contributing">Contributing</a> •
34+
<a href="#support">Custom plugin</a> •
35+
<a href="#license">License</a>
36+
</p>
1537

16-
После открытия навигационного меню Вы увидите несколько пунктов:
17-
- Главная. Страница где есть основная информация о приложении: GitHub, Наш Discord сервер, а также документация(в разрботке).
18-
- Бот менеджер. Эта экспериментальная функция. Планируется в программу добавить простых ботов, таких как, боты афк-рыбалки или подобные.
19-
- Настройки. Вы можете настроить язык. Пока можно настроить только это.
20-
- Стресс-тест. Основная возможность приложения. Здесь Вы можете протестировать Ваш сервер под высокой нагрузкой.
21-
- Управление расширениями. Здесь Вы можете добавить свои плагины в программу.
22-
![image](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/3a156e06-bd3c-4882-9c5c-ce123c14b9c2)
38+
---
2339

24-
### Запуск стресс-теста
2540

26-
1) Перейдем на страницу Стресс-тест и введем Ip адрес сервера, который мы хотим нагрузить.
27-
2) Далее поставить префикс ника для ботов. Пусть будет "Title_"
28-
3) Затем укажем количество ботов. Это количество, которое система будет стремиться запустить. Например 1000.
29-
4) Укажем, что нужно в тестировании использовать прокси сервера, а также укажем версию 1.16.5.
30-
5) В настройках поведения укажем, чтобы боты спамили "Hello from Minecraft Holy Client".
31-
![image](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/fdbab77e-0eed-44ed-bbe3-30e6d100802b)
41+
<table>
42+
<tr>
43+
<td>
3244

33-
Нажимаем на зеленую кнопку видим, что боты зашли на сервер и спамят "Hello from Minecraft Holy Client"
34-
![image](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/51c89585-1fd5-4351-9677-a59322ececd7)
45+
**Minecraft Holy Client** is a handy, **high-performance**, easily extensible **open-source** application designed to run load and stress-test **Minecraft** bots, written in C#.
3546

47+
All components of the application have been designed to **maximize performance**, so it works stably on **weak devices**.
3648

37-
## Roadmap
3849

39-
![image](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/cee54a39-b6e5-4e10-b329-ec0230eb43b4)
50+
![Minecraft Holy Client Bots](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/75c9f0a3-8ae2-4b7c-8ad5-e8b5fa120165)
51+
<p align="right">
52+
<sub>(Preview 300~ bots)</sub>
53+
</p>
54+
55+
</td>
56+
</tr>
57+
</table>
58+
59+
## Installation
60+
61+
Minecraft Holy Client is available for **Windows**, **Linux** and **MacOs**. In addition, it is **portable** and is not installed on the system, so it can be easily uninstalled.
62+
63+
[Download](https://github.com/Titlehhhh/Minecraft-Holy-Client/releases) the latest version of HolyClient.Desktop and follow these instructions depending on your platform.
64+
65+
### Windows
66+
67+
1) Open and _extract_ the archive with the program.
68+
2) Run **HolyClient.Desktop.exe**
69+
70+
### Linux
71+
72+
_Using Ubuntu as an example_
73+
74+
1) Open and _extract_ the archive with the program.
75+
2) Open a terminal where the HolyClient.Desktop file is located and execute `./HolyClient.Desktop` in the console
76+
77+
### Mac Os
78+
79+
1) Open and _extract_ the archive with the program.
80+
2) Open a terminal where the HolyClient.Desktop file is located and execute `./HolyClient.Desktop` in the console
81+
82+
83+
## Launch
84+
85+
When we have launched the app, then we can safely go to the "Stress Test" tab and we can launch bots.
86+
87+
88+
89+
![image](https://github.com/Titlehhhh/Minecraft-Holy-Client/assets/93156853/55769ef1-f81d-477d-9027-02dfa0339f80)
90+
91+
92+
## Features
93+
94+
- **Custom proxies**. It is possible to load custom proxies from a link and a file.
95+
- **Multiverse in bots**. Bots can enter servers from 1.12.2 to 1.19.3. Temporarily not all packets are supported, this is being actively worked on.
96+
- **Using user behavior for stress testing**.
97+
98+
## Contributing
99+
100+
Contributions are always welcome!
101+
102+
## Custom plugin
103+
104+
The default plugin has few features. It just sends `/register <pass> <pass>` first and starts spamming immediately.
105+
Minecraft servers are a large number, with different anti-bot systems and if you want to test your server for bot attacks, it makes sense to write a custom plugin that would bypass it. How to write custom plugins is written here.
40106

41107

42108

ReleaseNotes/2.0.0-preview.1/En.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
> [!WARNING]
22
> Disclaimer: This translation was generated using AI.
33
4-
# What's New in Minecraft Holy Client *2.0.0-preview.1*?
4+
# What's New in Minecraft Holy Client **2.0.0-preview.1.1**?
55

66
## Major Fixes
77

ReleaseNotes/2.0.0-preview.1/Ru.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Что изменилось в Minecraft Holy Client *2.0.0-preview.1*?
1+
# Что изменилось в Minecraft Holy Client **2.0.0-preview.1.1**?
22

33
## Основные исправления
44

ReleaseNotes/2.0.0-preview.2/En.md

Whitespace-only changes.

ReleaseNotes/2.0.0-preview.2/Ru.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- memory performance
2+
- default plugin /reg to /register

build/_build.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<PackageReference Include="Nuke.Common" Version="7.0.6" />
2323

24-
<PackageReference Include="Octokit" Version="9.0.0" />
24+
<PackageReference Include="Octokit" Version="9.1.0" />
2525
</ItemGroup>
2626

2727
<ItemGroup>

preview.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22

33
Этот раздел может меняться в течение разработки. Все изменения будут написаны в заметках о выпуске предварительной версии.
44

5-
# Функции, которые нужно добавить
65

7-
## Плагины
8-
- Плагин, который будет установлен в программу по умолчанию. Это упростит использование программой простым пользователям.
6+
# Плагины
97
- Возможность перезагружать плагины из менеджера расширений, а также из вкладки "Поведения".
108
- Возможность загружать плагины из NuGet.
119
- Отображение ошибки, если плагин не найден.
1210
- Отображение ошибки, если поведение не найдено.
1311

14-
## Прокси
15-
- Прокси по умолчанию.
16-
- Возможность загружать прокси из URL источников, например, из открытых репозиториех GitHub с бесплатными списками прокси.
12+
# Прокси
1713
- Возможность загружать прокси с логином и паролем.
1814
- Отображение количества загруженных прокси в окне с запуском стресс теста.
1915
- Возможность загружать разные типы прокси(HTTP(S), Socks(4/5)) из одного источника.
2016

21-
## Прочее
17+
# Прочее
2218
- Система профилей в стресс тесте.
2319

roadmap.png

260 KB
Loading

src/CoreLibs/HolyClient.Abstractions/StressTest/IStressTestBot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace HolyClient.Abstractions.StressTest
66
public interface IStressTestBot
77
{
88
public Task Restart(bool changeNickAndProxy);
9-
IObservable<Exception> OnError { get; }
9+
1010

1111
public MinecraftClient Client { get; }
1212
}

src/CoreLibs/HolyClient.Common/HolyClient.Common.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.2" />
1212
<PackageReference Include="MessagePack" Version="2.6.100-alpha" />
1313
<PackageReference Include="Polly" Version="8.2.0" />
14-
<PackageReference Include="ReactiveUI.Fody" Version="19.5.31" />
14+
<PackageReference Include="ReactiveUI.Fody" Version="19.5.39" />
1515
<PackageReference Include="Serilog" Version="3.1.2-dev-02097" />
16-
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
16+
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
1717
<PackageReference Include="QuickProxyNet" Version="0.1.4" />
1818
</ItemGroup>
1919

src/CoreLibs/HolyClient.Core/Helpers/MapDataHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public static Image<Rgba32> CreateImage(byte[] colors)
2727

2828
var color = new Rgba32(values[0], values[1], values[2]);
2929

30-
//Console.WriteLine(color.Name);
30+
3131
image[y, x] = color;
3232
}
3333
}

src/CoreLibs/HolyClient.Core/HolyClient.Core.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
<PackageReference Include="ConfigureAwait.Fody" Version="3.3.2" />
2121
<PackageReference Include="MessagePack" Version="2.6.100-alpha" />
2222
<PackageReference Include="Polly" Version="8.2.0" />
23-
<PackageReference Include="ReactiveUI.Fody" Version="19.5.31" />
23+
<PackageReference Include="ReactiveUI.Fody" Version="19.5.39" />
2424
<PackageReference Include="Serilog" Version="3.1.2-dev-02097" />
25-
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.0" />
25+
<PackageReference Include="Serilog.Sinks.Console" Version="5.0.1" />
2626
<PackageReference Include="SixLabors.Fonts" Version="2.0.0" />
2727
<PackageReference Include="SixLabors.ImageSharp" Version="3.0.2" />
2828
<PackageReference Include="SixLabors.ImageSharp.Drawing" Version="2.0.1" />

src/CoreLibs/HolyClient.Core/Models/BotManager/MinecraftBot.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public async Task Run(ILogger logger, CancellationToken cancellation)
110110

111111
Interlocked.Exchange(ref _cleanUpPlugins, disposables);
112112

113-
await minecraftClient.Login(logger);
113+
await minecraftClient.Start(logger);
114114
}
115115
public Task Stop()
116116
{

src/CoreLibs/HolyClient.StressTest/DefaultBehavior.cs

Lines changed: 75 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ public class DefaultBehavior : IStressTestBehavior
1313

1414
[System.ComponentModel.DisplayName("Spam timeout")]
1515
public int SpamTimeout { get; set; } = 5000;
16+
[System.ComponentModel.DisplayName("Reconnect timeout")]
17+
public int ReconnectTimeout { get; set; } = 5000;
1618

19+
[System.ComponentModel.DisplayName("Reconnect timeout")]
20+
public int Reconnects { get; set; } = 1;
21+
22+
[System.ComponentModel.DisplayName("Spam Nocom")]
23+
public bool SpamNocom { get; set; } = false;
1724

1825
private static Regex SayVerifyRegex = new(@"\.say \/verify (\d+)");
1926

@@ -23,9 +30,9 @@ public Task Activate(CompositeDisposable disposables, IEnumerable<IStressTestBot
2330
{
2431
CancellationTokenSource cts = null;
2532

26-
var d = bot.OnError.Subscribe(async x =>
27-
{
2833

34+
Action<Exception> onErr = async (exc) =>
35+
{
2936
try
3037
{
3138
if (cts is not null)
@@ -43,13 +50,35 @@ public Task Activate(CompositeDisposable disposables, IEnumerable<IStressTestBot
4350
{
4451
cts = null;
4552
}
53+
if (Reconnects <= 0)
54+
{
55+
await bot.Restart(true);
56+
}
57+
else
58+
{
4659

47-
await Task.Delay(1500);
48-
await bot.Restart(true);
60+
for (int i = 0; i < Reconnects-1; i++)
61+
{
62+
if (ReconnectTimeout <= 0)
63+
await Task.Delay(1000);
64+
else
65+
await Task.Delay(ReconnectTimeout);
4966

50-
});
5167

52-
disposables.Add(d);
68+
69+
await bot.Restart(false);
70+
}
71+
await bot.Restart(true);
72+
}
73+
};
74+
75+
bot.Client.OnErrored += onErr;
76+
77+
78+
disposables.Add(Disposable.Create(() =>
79+
{
80+
bot.Client.OnErrored -= onErr;
81+
}));
5382

5483
var d2 = bot.Client.OnJoinGame.Subscribe(async x =>
5584
{
@@ -60,12 +89,12 @@ public Task Activate(CompositeDisposable disposables, IEnumerable<IStressTestBot
6089

6190
await Task.Delay(500);
6291

63-
await bot.Client.SendChat("/reg 21qwerty 21qwerty");
92+
await bot.Client.SendChat("/register 21qwerty 21qwerty");
6493

6594
try
6695
{
6796
using CancellationTokenSource cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
68-
//{
97+
6998

7099
var m = await bot.Client.OnChatMessage
71100
.Where(x => x.Message.Contains("verify"))
@@ -76,29 +105,25 @@ public Task Activate(CompositeDisposable disposables, IEnumerable<IStressTestBot
76105
var code = SayVerifyRegex.Match(m.Message).Value;
77106

78107
await bot.Client.SendChat(code);
79-
//}
108+
80109
}
81110
catch (Exception ex)
82111
{
83-
//Console.WriteLine(ex);
84-
}
85112

86-
while (!cts.IsCancellationRequested)
87-
{
88-
await bot.Client.SendChat(SpamText);
89-
if (SpamTimeout <= 0)
90-
await Task.Delay(1000);
91-
else
92-
await Task.Delay(SpamTimeout);
93113
}
114+
115+
var spamming = SpamMessage(cts, bot);
116+
var nuker = SpamNocomAsync(cts, bot);
117+
118+
await Task.WhenAll(spamming, nuker);
94119
}
95120
catch (Exception ex)
96121
{
97-
Console.WriteLine(ex.Message);
122+
98123
}
99124
finally
100125
{
101-
Console.WriteLine("cancel");
126+
102127
}
103128
});
104129

@@ -109,6 +134,36 @@ public Task Activate(CompositeDisposable disposables, IEnumerable<IStressTestBot
109134
}
110135
return Task.CompletedTask;
111136
}
137+
private async Task SpamMessage(CancellationTokenSource cts, IStressTestBot bot)
138+
{
139+
while (!cts.IsCancellationRequested)
140+
{
141+
await bot.Client.SendChat(SpamText);
142+
if (SpamTimeout <= 0)
143+
await Task.Delay(1000);
144+
else
145+
await Task.Delay(SpamTimeout);
146+
}
147+
}
148+
private async Task SpamNocomAsync(CancellationTokenSource cts, IStressTestBot bot)
149+
{
150+
if (!SpamNocom)
151+
return;
152+
while (!cts.IsCancellationRequested)
153+
{
154+
155+
await Task.Delay(100);
156+
157+
await bot.Client.SendAction(0,
158+
new McProtoNet.Vector3(
159+
Random.Shared.Next(0, 10000),
160+
Random.Shared.Next(0, 255),
161+
Random.Shared.Next(0, 10000)),
162+
McProtoNet.Core.BlockFace.DOWN);
163+
164+
165+
}
166+
}
112167
}
113168

114169
}

0 commit comments

Comments
 (0)