mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 07:33:12 +09:00
Add control reference to web plugins
Add reference to the Control instance in BaseWebPlugin for web plugin code to use in a similar manner to the instance reference in instance plugin code.
This commit is contained in:
1 parent
0a6e26bb2d
commit
6c19145734
2 files changed
+8
No files matched your search
@@ -514,6 +514,13 @@ class BaseWebPlugin {
|
|||||||
*/
|
*/
|
||||||
this.info = info;
|
this.info = info;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Control link to the master server, not available until the
|
||||||
|
* connect event in onMasterConnectionEvent is signaled.
|
||||||
|
* @type {?module:lib/link.Link}
|
||||||
|
*/
|
||||||
|
this.control = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logger for this plugin
|
* Logger for this plugin
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ export class Control extends libLink.Link {
|
|||||||
*/
|
*/
|
||||||
this.plugins = plugins;
|
this.plugins = plugins;
|
||||||
for (let plugin of plugins.values()) {
|
for (let plugin of plugins.values()) {
|
||||||
|
plugin.control = this;
|
||||||
libPlugin.attachPluginMessages(this, plugin);
|
libPlugin.attachPluginMessages(this, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user