Closed mattgallagher92 closed 3 years ago
I plan to use four-letter codes like netgames.io. Seems to work for them and I'm sure they get much more traffic than I expect to (I expect a maximum of one room at a time!). I don't expect the lack of password to be a problem.
Once a room has been created:
I decided to go with asking for a player's name when they click to create a room. This is consistent with netgames.io.
In 437010cf92097303ff8e06aa838862ecf4c39e57, I made a change to not modify a User
record unless the user clicks the submit button, rather than modifying it as they enter text in a form. This seems more natural to me, but does add some complexity, which might not be worth it.
It also leads to some coupling between the part of the update
function handling the CreateRoom
Msg
and the UsernamePage
Page
, because form validation is handled in that part of the update function. I could reduce the coupling by, for example, introducing a new SubmitNameInput
Msg
, whose corresponding part of the update
function handles validation, and sends on an appropriate command if the input is valid. I'll try that next.
Once that change is made, it's worth considering whether the delay of modification to the User
record has made things simlper or more complex.
I like the new changes. I think they simplify things by avoiding mixing concerns, so I'm going to keep them.
As a player I want to create a room So that I only play with people I know