summaryrefslogtreecommitdiff
path: root/website/src/docs/features
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-08-10 08:31:20 +0900
committerSho Sakuma <me@m1sk9.dev>2026-08-10 08:31:20 +0900
commitf08d4d8f0557581d93063cd9f6e750ab3ac9cc17 (patch)
tree52c3bc1fbd6c0012edd3b1239f58d262e1a4e23d /website/src/docs/features
parentf52d13819e431af39e5a8c9be178307261a12d19 (diff)
downloadLunaticChat-f08d4d8f0557581d93063cd9f6e750ab3ac9cc17.tar.gz
LunaticChat-f08d4d8f0557581d93063cd9f6e750ab3ac9cc17.tar.bz2
LunaticChat-f08d4d8f0557581d93063cd9f6e750ab3ac9cc17.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'website/src/docs/features')
-rw-r--r--website/src/docs/features/admin.md20
1 files changed, 20 insertions, 0 deletions
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`) <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.
+[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.