diff --git a/README.md b/README.md index 061481a8..5666b808 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,8 @@ public record HandshakeFailure(String messageKey) implements Packet { 1. **客户端发起连接**: `Client` 连接成功后,立即发送 `ClientHello` 包,包含其在 `config.yml` 中配置的 `serverName` 和自身的 DMCC 版本号。 2. **服务端验证与质询**: `Server` 收到 `ClientHello` 后: - a. **白名单检查**: `Server` 检查 `serverName` 是否在 `config.yml` 的 `multi_server.servers` 列表中。如果不在,拒绝连接。 + a. **白名单检查**: `Server` 检查 `serverName` 是否在 `config.yml` 的 `multi_server.servers` 列表中。如果不在,返回 + `HandshakeFailure("handshake.error.not_whitelisted")` 并断开连接。 b. **版本检查**: 对比 `Client` 版本和自身版本。如果不兼容,返回 `HandshakeFailure("handshake.error.invalid_version")` 并断开连接。 c. **生成质询**: 如果通过,`Server` 生成一个唯一的、一次性的随机字符串作为 `challenge`,并暂存于内存中。 @@ -138,7 +139,7 @@ public record HandshakeFailure(String messageKey) implements Packet { |:------------------|:------------------------------|:--------------------|:-----------------------------| | 启动/停止**远程MC服务器** | `start `, `stop ` | (不可用) | 管理 `config.yml` 中定义的外部服务器进程。 | | 启用/禁用**本地DMCC功能** | (不可用) | `enable`, `disable` | 管理当前 MC 服务器上 DMCC 模组自身的运行状态。 | -| 重启**本地DMCC功能** | `restart` | `restart` | 重载配置并重启所有服务,Bot 会短暂离线。 | +| 重载**本地DMCC配置** | `reload` | `reload` | 应用内重载配置并重启所有服务,Bot 会短暂离线。 | | 关闭**整个DMCC应用** | `shutdown` | (不可用) | 彻底关闭 `standalone` 的 JVM 进程。 | ### 5.2 命令可用性矩阵 @@ -152,9 +153,9 @@ public record HandshakeFailure(String messageKey) implements Packet { | `console` | `admin` | ✅ | ❌ | ✅ | ✅ | 执行**所在MC服务器**的命令。`standalone` 无此命令。 | | `execute` | `admin` | ✅ | ✅ | ❌ | ✅ | **`multi-server` 核心**: `single_server` 无此命令。`client` 端执行时会将请求转发给 `server`。 | | `log` | `admin` | ✅ | ✅ | ✅ | ✅ | 获取各自实例的日志。可通过 `execute` 获取远程日志。 | -| `enable` | `admin` | ✅ | ❌ | ✅ | ❌ | 启用当前服务器上的 DMCC 模组。 | -| `disable` | `admin` | ✅ | ❌ | ✅ | ❌ | 禁用当前服务器上的 DMCC 模组。 | -| `restart` | `admin` | ✅ | ✅ | ✅ | ✅ | **应用内重启**: 通过 `disable()` + `init()` 实现。 | +| `enable` | `admin` | ✅ | ❌ | ✅ | ❌ | **本地作用**: 启用当前服务器上的 DMCC 模组。 | +| `disable` | `admin` | ✅ | ❌ | ✅ | ❌ | **本地作用**: 禁用当前服务器上的 DMCC 模组。 | +| `reload` | `admin` | ✅ | ✅ | ✅ | ✅ | **应用内重启**: 通过 `shutdown()` + `init()` 实现。 | | `start ` | `admin` | ❌ | ✅ | ❌ | ✅ | **`standalone` 独有**: 启动 `config.yml` 中定义的子服务器。 | | `stop ` | `admin` | ❌ | ✅ | ❌ | ✅ | **`standalone` 独有**: 停止子服务器(通常通过 `execute` 执行 `console stop` 实现)。 | | `shutdown` | `admin` | ❌ | ✅ | ❌ | ✅ | **`standalone` 独有**: 关闭 `standalone` 进程。 | diff --git a/core/src/main/resources/config/config_single_server.yml b/core/src/main/resources/config/config_single_server.yml index d8d670a3..2be41e1f 100644 --- a/core/src/main/resources/config/config_single_server.yml +++ b/core/src/main/resources/config/config_single_server.yml @@ -112,7 +112,7 @@ command_permissions: disable: admin enable: admin log: admin - restart: admin + reload: admin # link: everyone # whitelist: admin diff --git a/core/src/main/resources/config/config_standalone.yml b/core/src/main/resources/config/config_standalone.yml index 1c86e615..80559ebe 100644 --- a/core/src/main/resources/config/config_standalone.yml +++ b/core/src/main/resources/config/config_standalone.yml @@ -131,7 +131,7 @@ command_permissions: enable: admin execute: admin log: admin - restart: admin + reload: admin shutdown: admin start: admin stop: admin diff --git a/core/src/main/resources/lang/en_us.yml b/core/src/main/resources/lang/en_us.yml index 228be348..53249cce 100644 --- a/core/src/main/resources/lang/en_us.yml +++ b/core/src/main/resources/lang/en_us.yml @@ -29,10 +29,10 @@ commands: command: "The Minecraft command to execute" executing: "Executing command..." disable: - description: "Disable the DMCC module on the current server" + description: "Disable DMCC on the current Minecraft server" disabling: "Disabling DMCC..." enable: - description: "Enable the DMCC module on the current server" + description: "Enable DMCC on the current Minecraft server" enabling: "Enabling DMCC..." execute: description: "Execute a DMCC command on a sub-server" @@ -43,9 +43,9 @@ commands: description: "View a log file" params: file: "The log file to view" - restart: - description: "Restart the DMCC module to reload all configurations" - restarting: "Restarting DMCC..." + reload: + description: "Reload DMCC to apply latest configuration changes" + reloading: "Reloading DMCC..." shutdown: description: "Shut down the Standalone DMCC application" shutting_down: "Shutting down Standalone DMCC application..." diff --git a/core/src/main/resources/lang/zh_cn.yml b/core/src/main/resources/lang/zh_cn.yml index fdba8a82..e8728a4f 100644 --- a/core/src/main/resources/lang/zh_cn.yml +++ b/core/src/main/resources/lang/zh_cn.yml @@ -29,10 +29,10 @@ commands: command: "要执行的 Minecraft 命令" executing: "正在执行命令..." disable: - description: "在当前服务器上禁用 DMCC 模块" + description: "在当前 Minecraft 服务器上禁用 DMCC" disabling: "正在禁用 DMCC..." enable: - description: "在当前服务器上启用 DMCC 模块" + description: "在当前 Minecraft 服务器上启用 DMCC" enabling: "正在启用 DMCC..." execute: description: "在子服务器上执行 DMCC 命令" @@ -43,9 +43,9 @@ commands: description: "查看日志文件" params: file: "要查看的日志文件" - restart: - description: "重新启动 DMCC 模块以重新加载所有配置" - restarting: "正在重新启动 DMCC..." + reload: + description: "重新加载 DMCC 模块以应用最新配置" + reloading: "正在重新加载 DMCC..." shutdown: description: "关闭 DMCC 独立应用程序" shutting_down: "正在关闭 DMCC 应用程序..."