Warn on unhandled Factorio ipc

Send warning to console if an ipc message is received but there were no
handlers registered to handle it.
This commit is contained in:
Hornwitser committed 2020-04-03 20:51:28 +02:00
1 parent c2df80a17f
commit 3ff5e630ca
1 file changed
+3 -1
+3 -1
View File
@@ -505,7 +505,9 @@ class FactorioServer extends events.EventEmitter {
throw new Error(`Unknown IPC type '${type}'`);
}
this.emit(`ipc-${channel}`, content);
if (!this.emit(`ipc-${channel}`, content)) {
console.warn(`Warning: Unhandled ipc-${channel}`, content);
}
}
_handleOutput(line, source) {