Make all guac messages fire an event as opposed to unhandled ones, to make scripting easier

This commit is contained in:
elijahr2411 2023-01-29 19:55:25 -05:00
parent d5bd23d5db
commit 65ac88f771

View file

@ -120,6 +120,7 @@ class CollabVMClient {
}
async #onMessage(event) {
var msgArr = guacutils.decode(event.data);
window.cvmEvents.emit(msgArr[0], msgArr.slice(1));
switch (msgArr[0]) {
case "nop":
this.socket.send("3.nop;");
@ -364,9 +365,6 @@ class CollabVMClient {
qemuMonitorOutput.scrollTop = qemuMonitorOutput.scrollHeight;
break;
}
break;
default:
window.cvmEvents.emit(msgArr[0], msgArr.slice(1));
break;
}
}