mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-13 23:14:53 +09:00
Remove the unused and badly behaved getCommand and getLua functions from clusterTools. The main issue with these is that encourage the use of large commands that have negative impact on the performance of the servers, as such large commands have to be transmitted to all players that are connected. These functions also have poor handling of lua comments and will fail on strings containing for example "--".
35 lines
1.3 KiB
JavaScript
35 lines
1.3 KiB
JavaScript
const needle = require("needle");
|
|
const fs = require("fs-extra");
|
|
|
|
const pluginConfig = require("./config");
|
|
|
|
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");
|
|
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(this.config)
|
|
// 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 */));
|
|
});
|
|
}
|
|
}
|