Refactor out config injection in modManager

Change config in modManager to be passed to each individual functions
instead of requiring it be present at load time.
This commit is contained in:
Hornwitser committed 2019-09-16 16:04:08 +02:00
1 parent 5f33cf4d3b
commit a783bd9651
3 files changed
+244 -240

No files matched your search

+2 -2
View File
@@ -10,7 +10,7 @@ module.exports = class remoteCommands {
this.config = mergedConfig;
this.socket = extras.socket;
const pluginManager = require("lib/manager/pluginManager.js");
// const modManager = require("lib/manager/modManager.js")(this.config);
// const modManager = require("lib/manager/modManager");
this.socket.on("hello", () => {
this.socket.emit("registerServerManager");
});
@@ -19,7 +19,7 @@ module.exports = class remoteCommands {
});
this.socket.on("serverManagerGetMods", async (data, callback) => {
// TODO: Implement this function separately from listMods (which console.logs it)
// let mods = modManager.getMods()
// let mods = modManager.getMods(this.config)
// callback(mods);
});
this.socket.on("serverManagerGetPlugins", async (data, callback) => {