Commit Graph

55 Commits

Author SHA1 Message Date
Andy Janata ea36f82897 Count the number of cards added to the game and compare to known minimums (statically determined for black cards, and based on player limit for white cards). This allows games to run only on Cardcast decks. Fixes #125.
Update my IP address for admin purposes.
2015-02-16 00:58:01 -08:00
Andy Janata 832bcd8fc4 Maven support.
This is still a bit clunky, but it seems to be working. This supports running both with Jetty directly, and making a .war to throw at Tomcat. You will still need Postgres to run via Jetty; this is super useful for debugging in Eclipse.

mvn clean package war:exploded jetty:run

mvn clean package war:war

You will need to copy build.properties.example to build.properties and fill in the appropriate information.

Also, use correct date format in the cache filter, as Jetty is more strict.
2015-02-14 00:24:38 -08:00
Andy Janata 05239299e3 Initial Cardcast UI, with chat commands. Javascript formatter stuff in the project. 2014-08-10 22:16:15 -07:00
Andy Janata f5060113db Refactor CardSet, BlackCard, and WhiteCard to enable adding Cardcast card set support.
Blank white cards are no longer indicated by an ID of less than -1. There is a new field on WhiteCardData. (They will still have a negative ID, but so will external cards.)
2014-08-10 15:55:42 -07:00
uecasm 417c97f1b3 Refactor game options into subobject. 2014-04-08 23:20:40 +12:00
Andy Janata be7768e03b Refactor preferences code out to its own file. Add game list filters, allowing users to ban and require card sets for a game to be in their game list. 2014-01-26 23:22:37 -08:00
uecasm bb83cef8a3 Add a button to Stop an in-progress game. 2014-01-25 00:33:15 +13:00
Andy Janata 014495007a Kick non-admins after being idle for an hour. Any user activity resets this timer. This is a roundabout way of addressing #52, but brings more to the table in general and is significantly simpler than making each game have a timer task to manage it.
Increase the ping timeout delay from 45 seconds to 90 seconds, while reducing the timeout on long poll requests on the client side to 30 seconds. (This is still less than the 25 seconds that LongPollServlet will wait.)
2013-12-02 04:00:57 +00:00
Andy Janata 9a571804aa Use max_users config option and deny access to new users if there are too many connected. 2013-12-01 18:18:35 +00:00
Andy Janata 3ecb4f59a6 Merge branch 'score-cmd' of https://github.com/uecasm/PretendYoureXyzzy into uecasm-score-cmd 2013-11-30 05:04:09 +00:00
Andy Janata b679412cb0 Merge branch 'emotes' of https://github.com/uecasm/PretendYoureXyzzy into uecasm-emotes 2013-11-30 04:52:29 +00:00
Andy Janata 93abb3a29d Looks like cah.constants.js wasn't updated for BLANKS_LIMIT. 2013-11-30 04:47:09 +00:00
uecasm 249a308b5b Add "score" command, which can be used by any user to view the current score of any other user (even across games). Also allows admins to modify a user's current score, which can be useful on private servers where admins are playing and can "repair" a score if someone gets disconnected or kicked accidentally. 2013-11-15 23:27:30 +13:00
uecasm 2a6b81e4dd Add /me command to support emotes. 2013-10-03 00:28:16 +13:00
Gavin Lambert 4ac0de4ff6 Add spectator feature 2013-06-11 00:14:32 +12:00
Andy Janata 2ae18ca6eb Support for sort weights for card sets. 2013-04-27 23:10:56 -07:00
Andy Janata bdf288a379 Add game option for using idle timer. Implementation when not using idle timer is it instead uses Integer.MAX_VALUE as the number of milliseconds. 2013-04-13 10:39:38 -07:00
Andy Janata 30e7966222 reserve the nick "xyzzy" for future use 2013-03-30 08:10:00 -07:00
Andy Janata c662bf954d admins can send chat to all connected users 2013-03-26 20:17:49 -07:00
Andy Janata a43e087fa2 card set descriptions 2013-03-26 17:19:01 -07:00
Andy Janata 300e7e09b7 Fix up per-game chats so global chat still works. Fix graphical glitch with game chat tab. Make enter work in game chat box. Clear game chat log when joinging game. 2013-02-24 18:47:05 -08:00
Andy Janata 38224cf81a Chat flood protection. Limits users to 5 messages per 15 seconds currently. 2012-08-28 23:00:47 -07:00
Andy Janata 7fccd69b15 Kicks and bans.
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.
2012-08-20 22:41:06 -07:00
Andy Janata 90788982c0 chat messages from admin users show up in blue. admins are defined by IP address for now. 2012-08-20 20:03:52 -07:00
Andy Janata 7cf9413861 - add card set support to the game itself
- add watermark field to cards to indicate what to display over the logo
- display said watermark
2012-07-07 15:01:33 -07:00
Andy Janata 973f18ea80 return list of card sets during first load 2012-07-07 10:21:14 -07:00
Andy Janata 315549d87f game passwords, and display more game information in the lobby list 2012-03-18 21:20:48 -07:00
Andy Janata dd117f05d2 fix constants for test 2012-03-16 17:05:27 -07:00
Andy Janata e0391b8d4e skip and kick idle players 2012-03-16 16:59:50 -07:00
Andy Janata a6f1a139be game host can configure maximum players and score goal 2012-03-15 20:06:23 -07:00
Andy Janata 1b465bad8f fix the servlet mappings in web.xml. make everything uncachable. 2012-03-13 00:42:07 -07:00
Andy Janata add5386127 POSSIBLY BREAKING CHANGE: change all the over-the-wire Constant values to shorter things. 2012-03-12 21:06:35 -07:00
Andy Janata e614a0da57 add a test for over-the-wire uniqueness for Constants, with an annotation to allow intentional duplication. 2012-03-12 20:18:24 -07:00
Andy Janata 463432e369 Gray out the Card Czar's hand and display a message over it. 2012-02-07 14:15:51 -08:00
Andy Janata 83a807f4b8 - reorder stuff in admin.jsp
- add my global ip address to admin whitelist
- add kick functionality to admin.jsp
- admin.jsp redirects to itself after processing actions to avoid refreshing re-processing the action
- ConnectedUsers invalidates the user when removing it
2012-01-30 23:52:45 -08:00
Andy Janata 2d5e9d18c0 - discard cards after they are used, so that they can be reshuffled if more cards are required (hasn't been tested)
- much better handling when users leave the game:
  - put their hand in the discard pile
  - if they played this round, put that card in the discard pile and remove them from the played players list
  - if they were supposed to play this round, remove them from the players list
  - if they were judge, return all played cards to players and move to the next judge
  - if they weren't judge and were lower in judging order, fix the judge pointer
- add a goal to the game (8 points for now, hard-coded)
- keep track of which players are supposed to play this round so players joining and leaving don't affect the game progressing
2012-01-30 16:35:06 -08:00
Andy Janata 259b323e1c "Judge" -> "Card Czar" 2012-01-30 00:35:11 -08:00
Andy Janata e3ac81705e false-start of doing admin via ajax, would require a lot more work on the admin client to actually do it this way 2012-01-29 17:14:17 -08:00
Andy Janata 0e11e59207 - judge can select card
- game goes to next round
2012-01-27 15:41:57 -08:00
Andy Janata 48976b4dc0 - change how the client's own card is displayed after playing it to avoid race condition
- show all white cards when switching to judging mode
2012-01-26 22:17:36 -08:00
Andy Janata 2e26e938e5 - reload the round white cards when page reloaded
- can't select a hand card after playing a card
2012-01-26 19:25:40 -08:00
Andy Janata 7600ec27de - refactor game handlers a bit to add another abstract class that ensures the user requesting is in the game in question
- add play card handler. need to send the white card count down to users that refresh the page.
- ajax event handlers get the request object as well as the result object so the server doesn't have to send the game id back in a response
2012-01-26 18:07:39 -08:00
Andy Janata 234b82afd2 - display black card in game
- display message indicating what the game is currently waiting for
- reload the black card when reloading page
- change the js constant generator to explain what the dummy things are for in the output
- add support for enums that need two user-visible values (specifically the game player state: the short message for the scoreboard and the long message telling the player what they need to do)
- hide the start game button after the game is started
- refactor game event longpoll handlers to use a helper that gets the game and reports an error if it can't
- game (should) reset to a lobby if it loses players to put it less than 3
2012-01-24 16:20:43 -08:00
Andy Janata 5915a3558d - reload hand after reloading page
- use transform animation in all browsers to reduce complexity :(
2012-01-23 23:02:59 -08:00
Andy Janata c73ce88646 deal cards to players when the game starts 2012-01-23 15:06:20 -08:00
Andy Janata eec3ad81ca - make currentGames be a list instead of a single object, just in case I do multiple games later
- add event handlers for leave and start game buttons
- leave game button works
2012-01-23 13:20:15 -08:00
Andy Janata 8e3c1372dc - fix formatting in css file
- add some templates for game lobbies
- client properly joins a game and shows the lobby!
- reconnect to in-progress game when refreshing page
2012-01-22 23:58:36 -08:00
Andy Janata 5bda9fd452 client can join games. doesn't load the game yet, which is the same thing that happens with creating a game. the same thing should happen for both cases.
reworked some tests to be able to hide a method from GameManager. part of this goal was to reduce unnecessary game refresh broadcasts if a client tried to create multiple games.
2012-01-18 16:42:18 -08:00
Andy Janata 979a9c4123 - create games
- list games
  - automatically refreshes list when game is created or destroyed
  - destroy games after removing all players (including at logout)
2012-01-17 21:58:09 -08:00
Andy Janata 40de91b5ac some work on the game list 2012-01-17 20:37:09 -08:00