6698bc0 addresses relative pathing to be more consistent with express on the server side, which is minor and not an essential part of this PR at all.
7232600 adds a test to catch some cases where a player is not defined, addressing #1
bef9ae4 is the bigger commit in this, and it adds named rooms based on the URL from which the client accesses the game (addressing a to-do in your readme which doesn't have a corresponding issue). If the client accesses the root directory, the server throws them into a random 5-character room (e.g. /ab123). If they access an alphanumeric URL with a base path of any length (e.g. /ab123 or /mycustomroom) directly, they'll be put in the appropriate room.
The rooms themselves are implemented using socket.io's "room" feature, and work by means of the client emitting a join-room on establishing a connection. The server creates a new gameroom object as necessary (and destroys it when it's no longer needed) to manage gameplay in individual rooms.
I tried to stick to your formatting and coding style where I could, but let me know if anything looks amiss! Sorry about the whitespace garbage in the commits, my text editor was apparently hungry!
6698bc0 addresses relative pathing to be more consistent with express on the server side, which is minor and not an essential part of this PR at all.
7232600 adds a test to catch some cases where a player is not defined, addressing #1
bef9ae4 is the bigger commit in this, and it adds named rooms based on the URL from which the client accesses the game (addressing a to-do in your readme which doesn't have a corresponding issue). If the client accesses the root directory, the server throws them into a random 5-character room (e.g.
/ab123
). If they access an alphanumeric URL with a base path of any length (e.g./ab123
or/mycustomroom
) directly, they'll be put in the appropriate room.The rooms themselves are implemented using socket.io's "room" feature, and work by means of the client emitting a
join-room
on establishing a connection. The server creates a newgameroom
object as necessary (and destroys it when it's no longer needed) to manage gameplay in individual rooms.I tried to stick to your formatting and coding style where I could, but let me know if anything looks amiss! Sorry about the whitespace garbage in the commits, my text editor was apparently hungry!