summaryrefslogtreecommitdiff
path: root/website/src
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-08-30 13:54:28 +0900
committerGitHub <noreply@github.com>2026-08-30 13:54:28 +0900
commitb697f1cc341cbd9740daa2249c566f1b6bf1952d (patch)
tree6d4d14a5f6cc07d28d8b85fdaedc32496e6f5988 /website/src
parent6e267a6a0426a5290c8f689c8333f1e9b35e87b7 (diff)
parentebdb8d1940b41bab60d201eb6b0cd6f05efbc6ac (diff)
downloadLunaticChat-b697f1cc341cbd9740daa2249c566f1b6bf1952d.tar.gz
LunaticChat-b697f1cc341cbd9740daa2249c566f1b6bf1952d.tar.bz2
LunaticChat-b697f1cc341cbd9740daa2249c566f1b6bf1952d.zip
Merge pull request #293 from m1sk9/feat/config-reload
feat: Add `/lc reload` command
Diffstat (limited to 'website/src')
-rw-r--r--website/src/docs/configuration.md22
-rw-r--r--website/src/docs/developers/platform-paper.md5
-rw-r--r--website/src/docs/features/admin.md20
-rw-r--r--website/src/docs/getting-started.md2
-rw-r--r--website/src/docs/permissions.md1
-rw-r--r--website/src/docs/reference/commands.md8
-rw-r--r--website/src/docs/reference/message-format.md2
-rw-r--r--website/src/ja/docs/configuration.md22
-rw-r--r--website/src/ja/docs/developers/platform-paper.md5
-rw-r--r--website/src/ja/docs/features/admin.md20
-rw-r--r--website/src/ja/docs/getting-started.md2
-rw-r--r--website/src/ja/docs/permissions.md1
-rw-r--r--website/src/ja/docs/reference/commands.md8
-rw-r--r--website/src/ja/docs/reference/message-format.md2
14 files changed, 114 insertions, 6 deletions
diff --git a/website/src/docs/configuration.md b/website/src/docs/configuration.md
index f2cfe5b..fb9f260 100644
--- a/website/src/docs/configuration.md
+++ b/website/src/docs/configuration.md
@@ -8,7 +8,23 @@ LunaticChat's configuration is managed in `plugins/LunaticChat/config.yml`. A de
## Applying Changes
-There is no reload command. Edit `config.yml` and **restart the server** to apply a change.
+`/lc reload` <Badge type="tip" text="v1.4.0~" /> re-reads `config.yml` while the server runs. It applies the [`messageFormat`](/docs/reference/message-format) settings and nothing else.
+
+Every other setting decides something that is settled once, when the plugin starts: which services exist, which commands and listeners are registered, which files are opened. Rather than pretend otherwise, the command lists the settings you changed that the running server cannot pick up, so you know a restart is still needed.
+
+```
+[LC] Reloaded config.yml, but some of the changes need a server restart to take effect.
+```
+
+The reply says only whether what you edited is in effect. Which settings moved is written to the server log.
+
+| | Applied by `/lc reload` | Needs a restart |
+|---|---|---|
+| `messageFormat.*` | Yes | — |
+| `features.*` | — | Yes |
+| `debug`, `checkForUpdates`, `language`, `userSettingsFilePath` | — | Yes |
+
+The command is available to the console and RCON as well as to players, and requires `lunaticchat.command.lc.reload` (op by default).
Boolean settings accept `true` / `false`, and also the `yes` / `no` / `on` / `off` spellings that Bukkit accepted historically, so a file written for an older release keeps working as it did.
@@ -22,6 +38,10 @@ A `config.yml` the plugin cannot use never stops the plugin from starting.
Check the server log after editing `config.yml`: a setting that quietly reverted to its default was reported there.
+`/lc reload` is stricter, because it has an option that startup does not — leaving the running configuration alone. It refuses the file rather than falling anything back to a default, naming every setting it could not read in one go, and the server keeps the configuration it already had. A file that holds no settings at all is refused for the same reason: a reload cannot tell a comments-only file apart from one caught halfway through being written.
+
+A misspelled **key** is still not detected, by either path — an unknown key is ignored so that a `config.yml` written for a newer build does not break an older one. When a reload finds nothing to apply, it says so rather than reporting success, which is the signal that a key may be misspelled.
+
## Global Settings
| Key | Type | Default | Description |
diff --git a/website/src/docs/developers/platform-paper.md b/website/src/docs/developers/platform-paper.md
index dbba4f1..2620c85 100644
--- a/website/src/docs/developers/platform-paper.md
+++ b/website/src/docs/developers/platform-paper.md
@@ -23,7 +23,7 @@ Features are assembled via manual DI, without an external DI framework. The key
The `onEnable` flow:
-1. `saveDefaultConfig()` → build `LunaticChatConfiguration` via `ConfigManager`
+1. `saveDefaultConfig()` → build `LunaticChatConfiguration` via `ConfigManager`, then create the `MessageFormatHolder` and the `ConfigurationReloader` over it
2. Initialize `HttpClient(CIO)` and `PluginCoroutineScope`
3. `ServiceInitializer.initialize()` → receive a `ServiceContainer`
4. Move services into the public properties used by commands
@@ -146,6 +146,9 @@ Channel state itself is managed by the `chat/channel` package.
- `ConfigManager` — deserializes `config.yml` into `LunaticChatConfiguration` with **KAML**, so each default lives in exactly one place: on the data class. It replaced a hand-written dotted-key mapper that repeated every default a second time, and they had already drifted — `checkForUpdates` disagreed with both `config.yml` and the data class, and the whole `messageLogging` block was documented but never read
- Failure is handled per setting, not per file: on a `YamlException` the offending key is pruned from the document and decoding is retried, so one unreadable value costs only itself. Only a document that is not YAML at all falls back to defaults wholesale, and neither case is allowed to throw out of `onEnable`
+- `ConfigManager.loadStrictly` — the reading `/lc reload` uses. It shares the pruning loop with `loadConfiguration` but reads the outcome the other way round: any setting that had to be pruned means the whole file is refused, with every unreadable setting named at once. A document holding no settings is refused too, because a reload cannot tell a comments-only file apart from one caught mid-write, and resetting every format over that is worse than doing nothing
+- `MessageFormatHolder` — the one part of the configuration that is live. Deliberately narrower than `LunaticChatConfiguration`: taking this type says the value can change under you, taking `LunaticChatConfiguration` says it was frozen at startup. A holder over the whole configuration would produce a tree matching no version of the file, since only `messageFormat` is ever swapped
+- `ConfigurationReloader` — re-reads the file and swaps the holder. It classifies every setting into applied (leaf by leaf, from `MessageFormatConfig`) or restart-required (block by block, riding on the data class `equals`), and a test over `memberProperties` fails when `config.yml` grows a setting neither table covers. The two lists are measured against different baselines: applied against the formats currently in effect, restart-required against the configuration the server actually started on. Nothing beyond `messageFormat` can be applied, because Paper registers commands only through its `COMMANDS` lifecycle event, Bukkit cannot unregister a listener, and the cache saver keeps no task handle to cancel
- `LenientBoolean` — a `Boolean` typealias with a serializer that still accepts `yes` / `no` / `on` / `off`. Bukkit read `config.yml` as YAML 1.1, where those are booleans; kaml reads YAML 1.2, where they are plain strings, and silently resetting them would have flipped `checkForUpdates: no` to its opposite default
- Feature defaults: `quickReplies=true`, `japaneseConversion=false`, `channelChat=false`, `velocityIntegration=false`
- Under `config/key`: `FeaturesConfig` / `ChannelChatFeatureConfig` / `JapaneseConversionFeatureConfig` / `VelocityIntegrationConfig` / `QuickRepliesFeatureConfig` / `MessageFormatConfig` / `ChannelMessageLoggingConfig`
diff --git a/website/src/docs/features/admin.md b/website/src/docs/features/admin.md
index 3f71dcc..531f2e0 100644
--- a/website/src/docs/features/admin.md
+++ b/website/src/docs/features/admin.md
@@ -22,6 +22,26 @@ Displayed information:
- Configuration values (debug mode, update checking, language)
- Links to GitHub, Modrinth, and documentation
+## Configuration Reload (`/lc reload`) <Badge type="tip" text="v1.4.0~" />
+
+Re-read `config.yml` without restarting the server.
+
+```
+/lc reload
+```
+
+Only the [`messageFormat`](/docs/reference/message-format) settings are applied. Everything else in `config.yml` decides something the plugin settles at startup, so the command lists the changed settings that still need a restart instead of pretending they took effect.
+
+```
+[LC] Reloaded config.yml, but some of the changes need a server restart to take effect.
+```
+
+The reply says only whether what you edited is in effect. Which settings moved is written to the server log.
+
+- **Permission**: `lunaticchat.command.lc.reload` (default: op). Usable from the console and RCON
+- A `config.yml` the plugin cannot read in full is refused: every unreadable setting is named at once and the running configuration is kept. This is stricter than startup, which falls a single unreadable setting back to its default so the server can come up
+- Every reload is written to the server log, so a format change can be dated later. The file is read off the main thread, and an RCON session closes before the reply reaches it, so RCON callers read the outcome from the log rather than from the command output
+
## Spy Mode
Players with the `lunaticchat.spy` permission (default: op) can view both the direct messages and the channel messages sent on the server.
diff --git a/website/src/docs/getting-started.md b/website/src/docs/getting-started.md
index 104e00d..186867c 100644
--- a/website/src/docs/getting-started.md
+++ b/website/src/docs/getting-started.md
@@ -34,7 +34,7 @@ Use `LunaticChat-<version>.jar` for Paper / Folia servers and `LunaticChat-<vers
1. Place the downloaded `LunaticChat-<version>.jar` into the server's `plugins/` directory
2. Start (or restart) the server
3. `plugins/LunaticChat/config.yml` will be generated automatically
-4. Modify the [configuration](/docs/configuration) as needed and restart the server
+4. Modify the [configuration](/docs/configuration) as needed, then run `/lc reload` or restart the server
### Velocity
diff --git a/website/src/docs/permissions.md b/website/src/docs/permissions.md
index caada8b..d55d895 100644
--- a/website/src/docs/permissions.md
+++ b/website/src/docs/permissions.md
@@ -48,3 +48,4 @@ The following permissions are granted to OPs only by default.
| `lunaticchat.noticeupdate` | op | Receive update notifications |
| `lunaticchat.channelbypass` | op | Bypass channel restrictions (kick/ban protection, force deletion) |
| `lunaticchat.command.lcv.status` | op | Use the `/lcv status` command |
+| `lunaticchat.command.lc.reload` | op | Use the `/lc reload` command |
diff --git a/website/src/docs/reference/commands.md b/website/src/docs/reference/commands.md
index 28627bc..50bcbe9 100644
--- a/website/src/docs/reference/commands.md
+++ b/website/src/docs/reference/commands.md
@@ -36,6 +36,14 @@ Displays the plugin version, health, enabled features, and configuration values.
- **Aliases**: `st`
- **Permission**: `lunaticchat.command.lc.status`
+### `/lc reload` <Badge type="tip" text="v1.4.0~" />
+
+Re-reads `config.yml` and applies the `messageFormat` settings, then reports which of the remaining changes still need a restart. See [Applying Changes](/docs/configuration#applying-changes).
+
+- **Permission**: `lunaticchat.command.lc.reload` (op by default)
+- **Usable from the console and RCON**
+- A `config.yml` that cannot be read in full is refused, and the running configuration is kept
+
### `/lc settings [key] [on|off]`
Views or changes your personal settings. Without arguments, displays the settings list.
diff --git a/website/src/docs/reference/message-format.md b/website/src/docs/reference/message-format.md
index 2669adb..68fee84 100644
--- a/website/src/docs/reference/message-format.md
+++ b/website/src/docs/reference/message-format.md
@@ -6,6 +6,8 @@ layout: doc
You can customize the display format of chat messages in the `messageFormat` section of `config.yml`.
+These are the only settings `/lc reload` <Badge type="tip" text="v1.4.0~" /> applies without a restart; every other section of `config.yml` is fixed when the server starts. See [Applying Changes](/docs/configuration#applying-changes).
+
## Placeholders
| Placeholder | Description | Available formats |
diff --git a/website/src/ja/docs/configuration.md b/website/src/ja/docs/configuration.md
index 3324940..a2ae86f 100644
--- a/website/src/ja/docs/configuration.md
+++ b/website/src/ja/docs/configuration.md
@@ -8,7 +8,23 @@ LunaticChat の設定は `plugins/LunaticChat/config.yml` で管理されますï
## 設定の反映
-リロードコマンドはありません.`config.yml` を編集したら**サーバーを再起動**してください.
+`/lc reload` <Badge type="tip" text="v1.4.0~" /> はサーバーの稼働中に `config.yml` を読み直します.反映されるのは [`messageFormat`](/ja/docs/reference/message-format) の設定のみです.
+
+ほかの設定は,どのサービスを構築するか・どのコマンドとリスナーを登録するか・どのファイルを開くかといった,プラグインの起動時に一度だけ決まる事柄を左右します.反映されたように見せかけることはせず,変更したもののうち稼働中のサーバーが取り込めない設定を一覧で表示するので,再起動が必要かどうかが分かります.
+
+```
+[LC] config.yml を再読み込みしましたが,一部の変更の適用にはサーバーの再起動が必要です.
+```
+
+応答は,編集した内容が反映されたかどうかだけを伝えます.どの設定が動いたかはサーバーログに記録されます.
+
+| | `/lc reload` で反映 | 再起動が必要 |
+|---|---|---|
+| `messageFormat.*` | はい | — |
+| `features.*` | — | はい |
+| `debug`, `checkForUpdates`, `language`, `userSettingsFilePath` | — | はい |
+
+このコマンドはプレイヤーのほかコンソール・RCON からも実行できます.`lunaticchat.command.lc.reload` (デフォルト: op) が必要です.
真偽値の設定は `true` / `false` のほか,Bukkit が従来受け付けていた `yes` / `no` / `on` / `off` の表記も使用できます.古いリリース向けに書かれたファイルもそのまま動作します.
@@ -22,6 +38,10 @@ LunaticChat の設定は `plugins/LunaticChat/config.yml` で管理されますï
`config.yml` を編集したあとはサーバーログを確認してください.デフォルトに戻された設定があれば,そこに報告されています.
+`/lc reload` はこれよりも厳格です.起動時にはない選択肢 — 稼働中の設定をそのまま使い続ける — を取れるためです.デフォルトへのフォールバックは行わずファイルごと拒否し,読み取れなかった設定をすべてまとめて表示します.サーバーは元の設定を保持したままです.設定を 1 つも含まないファイルも同じ理由で拒否されます.コメントのみのファイルと,書き込み途中のファイルを見分けられないためです.
+
+**キー名**のタイポは,どちらの経路でも検出されません.新しいビルド向けに書かれた `config.yml` が古いビルドで壊れないよう,未知のキーは無視されるためです.リロードで反映対象が 1 つも見つからなかった場合は,成功としてではなく「変更なし」として報告されます.これがキー名を疑う手がかりになります.
+
## グローバル設定
| キー | 型 | デフォルト | 説明 |
diff --git a/website/src/ja/docs/developers/platform-paper.md b/website/src/ja/docs/developers/platform-paper.md
index 26a9ad7..e291bcf 100644
--- a/website/src/ja/docs/developers/platform-paper.md
+++ b/website/src/ja/docs/developers/platform-paper.md
@@ -23,7 +23,7 @@ paper 側は「Bukkit / Folia という現実」を吸収するアダプタとã�
`onEnable` の流れは次の通りです.
-1. `saveDefaultConfig()` → `ConfigManager` で `LunaticChatConfiguration` を生成
+1. `saveDefaultConfig()` → `ConfigManager` で `LunaticChatConfiguration` を生成し,`MessageFormatHolder` と `ConfigurationReloader` を構築
2. `HttpClient(CIO)` と `PluginCoroutineScope` を初期化
3. `ServiceInitializer.initialize()` → `ServiceContainer` を受け取る
4. コマンドから使う公開プロパティへサービスを移し替え
@@ -146,6 +146,9 @@ config フラグ
- `ConfigManager` — `config.yml` を **KAML** で `LunaticChatConfiguration` にデシリアライズする.デフォルト値の定義箇所をデータクラス 1 箇所に限定するためで,以前のドット記法の手組みマッパーは同じデフォルトを二重に持っており,実際に乖離していた (`checkForUpdates` が `config.yml` とデータクラスの双方と食い違い,`messageLogging` ブロックはドキュメント化されていながら一度も読まれていなかった)
- 失敗はファイル単位ではなく設定単位で処理する.`YamlException` が出た場合は該当キーをドキュメントから取り除いてデコードを再試行するため,読めない値 1 つの影響はその値だけに留まる.全体をデフォルトに落とすのは「YAML として成立していない」場合だけで,いずれのケースも `onEnable` の外へ例外を投げない
+- `ConfigManager.loadStrictly` — `/lc reload` が使う読み取り経路.pruning ループは `loadConfiguration` と共有するが,結果の解釈が逆で,1 つでも pruning が発生した時点でファイル全体を拒否し,読み取れなかった設定をまとめて報告する.設定を含まないドキュメントも拒否する.コメントのみのファイルと書き込み途中のファイルを見分けられず,それを理由に全フォーマットをリセットするのは何もしないより悪いため
+- `MessageFormatHolder` — 設定のうち唯一実行時に差し替わる部分.`LunaticChatConfiguration` より意図的に狭く,この型を受け取ることが「値が変わりうる」,`LunaticChatConfiguration` を受け取ることが「起動時に凍結された」というシグナルになる.設定全体を holder に入れると,差し替わるのは `messageFormat` だけであるため,どのバージョンのファイルとも一致しないツリーができてしまう
+- `ConfigurationReloader` — ファイルを読み直して holder を差し替える.各設定を「適用済み」(`MessageFormatConfig` から leaf 単位) と「再起動が必要」(データクラスの `equals` に乗せた block 単位) に分類し,`memberProperties` を走査するテストが,どちらの表にも載っていない設定が `config.yml` に増えた時点で失敗する.2 つのリストは比較基準が異なり,適用済みは現在有効なフォーマットとの差分,再起動が必要は実際にサーバーが起動した設定との差分である.`messageFormat` 以外を適用できないのは,Paper がコマンドを `COMMANDS` ライフサイクルイベントでしか登録できず,Bukkit にリスナーの解除手段がなく,キャッシュ保存タスクがキャンセル用のハンドルを保持していないため
- `LenientBoolean` — `yes` / `no` / `on` / `off` も受け付けるシリアライザ付きの `Boolean` typealias.Bukkit は `config.yml` を YAML 1.1 として読んでいたためこれらは真偽値だったが,kaml が読む YAML 1.2 では単なる文字列であり,黙ってリセットすると `checkForUpdates: no` がデフォルトの逆の値に反転してしまう
- 機能デフォルト: `quickReplies=true`, `japaneseConversion=false`, `channelChat=false`, `velocityIntegration=false`
- `config/key` 以下に `FeaturesConfig` / `ChannelChatFeatureConfig` / `JapaneseConversionFeatureConfig` / `VelocityIntegrationConfig` / `QuickRepliesFeatureConfig` / `MessageFormatConfig` / `ChannelMessageLoggingConfig`
diff --git a/website/src/ja/docs/features/admin.md b/website/src/ja/docs/features/admin.md
index a29be09..f6c86b8 100644
--- a/website/src/ja/docs/features/admin.md
+++ b/website/src/ja/docs/features/admin.md
@@ -22,6 +22,26 @@ layout: doc
- 設定値 (デバッグモード,アップデート確認,言語)
- GitHub,Modrinth,ドキュメントへのリンク
+## 設定のリロード (`/lc reload`) <Badge type="tip" text="v1.4.0~" />
+
+サーバーを再起動せずに `config.yml` を読み直します.
+
+```
+/lc reload
+```
+
+反映されるのは [`messageFormat`](/ja/docs/reference/message-format) の設定のみです.`config.yml` のほかの設定はプラグインが起動時に確定させる事柄を左右するため,反映されたように見せかけることはせず,再起動が必要な変更を一覧で表示します.
+
+```
+[LC] config.yml を再読み込みしましたが,一部の変更の適用にはサーバーの再起動が必要です.
+```
+
+応答は,編集した内容が反映されたかどうかだけを伝えます.どの設定が動いたかはサーバーログに記録されます.
+
+- **パーミッション**: `lunaticchat.command.lc.reload` (デフォルト: op).コンソール・RCON からも実行可能
+- `config.yml` を完全に読み取れない場合は拒否されます.読み取れなかった設定をすべてまとめて表示し,稼働中の設定はそのまま維持されます.読み取れない設定を個別にデフォルトへフォールバックさせて起動を続行する起動時よりも厳格です
+- リロードはサーバーログにも記録されるため,フォーマットを変更した時期をあとから追跡できます.ファイルの読み取りはメインスレッド外で行われ,RCON セッションは応答が届く前に切断されるため,RCON から実行した場合の結果はコマンド出力ではなくログで確認します
+
## スパイモード
`lunaticchat.spy` パーミッション (デフォルト: op) を持つプレイヤーは,サーバー上で送信されるダイレクトメッセージとチャンネルメッセージの両方を閲覧できます.
diff --git a/website/src/ja/docs/getting-started.md b/website/src/ja/docs/getting-started.md
index 91f4e89..50bf812 100644
--- a/website/src/ja/docs/getting-started.md
+++ b/website/src/ja/docs/getting-started.md
@@ -34,7 +34,7 @@ Paper / Folia サーバーには `LunaticChat-<version>.jar` を,Velocity プã
1. ダウンロードした `LunaticChat-<version>.jar` をサーバーの `plugins/` ディレクトリに配置します
2. サーバーを起動 (または再起動) します
3. `plugins/LunaticChat/config.yml` が自動生成されます
-4. 必要に応じて[設定](/ja/docs/configuration)を変更し,サーバーを再起動します
+4. 必要に応じて[設定](/ja/docs/configuration)を変更し,`/lc reload` を実行するかサーバーを再起動します
### Velocity
diff --git a/website/src/ja/docs/permissions.md b/website/src/ja/docs/permissions.md
index b2726dd..05ca9cb 100644
--- a/website/src/ja/docs/permissions.md
+++ b/website/src/ja/docs/permissions.md
@@ -48,3 +48,4 @@ LunaticChat のすべてのパーミッションノードの一覧です.
| `lunaticchat.noticeupdate` | op | アップデート通知の受信 |
| `lunaticchat.channelbypass` | op | チャンネル制限のバイパス(キック・BAN 保護,強制削除) |
| `lunaticchat.command.lcv.status` | op | `/lcv status` コマンドの使用 |
+| `lunaticchat.command.lc.reload` | op | `/lc reload` コマンドの使用 |
diff --git a/website/src/ja/docs/reference/commands.md b/website/src/ja/docs/reference/commands.md
index 8102a75..6d34f1c 100644
--- a/website/src/ja/docs/reference/commands.md
+++ b/website/src/ja/docs/reference/commands.md
@@ -36,6 +36,14 @@ LunaticChat で使用できるすべてのコマンドのリファレンスでã�
- **エイリアス**: `st`
- **パーミッション**: `lunaticchat.command.lc.status`
+### `/lc reload` <Badge type="tip" text="v1.4.0~" />
+
+`config.yml` を読み直して `messageFormat` の設定を反映し,残りの変更のうち再起動が必要なものを報告します.[設定の反映](/ja/docs/configuration#設定の反映)を参照してください.
+
+- **パーミッション**: `lunaticchat.command.lc.reload` (デフォルト: op)
+- **コンソール・RCON からも実行可能**
+- `config.yml` を完全に読み取れない場合は拒否され,稼働中の設定がそのまま維持されます
+
### `/lc settings [key] [on|off]`
プレイヤー個人の設定を確認・変更します.引数なしで設定一覧を表示します.
diff --git a/website/src/ja/docs/reference/message-format.md b/website/src/ja/docs/reference/message-format.md
index 7ae42e9..3eddd1a 100644
--- a/website/src/ja/docs/reference/message-format.md
+++ b/website/src/ja/docs/reference/message-format.md
@@ -6,6 +6,8 @@ layout: doc
`config.yml` の `messageFormat` セクションで,チャットメッセージの表示形式をカスタマイズできます.
+`/lc reload` <Badge type="tip" text="v1.4.0~" /> が再起動なしで反映できるのはこれらの設定だけです.`config.yml` のほかのセクションはサーバー起動時に固定されます.[設定の反映](/ja/docs/configuration#設定の反映)を参照してください.
+
## プレースホルダー
| プレースホルダー | 説明 | 使用可能なフォーマット |