From f08d4d8f0557581d93063cd9f6e750ab3ac9cc17 Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Mon, 10 Aug 2026 08:31:20 +0900 Subject: feat(paper): add /lc reload to apply message formats without a restart Changing a message format meant taking the server down, because config.yml was read once in onEnable and every consumer held the value it was built with. Operators tune these formats far more often than anything else in the file, and a restart is a disproportionate price for a colour code. Only messageFormat is applied. The rest of config.yml settles things once, at startup - which services exist, which commands and listeners are registered, which files are opened - and none of that can be redone while the server runs: Paper registers commands only through its COMMANDS lifecycle event, Bukkit cannot unregister a listener, and the conversion cache saver keeps no task handle to cancel. Rebuilding the services would leave the old ones still wired up, so a changed setting the server cannot pick up is reported back as needing a restart rather than silently ignored. MessageFormatHolder is deliberately narrower than LunaticChatConfiguration: taking it says the value is live, taking the configuration says it was frozen at startup. A holder over the whole tree would hold a configuration matching no version of the file, since only messageFormat is ever swapped. Reload reads config.yml more strictly than startup does, because it has an option startup does not - leaving the running configuration alone. Startup falls a single unreadable setting back to its default so the server can come up; reload refuses the file, names every unreadable setting at once, and keeps what the server already had. A document holding no settings is refused for the same reason: it cannot be told apart from a config.yml caught halfway through being written, and resetting every format over that is worse than doing nothing. Closes #266 Co-Authored-By: Claude --- website/src/docs/features/admin.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'website/src/docs/features') diff --git a/website/src/docs/features/admin.md b/website/src/docs/features/admin.md index 3f71dcc..dc49e56 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`) + +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. +[LC] Applied: messageFormat.directMessageFormat +[LC] Restart the server to apply: features.channelChat +``` + +- **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. -- cgit v1.2.1 From 4a5570973319d992f21ed01ab20e8dc9fa721d81 Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Mon, 10 Aug 2026 18:18:16 +0900 Subject: feat(paper): report /lc reload as a single-line result The reply listed every setting that had moved and every setting that still needed a restart, as dotted keys. That buried the one bit that changes what the operator does next - whether they have to restart - under names they had just typed themselves and did not need read back to them. The detail is not lost: which settings moved was already written to the server log on every reload, which is the better home for it anyway, since a format change can be dated there long after the chat line has scrolled away. A pending restart now outranks "nothing changed" even when nothing could be applied. Reporting no change to someone who did edit the file would send them hunting for a typo they had not made. The failure path still names each unreadable setting and the reason it was rejected, because that is a list the operator cannot reconstruct and needs in order to fix the file. --- website/src/docs/features/admin.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'website/src/docs/features') diff --git a/website/src/docs/features/admin.md b/website/src/docs/features/admin.md index dc49e56..531f2e0 100644 --- a/website/src/docs/features/admin.md +++ b/website/src/docs/features/admin.md @@ -33,11 +33,11 @@ Re-read `config.yml` without restarting the server. 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. -[LC] Applied: messageFormat.directMessageFormat -[LC] Restart the server to apply: features.channelChat +[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 -- cgit v1.2.1