diff --git a/server/src/events/SendCard.ts b/server/src/events/SendCard.ts index 6947d5d..ddda9ad 100644 --- a/server/src/events/SendCard.ts +++ b/server/src/events/SendCard.ts @@ -20,8 +20,11 @@ export default (io: Server, socket: Socket, data: SendCard) => { // The writer is answering if (data.from === "writer") { - game.log.debug(` Writer selected question to answer.`); + game.log.debug(`Writer selected question to answer.`); + + // Draw new cards for team deck.discard(data.text); + team.addCardsToHand(game.questions.draw(conf.game.hand_size - team.hand.length)); team.selectQuestion(data.text); socket.emit(`UpdateHand`, { @@ -29,6 +32,11 @@ export default (io: Server, socket: Socket, data: SendCard) => { mode: "replace", questions: [] }); + io.to(`${game.id}:${team.id}:guesser`).emit(`UpdateHand`, { + status: 200, + mode: "replace", + questions: team.hand + }); return; } @@ -38,7 +46,6 @@ export default (io: Server, socket: Socket, data: SendCard) => { // Update the team's hand team.removeCard(data.text); - team.addCardsToHand(game.questions.draw(conf.game.hand_size - team.hand.length)); // send the question text to the writer player io.to(`${game.id}:${team.id}:writer`).emit(`UpdateHand`, {