mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Add debug-dump-ws command
Add debug command to dump the WebSocket messages being sent and received by the master server to aid in finding chatty events.
This commit is contained in:
1 parent
61d92a6910
commit
2c855a5846
4 files changed
+56
-1
No files matched your search
@@ -310,6 +310,14 @@ commands.push(new Command({
|
||||
},
|
||||
}));
|
||||
|
||||
commands.push(new Command({
|
||||
definition: ["debug-dump-ws", "Dump WebSocket messages sent and received by master", (yargs) => { }],
|
||||
handler: async function(args, control) {
|
||||
await link.messages.debugDumpWs.send(control);
|
||||
return new Promise(() => {});
|
||||
},
|
||||
}));
|
||||
|
||||
// Convert to mapping from name to command instance
|
||||
commands = new Map([...commands.map(command => [command.name, command])]);
|
||||
|
||||
@@ -352,6 +360,10 @@ class Control extends link.Link {
|
||||
console.log(formatOutputColored(output));
|
||||
}
|
||||
|
||||
async debugWsMessageEventHandler(message) {
|
||||
console.log("WS", message.data.direction, message.data.content);
|
||||
}
|
||||
|
||||
async shutdown() {
|
||||
this.connector.setTimeout(30);
|
||||
|
||||
|
||||
Reference in new issue
Block a user