@baipiaodajun/mcbots 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/package.json +2 -2
- package/server.js +5 -5
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ npm install && npm run start
|
|
|
52
52
|
```
|
|
53
53
|
docker run -d \
|
|
54
54
|
--name mcbot \
|
|
55
|
-
-e SERVERS_JSON='[{"host":"mc-yy.io","port":25565,"minBots":1,"maxBots":3
|
|
55
|
+
-e SERVERS_JSON='[{"host":"mc-yy.io","port":25565,"minBots":1,"maxBots":3},{"host":"mc-xx.io","port":25565,"minBots":1,"maxBots":3}]' \
|
|
56
56
|
-p 3000:3000 \
|
|
57
57
|
mingli2038/mcbot:latest
|
|
58
58
|
```
|
|
@@ -61,9 +61,10 @@ docker run -d \
|
|
|
61
61
|
|
|
62
62
|
- 新版本引入了 **热更新功能:`SERVER_JSON`**
|
|
63
63
|
- 目前该功能处于 **实验状态**,可能会导致一些 **意料之外的问题**
|
|
64
|
-
-
|
|
64
|
+
- ~~如果需要稳定使用,推荐继续使用 **1.1 版本**~~
|
|
65
65
|
- **1.2.4** 优化机器人断开逻辑,避免幽灵机器人出现。
|
|
66
66
|
- **1.2.5** 根据群友建议加入服务备注,以便能够区分是哪一家服务器,因为一些服务器没有域名。
|
|
67
|
+
- **1.2.6** mineflayer更新到4.35,得益于此,现在可以直连1.21.8-1.21.11的MC离线模式服务器而不需要通过兼容版本插件,mc版本|最大机器人数|最小机器人数变成可选项,有默认值,mc版本使用上游自动识别功能。
|
|
67
68
|
---
|
|
68
69
|
|
|
69
70
|
### 页面更新
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baipiaodajun/mcbots",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "Minecraft bot and status dashboard for multi-server management",
|
|
5
5
|
"main": "server.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"cookie-parser": "^1.4.7",
|
|
18
18
|
"express": "^4.18.2",
|
|
19
|
-
"mineflayer": "
|
|
19
|
+
"mineflayer": "4.35",
|
|
20
20
|
"node-fetch": "^2.7.0"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
package/server.js
CHANGED
|
@@ -210,10 +210,10 @@ class MinecraftBotManager {
|
|
|
210
210
|
constructor(host, port, minBots, maxBots, version,note) {
|
|
211
211
|
this.host = host;
|
|
212
212
|
this.port = port;
|
|
213
|
-
this.minBots = minBots;
|
|
214
|
-
this.maxBots = maxBots;
|
|
213
|
+
this.minBots = minBots || 1;
|
|
214
|
+
this.maxBots = maxBots || 3;
|
|
215
215
|
this.note=note;
|
|
216
|
-
this.version = version ||
|
|
216
|
+
this.version = version || false;
|
|
217
217
|
this.currentBots = 0;
|
|
218
218
|
this.activeBots = new Map();
|
|
219
219
|
this.pendingReconnect = new Set(); // 等待重连的机器人名字(已断开但优先重用名字)
|
|
@@ -233,8 +233,8 @@ class MinecraftBotManager {
|
|
|
233
233
|
globalServerStatus.servers.set(`${host}:${port}`, {
|
|
234
234
|
host: host,
|
|
235
235
|
port: port,
|
|
236
|
-
minBots: minBots,
|
|
237
|
-
maxBots: maxBots,
|
|
236
|
+
minBots: this.minBots,
|
|
237
|
+
maxBots: this.maxBots,
|
|
238
238
|
note:note,
|
|
239
239
|
currentBots: 0,
|
|
240
240
|
activeBots: [],
|