Commit Graph

547 Commits

Author SHA1 Message Date
Andy Janata 2906ffaa33
Merge pull request #169 from devgianlu/master
Send global chat enabled with FirstLoad
2018-05-18 18:46:22 -05:00
Gianlu c71e01b573 Send global chat enabled with FirstLoad 2018-05-13 18:14:46 +02:00
Andy Janata f88ed593c2 Update changelog 2018-04-05 08:59:50 -07:00
Andy Janata 99958c0dcf Display round permalinks after the round is over, if enabled.
This takes advantage of the metrics logging, the metrics processor, and the metrics viewer to provide a permalink to a particular round, instead of requiring players to take a screenshot of the round. This will not be enabled immediately as the viewer is not quite ready for deployment, but this is all that needs done on the game server to support this, so it can just be dynamically enabled when it's ready.
2018-04-04 16:09:17 -07:00
Andy Janata 88ab1ac640 Merge branch 'master' of github.com:ajanata/PretendYoureXyzzy 2018-04-01 19:46:45 -07:00
Andy Janata 1c07624a5c Add repeated words filtering to chat filter. 2018-04-01 19:46:26 -07:00
Andy Janata 9bbdd38f36
Create LICENSE 2018-03-31 13:04:46 -07:00
Andy Janata 43f9b70d54 Fix Go data type for WHITE_CARDS and WINNING_CARD cuz I just guessed when I made them in the first place. 2018-03-30 16:28:01 -07:00
Andy Janata 6d289ef925 Fix a typo in a variable name 2018-03-30 16:27:29 -07:00
Andy Janata 21e8f7a571 AjaxResponse PLAYER_INFO is also an array, oops. 2018-03-29 18:54:37 -07:00
Andy Janata 3cb0e554fb GameId needs to be an *int in AjaxResponse for Go, just like LongPollResponse. 2018-03-29 14:44:50 -07:00
Andy Janata dcb9553837 Fix /whois not showing spectators as spectating 2018-03-29 14:44:27 -07:00
Andy Janata a505598c0d Tell admins about filtered chat content.
Including chat in games that the admin isn't in.
2018-03-27 17:59:31 -07:00
Andy Janata 612bd09978 Always send admins connect and quit events 2018-03-27 17:58:55 -07:00
Andy Janata 4afab98c76 Include ? as a basic character, and count spaces as them too. 2018-03-27 11:14:16 -07:00
Andy Janata 8211726118 Refer to verification code in the ui for the mangled version 2018-03-27 11:13:51 -07:00
Andy Janata 28e040aaec Send sigil/id code/persistent id when reconnecting.
First load handler needs to send those things so the client actually has it. Doesn't really need the persistent id there, but it definitely needs the sigil to avoid undefined errors.
2018-03-27 11:05:01 -07:00
Andy Janata 988f63887b Include some creation times in responses.
Server startup time is included in first load response, and game creation time is included in game info. IRC bridge uses these, and perhaps a way to see them in the web client will be added too.
2018-03-26 16:57:40 -07:00
Andy Janata 0678272f29 Fix IPv6 loopback address for admin, and comment. 2018-03-26 13:59:04 -07:00
Andy Janata fa996ab1c8 Update change log. 2018-03-26 12:00:27 -07:00
Andy Janata ace019d7d9 Clarify that shadowbanned strings should be provided in lower-case.
And also make that check essentially be case-insentive as well as case-sensitive (check them both).
2018-03-26 09:58:00 -07:00
Andy Janata 6e6bf612dc Add logging to (FirstLoad|Register)Handler.
Trying to figure out why some people can still get in while banned. I cannot reproduce this, and it does not make sense that it is possible as the admin page lists their current IP address in the ban list... and those are all trimmed, so it can't be spaces. Weird.
2018-03-26 09:56:58 -07:00
Andy Janata 783b223d19 Updates for shadowban.
Unicode characters weren't getting loaded correctly for some reason, either literally or via escape sequences. Change to specifying a class name which has a compile-coded list of shadowbanned strings. This prevents changing on the fly, but at least it works for now until a proper database can be implemented.
Update the privacy policy about chat logging due to shadowbans.
2018-03-23 23:18:21 -07:00
Andy Janata 65f74ef816 Add more chat filtering.
CAPS LOCK FILTER if a line is long enough and contains mostly caps.
Shadowban filter blocks messages with configurable substrings present in them. Does not permanently shadowban the user, yet, just drops the message.
Add a test that was missed in a previous commit.
2018-03-23 22:32:16 -07:00
Andy Janata 4f9edbb97a Bump the version since I'm adding so much stuff. 2018-03-23 17:16:11 -07:00
Andy Janata 4bddace596 Add more chat control.
* A certain amount of characters in the message must be latin-ish, if the message is longer than a certain length.
* There must be a certain number of spaces in the message, if the message is longer than a certain length.
* The same message cannot be repeated twice in the same location.
* Switched the separator between parts for the chat control config value from _ to . for the scope.
2018-03-23 17:15:06 -07:00
Andy Janata 0cf261f6e4 Fix an NPE when logging out while in a game.
The fix for #124 apparently introduced another bug wherein logging out while playing in a game caused an NPE while ensuring that the user was also not spectating the game. Hold onto that value a little bit longer to make sure we can call that method as well, even though it shouldn't need to be called at that point (but an NPE is worse).
2018-03-23 14:41:31 -07:00
Andy Janata 88bfa34898 Global and game chats have distinct flood controls.
Split the configuration value into two. Add a tracking object to ChatFilter per user which currently contains the two different last message times. Removed the last message times from the User object. Show chat error messages only in the tab that caused them, not both tabs.
2018-03-23 14:41:08 -07:00
Andy Janata c6f62c1496 Add a ChatFilter class and use it.
Refactored out the flood protection, empty message, and message too long errors out to the new class. This will also easily allow adding other chat protections in the future, in one location. Further refactoring should be possible to not have to hold chat-protection related information in the User object, as well.
2018-03-22 17:12:47 -07:00
Andy Janata 4e2b5e480b Move admin IP addresses to config file. 2018-03-22 16:26:30 -07:00
Andy Janata ac48ea044c Delete some old stuff that was never fully implemented or needed. 2018-03-22 16:23:41 -07:00
Andy Janata 270b590ec7 Always return serial as a number, never a string. Errors were returning string for some reason. 2018-03-19 21:18:46 -07:00
Andy Janata 7375dd8a57 Minor fixes for Go API client.
* GameId needs to be an *int not an int so we can tell the difference between lack of value and value 0.
* Add the description strings to DisconnectReason.
* Add Sigil and IdCode to NewPlayer messages.
* Add if join/quit events are being broadcast to JavascriptConfigServlet. It works much better if they are but it should still work if they aren't.
2018-03-15 21:35:00 -07:00
Andy Janata f7386c8a09 Uncomment and fix annotation spelling 2018-03-15 21:31:18 -07:00
Andy Janata 89e164e1e4 Fixes for Go code generation.
Timestamps have to be int64 (duh), and have to include json:"" around the field name for it to actually work (the documentation is terrible on this).
2018-03-13 16:48:54 -07:00
Andy Janata 72fd7f827a More extensive Go code generation for constants.
Add annotations to Constants to specify that a Go struct should be created, and what data type the fields should use (if not string). Rough pass at assigning these annotations correctly. It almost certainly will need further tweaking after trying to use the results in the Go code extensively.
2018-03-13 15:47:02 -07:00
Andy Janata 6a6172742b just type everything as strings for go 2018-03-12 21:44:35 -07:00
Andy Janata b5c9bffeb1 port UpdateJsConstants to make Go constants 2018-03-12 16:11:28 -07:00
Andy Janata b20562d6da Add a crude scrollbar to user preferences and game list filters.
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.
2018-03-09 10:14:51 -08:00
Andy Janata 204c6be94d Fix stop spectating a game when user disconnects.
Previously, when users disconnected (either manually or automatically via ping timeout or whatever), they were only being removed from their game if they were a player, not a spectator. This is not consolidated inside the Game class for whatever reason, so add this call to the path that runs when a user is logging out. I've verified other code paths that remove players and all of the ones that need to remove a spectator already do so.

Fixes #124.
2018-03-06 19:01:42 -08:00
Andy Janata 24881d1d55 Allow white cards with images, and minor cleanup.
Refactor out the formatting code from CardcastService to its own class.
Add [img][/img] support for white cards to have images on cards.
Force line wrapping for cards with words that do no fit onto a card.
2018-03-06 16:21:59 -08:00
Andy Janata f7378e0d42 Show the /whois result in the window it was typed in. 2018-03-06 00:30:04 -08:00
Andy Janata e1578532e3 Add a /whois command.
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.
2018-03-06 00:15:05 -08:00
Andy Janata 1fb621e175 Fix "Make a haiku." draw and pick values.
Same issue as the other card.
2018-03-05 13:48:34 -08:00
Andy Janata feed54d3e8 Fix an oddly-formatted black card's pick value.
The black card "What are two cards in your hand that you want to get rid of?" obviously wants you to play 2 cards, but it doesn't have any blanks in it, so the automatic card importer had no idea that it wants you to play two cards.
2018-03-04 11:31:30 -08:00
Andy Janata 7a24c652ac Add ID codes for positive user identification, and minor fixups.
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.
2018-03-02 17:30:59 -08:00
Andy Janata dc31b1f2ce Fix not focusing the nickname box on page load. 2018-03-02 14:28:28 -08:00
Andy Janata cdd38465fa HTML cleanup.
* Fix not being able to scroll the index page. Oops. Cleaned up how that was managed.
* Clean up things in changelog and known issues and future features. Some of it has been done for years, oops.
* Make the label for the join button for passworded games word-wrap.
2018-03-02 14:18:46 -08:00
Andy Janata cb0f2689c6 Let global chat enablement be configured via the properties file. Can be adjusted on the fly, though clients are not notified of the change (which doesn't affect the client's operation anyway). 2018-02-28 11:19:34 -08:00
Andy Janata e2960eef7d make lastpass also ignore the chat entry area 2018-02-27 17:50:56 -08:00