BananiumLabs / AtomBlast.io

Multiplayer arena game which takes place at the molecular level.
MIT License
1 stars 0 forks source link

Previously Connected Players Not Created #4

Closed 64bitpandas closed 6 years ago

64bitpandas commented 6 years ago

From @DarkFlamex1 on July 2, 2018 19:9

This issue was discovered during a fix for the disconnect.

Some information regarding the issue is stated below. Also the images were taken after both players joined the room.

This player is the first person to join the room(Image below): image Notice how the chat shows that the 2nd player has joined the room...

This player is the second player to join the room(Image Below): image

The second player works fine but cannot see the third player.

This is the third player to join the room: image

And so on....

The related code snippet regarding this issue is:

// Does not exist - need to create new player
else if (isSetup && (players[socket.id] === undefined || players[socket.id] === null)){
      console.log("Create a player");
      players[player] = createPlayer(pl);
}

The snippet is located in app.js from lines 175 to 180.

Both statements in this OR statement return false (players[socket.id] === undefined || players[socket.id] === null) for the player who joined before.

Copied from original issue: dbqeo/AtomBlast.io#4