mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-16 23:30:41 +09:00
Add connection events for control connections
Add hooks for plugins to be able to handle connection state changes for control connections on the master server and in the web interface.
This commit is contained in:
1 parent
de629d9416
commit
0a6e26bb2d
3 files changed
+89
No files matched your search
@@ -73,6 +73,14 @@ export class Control extends libLink.Link {
|
||||
this.connector.on("close", () => {
|
||||
this.accountName = null;
|
||||
});
|
||||
|
||||
for (let event of ["connect", "drop", "resume", "close"]) {
|
||||
this.connector.on(event, () => {
|
||||
for (let plugin of this.plugins.values()) {
|
||||
plugin.onMasterConnectionEvent(event);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async logMessageEventHandler(message) {
|
||||
|
||||
Reference in new issue
Block a user