I have 2 players in a multiplayer quiz.
Each client has true answers and false answers.
True answers : socket.true
False answers : socket.false
I'm increasing each variables answer by answer and finally, after 5 answers, i'm calling finishgame function.
I want to send a data that contains count of true answers and false answers to each client in finishgame
function.
How can I do this ?
If I use socket.emit
or socket.broadcast.to(socket.room).emit
it sends only one socket's data.
For example :
Send joe -> joe has 3 true , 2false answers;
Send tim -> tim has 1 true , 4 false answers.
But it doesn't happen.