@baipiaodajun/mcbots 1.0.0 → 1.0.1
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 +5 -2
- package/package.json +1 -1
- package/server.js +2 -3
package/README.md
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
process.env.SERVERS_JSON='[{"host":"mc-yy.io","port":25565,"minBots":1,"maxBots":3,"version":"1.20.1"},{"host":"mc-xx.io","port":25565,"minBots":1,"maxBots":3,"version":"1.20.1"}]';
|
|
9
9
|
|
|
10
10
|
const mcbot = require('@baipiaodajun/mcbots');
|
|
11
|
-
|
|
12
11
|
```
|
|
13
12
|
|
|
14
13
|
再新建一个package.json,内容如下:
|
|
@@ -22,10 +21,14 @@ const mcbot = require('@baipiaodajun/mcbots');
|
|
|
22
21
|
"start": "node index.js"
|
|
23
22
|
},
|
|
24
23
|
"dependencies": {
|
|
25
|
-
"@baipiaodajun/mcbots": "^1.0.
|
|
24
|
+
"@baipiaodajun/mcbots": "^1.0.1"
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
```
|
|
28
|
+
接下来运行启动nodejs就可以
|
|
29
|
+
```
|
|
30
|
+
npm install && npm run start
|
|
31
|
+
```
|
|
29
32
|
### docker
|
|
30
33
|
```
|
|
31
34
|
docker run -d \
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const mineflayer = require('mineflayer');
|
|
2
|
-
const { exec } = require('child_process');
|
|
3
2
|
const express = require('express');
|
|
4
|
-
|
|
3
|
+
const PORT = process.env.SERVER_PORT || process.env.PORT || 3000 ;
|
|
5
4
|
// Minecraft服务器配置
|
|
6
5
|
const SERVERS = [
|
|
7
6
|
{
|
|
@@ -360,7 +359,7 @@ class SystemMonitor {
|
|
|
360
359
|
|
|
361
360
|
// Web状态服务器
|
|
362
361
|
class StatusServer {
|
|
363
|
-
constructor(port =
|
|
362
|
+
constructor(port = PORT) {
|
|
364
363
|
this.port = port;
|
|
365
364
|
this.app = express();
|
|
366
365
|
this.server = null;
|