mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-15 23:24:52 +09:00
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:
1 parent
bcceae687f
commit
b71c392b32
10 files changed
+199
-70
No files matched your search
+24
-2
@@ -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,
|
||||
};
|
||||
Reference in new issue
Block a user