mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
Add onMasterConfigFieldChanged hook
Add hook for master plugin code to react to the master config changing.
This commit is contained in:
1 parent
a979c0cfac
commit
68b8ac6b8c
3 files changed
+18
No files matched your search
@@ -162,6 +162,9 @@ class Master {
|
||||
this.userManager = new UserManager(this.config);
|
||||
await this.userManager.load(path.join(databaseDirectory, "users.json"));
|
||||
|
||||
this.config.on("fieldChanged", (group, field, prev) => {
|
||||
libPlugin.invokeHook(this.plugins, "onMasterConfigFieldChanged", group, field, prev);
|
||||
});
|
||||
for (let instance of this.instances.values()) {
|
||||
this.addInstanceHooks(instance);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user