ConfigurationReloader

class ConfigurationReloader(configManager: ConfigManager, startupConfiguration: LunaticChatConfiguration, messageFormatHolder: MessageFormatHolder, debugState: DebugState, logger: Logger, readConfigFile: () -> String)(source)

Re-reads config.yml and applies what can be applied without restarting the server.

Only MessageFormatConfig and the debug switch are applied. Everything else in config.yml decides something that is settled once, at startup: which services exist, which commands and listeners are registered, which files are opened. Paper registers commands only through its COMMANDS lifecycle event, Bukkit offers no way to unregister a listener that was registered for a plugin, and the cache saver retains no task handle to cancel - so rebuilding the services would leave the old ones still wired up. Rather than pretend, a changed setting the server cannot pick up is reported back to the operator as needing a restart.

Constructors

Link copied to clipboard
constructor(configManager: ConfigManager, startupConfiguration: LunaticChatConfiguration, messageFormatHolder: MessageFormatHolder, debugState: DebugState, logger: Logger, readConfigFile: () -> String)

Functions

Link copied to clipboard

Reads config.yml and applies the message formats, leaving the running configuration untouched when the file cannot be read in full.