koishi-plugin-restart-projectzomboid 6.1.21 → 6.1.22
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/lib/index.js +3 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -612,6 +612,7 @@ ${recentLogs}`);
|
|
|
612
612
|
try {
|
|
613
613
|
await session.send("@全体成员 [" + server.name + "] 即将在 1 分钟后重启,请在线玩家妥善下线。");
|
|
614
614
|
await new Promise((resolve) => setTimeout(resolve, 6e4));
|
|
615
|
+
bsuNotifiedStartupPorts.delete(server.bindPort);
|
|
615
616
|
logger.info("[" + server.name + "] 发送 quit 指令...");
|
|
616
617
|
proc.stdin?.write("quit\r\n");
|
|
617
618
|
if (server.enableBSU) {
|
|
@@ -678,6 +679,7 @@ ${recentLogs}`);
|
|
|
678
679
|
shutdownHandler = /* @__PURE__ */ __name((data) => {
|
|
679
680
|
const output = data.toString();
|
|
680
681
|
if (output.includes("PAUSE")) {
|
|
682
|
+
bsuNotifiedStartupPorts.delete(server.bindPort);
|
|
681
683
|
ctx.broadcast([server.bindGroupId], "🛑 [" + server.name + "] 服务器已关闭。");
|
|
682
684
|
proc.stdout?.removeListener("data", shutdownHandler);
|
|
683
685
|
}
|
|
@@ -720,6 +722,7 @@ ${recentLogs}`);
|
|
|
720
722
|
try {
|
|
721
723
|
await session.send("@全体成员 [" + server.name + "] 即将在 1 分钟后重启,请在线玩家妥善下线。");
|
|
722
724
|
await new Promise((resolve) => setTimeout(resolve, 6e4));
|
|
725
|
+
bsuNotifiedStartupPorts.delete(server.bindPort);
|
|
723
726
|
logger.info("[" + server.name + "] 发送 quit 指令...");
|
|
724
727
|
proc.stdin?.write("quit\r\n");
|
|
725
728
|
await new Promise((resolve) => setTimeout(resolve, 3e3));
|