Files
factorio-clusterio/sharedPlugins/serverManager/index.js
T
Hornwitser 5f33cf4d3b Remove config management
Remove lib/manager/configManager.js and the config management command
line interface as well as the serverManager's web interface for config
management.  The configuration rewrite will work differently and is not
compatible with configManager.js.
2019-09-16 16:04:08 +02:00

36 lines
1.3 KiB
JavaScript

const needle = require("needle");
const fs = require("fs-extra");
const pluginConfig = require("./config");
const COMPRESS_LUA = false;
module.exports = class remoteCommands {
constructor(mergedConfig, messageInterface, extras){
this.messageInterface = messageInterface;
this.config = mergedConfig;
this.socket = extras.socket;
const pluginManager = require("lib/manager/pluginManager.js");
// const modManager = require("lib/manager/modManager.js")(this.config);
this.socket.on("hello", () => {
this.socket.emit("registerServerManager");
});
this.socket.on("serverManagerGetStatus", async data => {
});
this.socket.on("serverManagerGetMods", async (data, callback) => {
// TODO: Implement this function separately from listMods (which console.logs it)
// let mods = modManager.getMods()
// callback(mods);
});
this.socket.on("serverManagerGetPlugins", async (data, callback) => {
callback(await pluginManager.getPlugins());
});
this.socket.on("serverManagerEnablePlugin", async (data, callback) => {
callback(await pluginManager.enablePlugin(data.name, data.instanceID /* Currently ignored */));
});
this.socket.on("serverManagerDisablePlugin", async (data, callback) => {
callback(await pluginManager.disablePlugin(data.name, data.instanceID /* Currently ignored */));
});
}
}