diff --git a/src/game/game.controller.ts b/src/game/game.controller.ts index 6c28a04..30f6562 100644 --- a/src/game/game.controller.ts +++ b/src/game/game.controller.ts @@ -45,4 +45,10 @@ export class GameController { this.logger.warn(`[clearQueue] enter`); await this.gameService.clearGameQueue(); } + + @Post('simulate-valid-answer') + async simulateValidAnswer() { + this.logger.verbose(`[simulateValidAnswer] enter`); + return await this.gameService.simulateValidAnswer(); + } } diff --git a/src/game/game.service.ts b/src/game/game.service.ts index ae416d3..0092070 100644 --- a/src/game/game.service.ts +++ b/src/game/game.service.ts @@ -10,6 +10,8 @@ import {ConfigService} from "@nestjs/config"; import {gameCards} from "./entities/cards.entities"; import {IEmptyNotification} from "../Consts/types"; import {ClientNotificationType} from "../socket/socket.gateway"; +import {GetGuestQuery} from "../guests/queries/getguest.query"; +import {ValidAnswerReceivedEvent} from "./events/valid-answer.recieved"; @Injectable() export class GameService implements OnApplicationBootstrap{ @@ -110,4 +112,8 @@ export class GameService implements OnApplicationBootstrap{ await this.gameQueueModel.deleteMany({}).exec(); return { result: true }; } + + async simulateValidAnswer() { + this.eventBus.publish(new ValidAnswerReceivedEvent(11178819, 'test', '')); + } }