re-implement binrect protocol

pretty easy since we can just subclass guac
This commit is contained in:
modeco80
2024-08-21 22:18:11 -04:00
parent 6e1a075194
commit 4583531fce
5 changed files with 69 additions and 18 deletions

View File

@@ -1,6 +1,16 @@
import * as msgpack from 'msgpackr';
import { CollabVMProtocolMessage, CollabVMProtocolMessageType } from '@cvmts/collab-vm-1.2-binary-protocol';
import { GuacamoleProtocol } from './GuacamoleProtocol.js';
// TODO: reimplement binrects protocol
// we can just create/proxy a GuacamoleProtocol manually,
// and for the rects do our own thing
import { ScreenRect } from './Protocol';
export class BinRectsProtocol extends GuacamoleProtocol {
sendScreenUpdate(rect: ScreenRect): void {
let bmsg: CollabVMProtocolMessage = {
type: CollabVMProtocolMessageType.rect,
rect: rect
};
this.user?.socket.sendBinary(msgpack.encode(bmsg));
}
}