im really downhearted, i cant solve this, im trying it since days, im developing a game (tic tac toe) it has multiplayer feature using nodeJS, also the problem is not the game, the problem is handling different rooms...
Im using socket.join etc, so user can join different room; to join different games also boards i pass through url game name, example:
localhost?gameId=test
Then i parse this name and start sending board to these users. Also the problem is, when i have more then one more, the game collapses, also the board info from room 1 collapse with room 2... i cant find the error, i paste the code here:
Create.html jsfiddle.net/svaae1vL/
Enter.html jsfiddle.net/6qzbpbxx/
Server.js jsfiddle.net/1q0qo8xo/
Like i sayd before, the problem is:
room1: player1, player2 room2: player3, player4
room1:
[x,o,x]
[0, 0, 0]
[x,x,x]
room2:
[x,o,x]
[0, 0, 0]
[x,x,x]
Also when i click in room1, it affects room2, please help im stuck since days...