Commit Graph

86 Commits

Author SHA1 Message Date
Andy Janata 14dbf94b27 try to prevent an NPE if the "correct" person leaves a game, especially if it was due to ping timeout 2012-03-14 21:52:58 -07:00
Andy Janata f6d1c685b8 put a try-catch around the ping timer check code so if it has an NPE or something it doesn't crash the thread. 2012-03-14 21:52:28 -07:00
Andy Janata 073bdb7368 name the ping check timer and flag it as a daemon 2012-03-14 21:51:55 -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 349154367c add something to set maximum cache age of an hour on static files. hopefully this is sufficient 2012-03-12 22:19:57 -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 3273cfed12 make server-side check for no-content chat messages too 2012-03-12 21:05:57 -07:00
Andy Janata 2e62708ea6 change long poll server-side returning to 20+5 seconds, client-side timeout to 45 seconds, and ping checking to 45 seconds. this should hopefully helpe with people that just close the window.
increase the maximum number of messages returned per poll to 10 for no particular reason :)
2012-03-12 21:05:19 -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 4ee3212d6d Move the servlet handlers to a subpackage. 2012-02-20 12:31:51 -08:00
Andy Janata 97a48f62b7 Comment on a FindBugs warning and why it's being ignored. 2012-02-20 12:29:32 -08:00
Andy Janata 444bcd96e0 wrap loading the decks inside a transaction, and commit the transaction when we're done. hopefully this finally gets rid of the lingering transactions... 2012-02-20 11:51:03 -08:00
Andy Janata 16b36e2c4b force UTF-8 encoding on incoming requests. jquery docs state that ajax data is always utf-8 encoded, however it doesn't actually send the encoding specification along with the request so we have to force it here 2012-02-20 11:50:35 -08: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 88b68c87b6 comment ALL the files! 2012-02-06 14:00:24 -08:00
Andy Janata 9af04612a6 make hibernate not spit its queries out now, we don't need that anymore 2012-02-02 14:47:50 -08:00
Andy Janata 4d5fddd293 add 2-clause bsd-style license to source files 2012-02-02 14:47:23 -08:00
Andy Janata 828def7cf8 delete files used for testing stuff ages ago 2012-02-02 14:46:46 -08:00
Andy Janata 582537b0a1 todo cleanup for multi-play 2012-02-01 14:26:20 -08:00
Andy Janata b5cb45353c - make the logo on the cards from css instead of images
- fix reshuffle notifications not delivering to client properly
- fix not actually putting "draw 2" cards into the players' hands
2012-01-31 20:22:07 -08:00
Andy Janata a493b917ed rudimentary support for pick X and draw X cards. it looks completely wrong on the client during the play phase. does not display the annotations to the player yet either 2012-01-31 17:59:53 -08:00
Andy Janata 6ed7eb60d5 pick a random judge to start the game 2012-01-31 00:01:52 -08:00
Andy Janata dbb802bb28 delay 5ms after noticing the user has a queued message before returning it in case other messages arrive immediately thereafter 2012-01-30 23:54:05 -08:00
Andy Janata 7112825580 - don't send player leaving game event to the player that left the game
- broadcast refresh game list event when player leaves or joins a game
2012-01-30 23:53:37 -08:00
Andy Janata a5f82eb08e TODO cleanup 2012-01-30 23:53:00 -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 f08785cdaa fix tests 2012-01-30 16:44:30 -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 3fd597b580 kill the next round timer when a game resets due to losing players 2012-01-30 00:36:52 -08:00
Andy Janata 259b323e1c "Judge" -> "Card Czar" 2012-01-30 00:35:11 -08:00
Andy Janata bc2e7501cc reset the judge index when the game resets 2012-01-29 17:14:28 -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 a26221c2bb - admin can toggle verbose logging of all requests on and off
- admin page shows user hostname
- servlets log request and response if logging is enabled
2012-01-29 17:13:31 -08:00
Andy Janata 8ad224edad basic admin page, shows memory usage, uptime, and connected users 2012-01-28 00:49:32 -08:00
Andy Janata 65c92d8440 reduce round intermission time to 8 seconds 2012-01-27 17:19:36 -08:00
Andy Janata 0e11e59207 - judge can select card
- game goes to next round
2012-01-27 15:41:57 -08:00
Andy Janata 7a8da9bf72 wasn't actually sending the event type when moving a game back to the lobby, clients didn't know what to do 2012-01-27 00:15:07 -08:00
Andy Janata 6226558535 set response encoding to utf-8 2012-01-26 22:17:45 -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 347dfb0b02 toString in QueuedMessage 2012-01-23 23:03:08 -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 2ce38e4222 refactor to get a base abstract GameHandler since a bunch of handlers will need to get the game object 2012-01-23 12:52:33 -08:00
Andy Janata e21fd8ed00 debug ajax responses to stdout, if new code uncommented 2012-01-22 23:58:59 -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 109a58444a don't sanitize chat, instead use a text element to display chat and log messages 2012-01-22 23:54:58 -08:00