From 244aa337659b79443a130802b7fec3c2a0242225 Mon Sep 17 00:00:00 2001 From: Ungs Date: Sun, 24 Nov 2024 13:59:06 +0900 Subject: [PATCH] feat : emoticon --- src/socket/socket.gateway.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/socket/socket.gateway.ts b/src/socket/socket.gateway.ts index 01fe1e4..341e269 100644 --- a/src/socket/socket.gateway.ts +++ b/src/socket/socket.gateway.ts @@ -28,6 +28,12 @@ interface Chat { success?: boolean; } +interface Emoticon { + emoticonId: string; + userId: string; + roomId: string; +} + export class Game { constructor() { this.host = ''; // 호스트 @@ -403,6 +409,13 @@ export class SocketGateway } } + // Emoticon + @SubscribeMessage('emoticon') + handleEmoticon(@MessageBody() data: Emoticon) { + console.log('emoticon'); + this.server.to(data.roomId).emit('emoticon', data); + } + // 게임 방 생성 @SubscribeMessage('createRoom') async handleCreate(