按需启动添加了相应的提示日志

This commit is contained in:
zhangyuheng 2023-12-13 14:49:30 +08:00
parent 96d2fff4cf
commit 672c7fc340
3 changed files with 10 additions and 3 deletions

View File

@ -14,7 +14,8 @@ export class OnDemandRunner {
}
public async run(port: number) {
logger.info(`${this.instance.instanceUuid} OnDemandRunner started.`);
logger.info(`${this.instance.instanceUuid} `, $t("on_demand.start"));
this.instance.println("INFO", $t("on_demand.start"));
this.running = true;
return new Promise<void>(async (resolve, reject) => {
try {
@ -92,6 +93,8 @@ export class OnDemandRunner {
this.instance.execPreset("stop", "OnDemandRunner");
}
this.instance.stopped();
this.instance.println("INFO", $t("on_demand.stop"));
logger.info(`${this.instance.instanceUuid} `, $t("on_demand.stop"));
}
private startSocketServer(port: number) {

View File

@ -227,6 +227,8 @@
"on_demand": {
"cantStartOnDemand": "May not a Minecraft server, unable to start on demand.",
"over30minClose": "Instance has been vancant for more than 30 minutes, going to sleep...",
"instanceSleeping": "Instance is sleeping, waiting for player to wake it up."
"instanceSleeping": "Instance is sleeping, waiting for player to wake it up.",
"start": "On demand sequence started.",
"stop": "On demand sequence stopped."
}
}

View File

@ -227,6 +227,8 @@
"on_demand": {
"cantStartOnDemand": "可能由于不是Minecraft服务器无法使用按需启动功能。",
"over30minClose": "实例超过30分钟不活跃正在进入休眠状态。",
"instanceSleeping": "实例已休眠,等待玩家唤醒。"
"instanceSleeping": "实例已休眠,等待玩家唤醒。",
"start": "已进入按需启动模式实例将在超过30分钟不活跃后自动关闭并在玩家进入时自动开启。",
"stop": "已退出按需启动模式。"
}
}