diff --git a/CHANGELOG.md b/CHANGELOG.md index 5712817..824c8db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,8 +62,11 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). and one WARNING names the file and backup. On the first start after upgrading from a framework version without language-file hash records (before 6.3.0), every official file that differs from the new jar is backed up and restored, edited or not. Here both older `en.json` and `zh.json` have renamed keys, so - upgrading them produces two backups and two WARNINGs. A server whose language files were never edited - still needs no action. To customise messages, copy the official file inside this module's own `lang/` + when the framework upgrade and this module's JAR swap meet in one start, they produce two backups and + two WARNINGs. With the recommended order and a restart in between (framework first, still running the + earlier module), that start records the unedited earlier files as untouched, and after the JAR swap + they are refreshed with no backup and no WARNING (#93). A server whose language files were never + edited still needs no action. To customise messages, copy the official file inside this module's own `lang/` folder under a new name starting with its language code and a hyphen (`en.json` to `en-myserver.json`). The name without `.json` must start with an ASCII letter or digit and contain only ASCII letters, digits, `_` and `-`. Edit the copy against the new keys and set `language: en-myserver` in @@ -79,7 +82,9 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). 会对当前使用的官方语言(自定义名称对应的官方语言)做相同处理。旧文件在原目录保留为 `.bak`(名称已占用时使用 `.1.bak`、`.2.bak` 等),一条 WARNING 会指明原文件与备份。首次从没有语言文件哈希记录的框架版本(6.3.0 之前) 升级后启动时,只要官方文件与新 jar 不同,即使从未手动改过,也会被备份并恢复。本模块的 `en.json` 和 `zh.json` - 都改过键名,因此升级这两个旧文件时会产生两个备份与两条 WARNING。从未改过语言文件的服务器仍无需任何操作。 + 都改过键名,因此框架升级与本模块 JAR 替换在同一次启动中完成时,这两个旧文件会产生两个备份与两条 WARNING; + 若按推荐顺序分两次启动(先升级框架并重启,仍运行旧版本模块),未改动的旧文件会被记录为未修改,替换 JAR 后直接更新, + 不产生备份与 WARNING(#93)。从未改过语言文件的服务器仍无需任何操作。 要自定义消息,请在本模块自己的 `lang/` 目录中复制官方文件并改名(`zh.json` → `zh-myserver.json`),新名称以官方语言代码 加连字符开头;不含 `.json` 的名称必须以 ASCII 字母或数字开头,且只含 ASCII 字母、数字、`_` 和 `-`。 按新键修改副本,然后在 `plugins/UltiTools/config.yml` 中设置 `language: zh-myserver`(框架和所有模块共用这一个设置)。 diff --git a/FEATURES.md b/FEATURES.md index be36b1b..4be9979 100644 --- a/FEATURES.md +++ b/FEATURES.md @@ -288,7 +288,7 @@ report that distinction rather than a false "not banned anywhere". | ultiessentials.ban.ban-with-reason | Permanently ban a player with a given reason, kicking them immediately if online, and announcing the ban and reason — to the whole server, or to the issuer alone when `features.ban.broadcast-ban` is `false` | command | `/ban ` | ultiessentials.ban | both | admin | brief | BanCommand#banWithReason | | ultiessentials.ban.tempban | Temporarily ban a player for a parsed duration (`1d`/`2h`/`30m`/`1w`, combinable e.g. `1d12h30m`) with the same default reason as `ultiessentials.ban.ban` (see that row), refusing on an unparseable duration, and announcing the ban as `ultiessentials.ban.ban` does | command | `/tempban ` | ultiessentials.ban.temp | both | admin | brief | TempBanCommand#tempban | | ultiessentials.ban.tempban-with-reason | Temporarily ban a player for a parsed duration with a given reason, announcing the ban and reason as `ultiessentials.ban.ban-with-reason` does | command | `/tempban ` | ultiessentials.ban.temp | both | admin | brief | TempBanCommand#tempbanWithReason | -| ultiessentials.ban.unban | Unban a player by name (this plugin's own record only), reporting one of four distinct outcomes depending on whether the plugin's own record and/or the server's own vanilla ban list currently ban the name (see section note); the two success outcomes are reported only once no active record remains for the name (re-queried after the deactivation, because the framework's `update(T)` returns no affected-row count), so the unban broadcast (sent on the plain-success outcome only, and only while `features.ban.broadcast-unban` is `true`) cannot fire for a ban that is still in force; a ban record that survives the attempt is reported as a failure to lift it, never as a name that was never banned | command | `/unban ` | ultiessentials.unban | both | admin | brief | UnbanCommand#unban | +| ultiessentials.ban.unban | Unban a player by name (this plugin's own record only), reporting one of four distinct outcomes depending on whether the plugin's own record and/or the server's own vanilla ban list currently ban the name (see section note); the two success outcomes are reported only once no active record remains for the name (re-queried after the deactivation, because the framework's `update(T)` returns no affected-row count), so the unban broadcast (sent on the plain-success outcome only, and only while `features.ban.broadcast-unban` is `true`) cannot fire for a ban that is still in force; a ban record that survives the attempt is reported as a failure to lift it, never as a name that was never banned. An IP-only record (from `/banip`) stores its canonical address as its name, so `/unban
` spelled exactly that way also deactivates it and reports a player unban; `/unbanip` is the intended command for addresses (#94) | command | `/unban ` | ultiessentials.unban | both | admin | brief | UnbanCommand#unban | | ultiessentials.ban.ip-create | Permanently ban a canonical numeric IPv4/IPv6 address without a player UUID; verify insertion before kicking every matching online connection and confirming to the issuer; duplicate, disabled, invalid and failed writes are distinct outcomes; broadcast only with `features.ban.broadcast-ban` | command | `/banip ` | ultiessentials.banip | both | admin | brief | BanIpCommand#ban, BanService#banIp | | ultiessentials.ban.ip-create-with-reason | Same IP-only ban with an explicit reason, retained in the record and kick message | command | `/banip ` | ultiessentials.banip | both | admin | brief | BanIpCommand#banWithReason | | ultiessentials.ban.ip-lift | Deactivate every active, unexpired module record matching the canonical address; re-query before success, distinguish failed update from no active record, report a remaining vanilla IP ban without modifying it, and broadcast only plain success with `features.ban.broadcast-unban`; remains available while enforcement is disabled | command | `/unbanip ` | ultiessentials.unbanip | both | admin | brief | UnbanIpCommand#unban, BanService#unbanIp | diff --git a/README.md b/README.md index 5f9e5a2..ba63560 100644 --- a/README.md +++ b/README.md @@ -64,13 +64,13 @@ UltiEssentials 是基于 UltiTools-API 框架开发的服务器基础功能插 | `/banip [reason]` | Permanently ban a numeric IPv4/IPv6 address in this module and kick every online connection sharing it | `ultiessentials.banip` | | `/unbanip ` | Lift all active module ban records for that address, confirming the stored result before reporting success | `ultiessentials.unbanip` | -Both commands accept players and console. Use numeric addresses only, without hostnames, ports, CIDR, brackets or scope suffixes. IPv6 spellings are normalized; `/banlist` displays an IP-only record with its address in the name column. `/banip` does not create a player UUID ban. Shared addresses affect everyone using them (including a proxy's address); use the address the server actually sees and prefer `/ban` when only one account should be blocked. No IP-address tab completion is provided. +Both commands accept players and console. Use numeric addresses only, without hostnames, ports, CIDR, brackets or scope suffixes. IPv6 spellings are normalized; `/banlist` displays an IP-only record with its address in the name column. Because that record stores the address as its name, `/unban
` typed exactly as `/banlist` shows it also lifts the IP-only ban and reports it as a player unban; use `/unbanip`, which accepts any equivalent spelling and also reports a remaining vanilla IP ban. `/banip` does not create a player UUID ban. Shared addresses affect everyone using them (including a proxy's address); use the address the server actually sees and prefer `/ban` when only one account should be blocked. No IP-address tab completion is provided. `features.ban.enabled` gates new IP bans and login enforcement; `/unbanip` still works while disabled. The existing `features.ban.broadcast-ban` and `features.ban.broadcast-unban` switches govern the announcements (which contain the IP address); the issuer always receives confirmation. Set them to `false` if addresses must not be shown to other players. `/unbanip` deactivates every matching record, including a legacy record that also carries a player UUID; independent player bans without that address remain. It reports a surviving module record as failure, not as success or not-banned. These commands never change the separate vanilla IP ban list. A remaining vanilla IP ban is reported explicitly; lift it separately with `minecraft:pardon-ip`. Vanilla `/ban-ip` and `/pardon-ip` are not replaced. Successful lifting means this module has no active IP ban for the address, not that all other player/login restrictions are gone. -新增 `/banip [原因]` 与 `/unbanip `,玩家和控制台均可使用。只接受数值 IPv4/IPv6 地址;封禁共享地址会影响该地址的全部玩家。命令仅管理本模块记录,不改动原版 IP 名单。解封会确认全部匹配记录已停用;独立玩家封禁仍可能生效。广播包含 IP,可通过现有广播开关关闭;执行者仍会收到结果。 +新增 `/banip [原因]` 与 `/unbanip `,玩家和控制台均可使用。只接受数值 IPv4/IPv6 地址;封禁共享地址会影响该地址的全部玩家。命令仅管理本模块记录,不改动原版 IP 名单。IP 封禁记录以地址作为名称保存,因此按 `/banlist` 显示的写法执行 `/unban <地址>` 也会解除该 IP 封禁,并按玩家解封报告;建议使用 `/unbanip`,它接受等价的地址写法,并会提示仍存在的原版 IP 封禁。解封会确认全部匹配记录已停用;独立玩家封禁仍可能生效。广播包含 IP,可通过现有广播开关关闭;执行者仍会收到结果。 ### Staff recall / 管理员召回 @@ -266,11 +266,11 @@ UltiEssentials 支持多语言,语言文件位于 `lang/` 目录: - `lang/zh.json` - 简体中文 - `lang/en.json` - English -UltiTools manages both official files. In-place edits are restored to the shipped text at every start for all shipped languages, and on `/ul reload` or `/ul reload UltiEssentials` for the official language in use (the official base when using a custom name). The previous file is kept beside it as `.bak` (or `.1.bak`, `.2.bak`, etc. if needed), and a WARNING names the file and backup. On the first start after upgrading from a framework version without language-file hash records (before UltiTools-API 6.3.0), each official file that differs from the new jar is backed up and restored even if you never edited it. Both `en.json` and `zh.json` have renamed keys in this module, so upgrading those older files produces two backups and two WARNINGs; an unedited installation still needs no action. +UltiTools manages both official files. In-place edits are restored to the shipped text at every start for all shipped languages, and on `/ul reload` or `/ul reload UltiEssentials` for the official language in use (the official base when using a custom name). The previous file is kept beside it as `.bak` (or `.1.bak`, `.2.bak`, etc. if needed), and a WARNING names the file and backup. On the first start after upgrading from a framework version without language-file hash records (before UltiTools-API 6.3.0), each official file that differs from the new jar is backed up and restored even if you never edited it. Both `en.json` and `zh.json` have renamed keys in this module, so when the framework upgrade and this module's JAR swap happen in the same start, those older files produce two backups and two WARNINGs. If you follow the recommended order with a restart in between (framework first, while still running the earlier module version), that start records the unedited earlier files as untouched, and after the JAR swap they are refreshed with no backup and no WARNING. Either way an unedited installation needs no action. To customise messages, copy an official file **inside this module's own** `plugins/UltiTools/pluginConfig/UltiEssentials/lang/` folder under a new name: for example, `zh.json` → `zh-myserver.json`. Start the name with the official language code and a hyphen; the name without `.json` must start with an ASCII letter or digit and contain only ASCII letters, digits, `_` and `-`. Edit the copy and set `language: zh-myserver` in `plugins/UltiTools/config.yml` (one setting shared by the framework and every module). Missing messages come from official `zh`; a module without that custom file uses its official `zh`. A safe name without an official-code prefix, such as `ja`, is still read from this module's `lang/ja.json`, but missing messages use English and a WARNING explains the fallback for each module when its language is loaded. An unsafe name is not read; this module uses English instead. A copy in another module's folder does not customise UltiEssentials. -这两个官方语言文件归 UltiTools 管理:每次启动会检查所有自带语言并恢复直接修改过的官方文件;执行 `/ul reload` 或 `/ul reload UltiEssentials` 时,会对当前使用的官方语言(使用自定义名称时则是其对应的官方语言)做相同处理。旧文件在原目录保留为 `.bak`(名称已被占用时使用 `.1.bak`、`.2.bak` 等),一条 WARNING 会指明原文件与备份。首次从没有语言文件哈希记录的框架版本(UltiTools-API 6.3.0 之前)升级后启动时,只要官方文件与新 jar 不同,即使从未手动改过,也会被备份并恢复。本模块的 `en.json` 和 `zh.json` 都改过键名,因此升级这两个旧文件时会产生两个备份与两条 WARNING;从未改过语言文件的服务器仍无需任何操作。 +这两个官方语言文件归 UltiTools 管理:每次启动会检查所有自带语言并恢复直接修改过的官方文件;执行 `/ul reload` 或 `/ul reload UltiEssentials` 时,会对当前使用的官方语言(使用自定义名称时则是其对应的官方语言)做相同处理。旧文件在原目录保留为 `.bak`(名称已被占用时使用 `.1.bak`、`.2.bak` 等),一条 WARNING 会指明原文件与备份。首次从没有语言文件哈希记录的框架版本(UltiTools-API 6.3.0 之前)升级后启动时,只要官方文件与新 jar 不同,即使从未手动改过,也会被备份并恢复。本模块的 `en.json` 和 `zh.json` 都改过键名,因此当框架升级与本模块 JAR 替换在同一次启动中完成时,这两个旧文件会产生两个备份与两条 WARNING。若按推荐顺序分两次启动(先升级框架、仍运行旧版本模块并重启),那次启动会把未改动的旧文件记录为未修改,替换 JAR 后它们会直接更新,不产生备份与 WARNING。无论哪种顺序,从未改过语言文件的服务器都无需任何操作。 如需自定义消息,请在**本模块自己的** `plugins/UltiTools/pluginConfig/UltiEssentials/lang/` 目录中复制官方文件并改名(例如 `zh.json` → `zh-myserver.json`)。新名称应以官方语言代码加连字符开头;不含 `.json` 的名称必须以 ASCII 字母或数字开头,且只含 ASCII 字母、数字、`_` 和 `-`。修改副本后,在 `plugins/UltiTools/config.yml` 中设置 `language: zh-myserver`(框架和所有模块共用这一个设置)。副本中没有的消息取自官方 `zh`,没有该自定义文件的模块使用其官方 `zh`。`ja` 这类安全但没有官方语言前缀的名称仍会读取本模块的 `lang/ja.json`,但缺少的消息使用英文,各模块加载语言时会以一条 WARNING 解释回退。名称不安全时不会读取该文件,本模块改用英文。放在其他模块目录中的副本不会影响 UltiEssentials。