mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
remoteCommands added plugin and master API endpoint for executing things
This commit is contained in:
1 parent
be49deb170
commit
43c1f2ae93
7 files changed
+108
-8
No files matched your search
@@ -445,7 +445,7 @@ function instanceManagement() {
|
||||
global.subscribedFiles = {};
|
||||
}
|
||||
if(pluginConfig.binary == "nodePackage"){
|
||||
// require index.js.main() of plugin and execute it as a function
|
||||
// require index.js.main() of plugin and execute it as a class
|
||||
let pluginClass = require("./sharedPlugins/" + pluginDirectories[I] + "/index.js");
|
||||
plugins[I] = new pluginClass(combinedConfig, function(data){
|
||||
if(data.toString('utf8')[0] != "/") {
|
||||
@@ -453,6 +453,8 @@ function instanceManagement() {
|
||||
} else {
|
||||
messageInterface(data.toString('utf8'));
|
||||
}
|
||||
}, { // extra functions to pass in object. Should have done it like this from the start, but won't break backwards compat.
|
||||
socket, // socket.io connection to master (and ES6 destructuring, yay)
|
||||
});
|
||||
if(pluginConfig.scriptOutputFileSubscription && typeof pluginConfig.scriptOutputFileSubscription == "string"){
|
||||
if(global.subscribedFiles[pluginConfig.scriptOutputFileSubscription]) {
|
||||
|
||||
Reference in new issue
Block a user