Port globalChat to new plugin system

Port the globalChat plugin to the new plugin system.  Since there's no
config system yet the config options for it is removed.
This commit is contained in:
Hornwitser committed 2019-12-14 17:51:54 +01:00
1 parent bcceae687f
commit b71c392b32
10 files changed
+199 -70

No files matched your search

+24 -2
View File
@@ -1,5 +1,7 @@
const events = require("events");
const link = require("lib/link");
class MockSocket {
constructor() {
@@ -23,7 +25,7 @@ class MockSocket {
close() {
this.closeCalled = true;
}
};
}
class MockConnector extends events.EventEmitter {
constructor() {
@@ -50,9 +52,29 @@ class MockConnector extends events.EventEmitter {
disconnect() {
this.disconnectCalled = true;
}
};
}
class MockServer {
constructor() {
this.rconCommands = [];
}
async sendRcon(command) {
this.rconCommands.push(command);
}
}
class MockInstance extends link.Link {
constructor() {
super('instance', 'slave', new MockConnector());
this.server = new MockServer();
this.name = "test";
}
}
module.exports = {
MockSocket,
MockConnector,
MockInstance,
};