I don't know what is the correct way to solve the following problem:
Here how I solved the problem:
So far it works, but I don't know if it's healthy for a signalling server. May be there's a better way to do it? And what will happen, if like 100 players use this auto join logic?
This will get slower and slower as more players join the game. Imagine having 1000 active games: a newly joining player must try to join 1000 rooms before they find a free one! This would probably take several seconds and waste time on the signalling server.
I'll add an 'Auto join room' feature at some point, which will allow the signalling server to quickly identify free rooms and send you to the right one straight away.
Develop games in your browser. Powerful, performant & highly capable.