Commit Graph

574 Commits

Author SHA1 Message Date
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
Andy Janata 4b75185629 * Add stylesheet to privacy and changelog pages.
* Update changelog on index and game page.
* Add tweet box to index and game page.
2018-02-27 16:30:59 -08:00
Andy Janata 216ff638bf Sort full games to the end of the game list. Fixes #157. 2018-02-27 16:03:09 -08:00
Andy Janata ce7e9da13c Revised new card database dump. Addresses cards with the same text but different formatting. 2018-02-27 15:14:00 -08:00
Andy Janata d143791321 * Fix some cases of not all decks being listed because the javascript code assumed that duplicate weights would never occur.
* Re-enable view cards page.
2018-02-27 14:05:57 -08:00
Andy Janata a94ba4a31c Fix default value for idle time multiplier in GameOptions so the dropdown actually has something selected. 2018-02-25 22:12:17 -08:00
Andy Janata b80f12e8d1 Update cards with official CAH cards through Q3 2017 from data provided by CAH. See also pyx-importer project. 2018-02-25 22:04:33 -08:00
Andy Janata adab3b7001 Add card dealt metrics. 2018-02-25 22:01:21 -08:00
Andy Janata 89a4ceeeef * Change card set sort order from 'weight, id' to 'weight, name'.
* Add number of black and white cards to the list on the card set editor page.
2018-02-21 16:49:38 -08:00
Andy Janata 91db059995 Use C3P0 for Hibernate connection pooling. This fixes the issue where everything breaks if Postgres restarts. 2018-02-15 16:27:53 -08:00
Andy Janata 88f58fb0fe Update README with correct command to run via jetty. Fixes #163. 2018-02-15 14:06:47 -08:00
Andy Janata 5e60e106f4 Handle null HTTP headers for language and user agent 2017-08-13 13:09:20 -07:00
Andy Janata 17ac4078d0 Disable global chat except for admins. Add release notes. 2017-08-13 12:17:42 -07:00
Andy Janata 9679d0f330 add watermark to card information sent to metrics 2017-04-14 22:23:05 -07:00
Andy Janata b2c27cd5cc add privacy page 2017-03-05 12:07:49 -08:00
Andy Janata 942903e60c sasl support for kafka 2017-03-04 15:43:00 -08:00
Andy Janata 73c41cc59f fix some cleanup issues when unable to connect to kafka 2017-03-04 14:13:51 -08:00
Andy Janata 5e6791e071 kafka tls 2017-03-04 13:55:41 -08:00
Andy Janata 5f18168388 configure logging before injector creation so injected constructors can log, and do not bother re-loading pyx.properties immediately after creating the injector which already does so 2017-02-26 22:34:06 -08:00
Andy Janata 23ce041bda implement kafka metrics without tls or authentication 2017-02-26 22:27:56 -08:00
Andy Janata a38dc53a77 fix some hibernate deprecation warnings 2017-02-26 22:27:03 -08:00
Andy Janata a67c721427 fix some warnings 2017-02-26 22:13:18 -08:00
Andy Janata 1e09b55190 java 8 2017-02-26 18:17:32 -08:00
Andy Janata a0d21cd2fd make metrics methods agree in tense 2017-02-23 22:36:58 -08:00