I'm working on a multiplayer board game on Node.js/Socket.IO. The flow is the following :
- user enters his name and is added to the lobby
- user select a room and is added to it, then game starts when he is joined by another user.
This part is petty easy and I've done it before. However, I now need the user to be able to join multiple game rooms at the same time. pages are dynamically generated by express, and there's no issue opening many game pages, but I'm struggling with the socket implementation.
- Can I use a single socket for multiple rooms (for the same user) or do I have to create a new socket per room?
- I'd like the user to always be able to chat within the lobby while in game. How do I sort that out?
Thanks