sparshg / battleship

Classic battleship game, two-player, online, deployed.
http://sparshg.dev/battleship/
MIT License
2 stars 5 forks source link

Can't join if new game created #6

Open sparshg opened 4 days ago

sparshg commented 4 days ago

Because the backend registers the player in newly created room, can't join unless player leaves this room. Don't show join button if in a created room

ychavoya commented 2 days ago

Hi, I am interested in working on this issue, I am guessing this section would disappear:

Should it be replaced by something else? Maybe a text specifying that you should provide the code to your opponent so you can start the game, what do you think?

sparshg commented 2 days ago

Yep, I can think of 2 solutions

  1. hide join button and show the disconnect button instead of join button? with some share this room code text.
  2. The other way is to actually disconnect the player automatically if user has enetered a 4 digit code (not equal to generated room code) when join button is clicked. Then join the room with entered code instead.

Both approaches seem fine to me, you can implementing the one you like