Sunday, 19 July 2020

What is the best way to set an interval to send messages to all sockets in a room? [Node/SocketIO/React]

I am making a game with a room structure. Within each room, there will be time-related rounds, so I believe that I should emit a message to all players after some time showing that the round has ended and that another one will begin. However, I think that setting an interval on the server to do this should not be the most efficient way, I don't know. But setting an interval on the client also doesn't seem like a good alternative, since any player can leave or enter at any time. Any suggestions for the best way to do this?

Submitted July 19, 2020 at 10:50AM by queixume

No comments:

Post a Comment