When users connect (or reload the page), show a permalink to that session's games as well as a permalink to their entire play history, if they haven't opted out of that tracking. When a game starts, or a player/specator joins a game in progress, show a permalink to that game's rounds.
The "when a game starts" bit required removing the tracking of the 'dealing' state, as there was no other easy way to determine that a game was starting. Nothing actually used that dealing state, so it was harmless to remove. Now, a transition from lobby to playing can be detected as a game start, as opposed to a transition from round over to playing.
This is done with even more dumb on-resize handling. Tested lightly in Chrome, Edge, and IE, and it seemed to work well enough.
Helps #93, though I don't want to use the f-word just yet.
Cleaned up some synchronization around ConnectedUsers.users while I was in there. The list itself wasn't synchronized, which could have been a slight problem.
Users can specify an identification code when they connect (8-100 characters), only if they are using HTTPS. This code is combined with their nickname and a server-side secret, hashed with SHA-256, and condensed down to 64 bits by XORing every 8th byte with each other, and finally converted to base64 (with the trailing = removed). This code is displayed in a tooltip when hovering over the user's chat (TODO: mobile way to view it).
Sigils have been added to be displayed before the user's name in the chat. Admins get @, users with an ID code get +, and normal users get nothing. The IS_ADMIN field is now deprecated, as this can be determined from the user's sigil. It will be removed eventually, but is still being included in events even though the official client should not be using it anymore.
Kicks and bans are now always displayed to all users, even if the server isn't transmitting quit events normally.
Fix removing cookies.
Add per-server instance unique IDs for games and users, which will not collide between servers or when servers restart.
Add GeoIP capability.
Add beginning of framework for logging card plays.
These parameters are used as a closure, so that the generated handler knows
which game it is attached to.
Signed-off-by: Matt Mullins <mmullins@mmlx.us>
This is in preparation to support multiple tabs, which will provide a
separate chat tab per running game.
Signed-off-by: Matt Mullins <mmullins@mmlx.us>
Admin chat in blue.
Chat commands (/names, /kick, /ban to start).
Close Hibernate session after loading card sets when a user connects -- Oops!
Games have their own Hibernate session for their duration, and this is used instead of a per-request session for loading card sets when changing options.
Fix changing game options without having a card set selected.
make converter to produce js enums out of java enums
make everything use the constants on both sides for ajax operation code and disconnect reason
move the handler update out of the subpackage that it generates into
make the enum update and handler update run at build