Skip to content

Commit

Permalink
feat : emoticon
Browse files Browse the repository at this point in the history
  • Loading branch information
iqeq1945 committed Nov 24, 2024
1 parent fa3cdfb commit 244aa33
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/socket/socket.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ interface Chat {
success?: boolean;
}

interface Emoticon {
emoticonId: string;
userId: string;
roomId: string;
}

export class Game {
constructor() {
this.host = ''; // 호스트
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 244aa33

Please sign in to comment.