WIP - POC

This commit is contained in:
Philipinho
2026-01-17 13:24:54 +00:00
parent 5c9eed53c0
commit a4750bff56
6 changed files with 1605 additions and 11 deletions
+11 -7
View File
@@ -1,4 +1,5 @@
import {
ConnectedSocket,
MessageBody,
OnGatewayConnection,
OnGatewayDisconnect,
@@ -76,7 +77,7 @@ export class WsGateway
@SubscribeMessage('join-room')
async handleJoinRoom(
client: Socket,
@ConnectedSocket() client: Socket,
@MessageBody() roomId: string,
): Promise<void> {
await this.excalidrawCollabService.handleJoinRoom(
@@ -87,14 +88,17 @@ export class WsGateway
}
@SubscribeMessage('leave-room')
handleLeaveRoom(client: Socket, @MessageBody() roomName: string): void {
handleLeaveRoom(
@ConnectedSocket() client: Socket,
@MessageBody() roomName: string,
): void {
client.leave(roomName);
}
@SubscribeMessage('server-broadcast')
handleServerBroadcast(
client: Socket,
[roomId, encryptedData, iv]: [string, ArrayBuffer, Uint8Array],
@ConnectedSocket() client: Socket,
@MessageBody() [roomId, encryptedData, iv]: [string, ArrayBuffer, Uint8Array],
): void {
this.excalidrawCollabService.handleServerBroadcast(
client,
@@ -106,8 +110,8 @@ export class WsGateway
@SubscribeMessage('server-volatile-broadcast')
handleServerVolatileBroadcast(
client: Socket,
[roomId, encryptedData, iv]: [string, ArrayBuffer, Uint8Array],
@ConnectedSocket() client: Socket,
@MessageBody() [roomId, encryptedData, iv]: [string, ArrayBuffer, Uint8Array],
): void {
this.excalidrawCollabService.handleServerVolatileBroadcast(
client,
@@ -119,7 +123,7 @@ export class WsGateway
@SubscribeMessage('user-follow')
async handleUserFollow(
client: Socket,
@ConnectedSocket() client: Socket,
@MessageBody() payload: ExcalidrawFollowPayload,
): Promise<void> {
await this.excalidrawCollabService.handleUserFollow(