hugosaintemarie / magic-maze

Online version of board game "Magic Maze"
https://magicmaze.herokuapp.com
MIT License
20 stars 11 forks source link

Player name is incorrect if entered in multiple places #48

Closed rcjsuen closed 3 years ago

rcjsuen commented 3 years ago
  1. Player 1 starts a game.
  2. Player 2 opens the website and sees player 1's game.
  3. Enter in a nickname in player 1's game.
  4. Click on "Create room" to create another game.
  5. Fill in a room name and a different nickname in the other room.
  6. Player 2 starts the new game.
  7. Notice that player 2's name is the first nickname (for player 1's game) instead of the different nickname in player 2's own game.
rcjsuen commented 3 years ago

https://github.com/ashugeo/magic-maze/blob/413f9e39682fbd7415fa6f4ac176733f72d07d90/src/client/home/js/main.js#L55-L58

The current logic also means that if a room exists you cannot create another room because name will be the empty string here since it's reading the input element from the other room. :(

rcjsuen commented 3 years ago

I've opened #70 to address this bug.