Skip to content

Commit

Permalink
Merge pull request #101 from Wakttu/dev
Browse files Browse the repository at this point in the history
Fix : Error logic
  • Loading branch information
iqeq1945 authored Dec 3, 2024
2 parents 97832a4 + a1be2ac commit a023435
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/socket/socket.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -728,11 +728,12 @@ export class SocketGateway
@SubscribeMessage('start')
async handleStart(@MessageBody() roomId: string) {
try {
const roomInfo = await this.socketService.setStart(roomId, true);
this.roomInfo[roomId] = await this.socketService.setStart(roomId, true);
this.game[roomId].users = [];
this.server
.to(roomId)
.emit('start', { roomInfo, game: this.game[roomId] });
this.server.to(roomId).emit('start', {
roomInfo: this.roomInfo[roomId],
game: this.game[roomId],
});
} catch (error) {
this.logger.error(`Start game error - Room: ${roomId}`, error.stack);
this.server
Expand Down
10 changes: 8 additions & 2 deletions src/wakgames/wakgames.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ export class WakgamesService extends WakGames {

private readonly typeHandlers = new Map<string, (word: WordData) => string[]>(
[
['WOO', () => ['WOO-1']],
[
'WOO',
(word) => [
'WOO-1',
...(word.id === '신세계의신이되는거다' ? ['WOO-2'] : []),
],
],
['INE', (word) => ['INE-1', ...(word.id === '오야' ? ['INE-2'] : [])]],
[
'JINGBURGER',
Expand Down Expand Up @@ -164,7 +170,7 @@ export class WakgamesService extends WakGames {
[
'GOMEM',
(word) => [
...(word.meta?.tag.includes('고멤') ? ['GOM-1'] : []),
...(word.meta?.tag.includes('클래식') ? ['GOM-1'] : []),
...(word.meta?.tag.includes('아카데미') ? ['GOM-2'] : []),
],
],
Expand Down

0 comments on commit a023435

Please sign in to comment.