Commit Graph

53 Commits

Author SHA1 Message Date
Andy Janata bd0c11fcf7 fix some alignment 2012-01-20 18:56:33 -08:00
Andy Janata 019505e0b4 make stuff more relative-size-friendly 2012-01-20 16:11:59 -08:00
Andy Janata 577586139e - escape html in chat on client and server
- rework how the gamelist was shown
2012-01-20 14:55:08 -08:00
Andy Janata 890964b85d card classes 2012-01-19 21:19:55 -08:00
Andy Janata 4a3a9d95bd add templates for cards. change how game list lobbies are cleaned up 2012-01-19 18:19:05 -08:00
Andy Janata 4fe85b5233 add some comments to Constants 2012-01-19 00:37:45 -08:00
Andy Janata 7f376faa10 disable all interface objects when we detect the server has restarted 2012-01-19 00:34:55 -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 8187147e74 catch assertion errors in CahServlet 2012-01-18 16:39:11 -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
Andy Janata 90b3129f66 cah.bind to bind functions to objects 2012-01-17 20:36:34 -08:00
Andy Janata e832d4fd02 dump a stack on an invalid operation, in case it was guice's fault 2012-01-17 17:48:44 -08:00
Andy Janata 79f2f59716 - add game list ajax call
- skeleton for game lobby list
- fix ajax handlers to use the constants instead of literals for the ops
2012-01-17 17:48:21 -08:00
Andy Janata 565c17b338 - add GameManager and test
- fix up Guice
2012-01-16 23:59:56 -08:00
Andy Janata e64978a0da remove literals from AjaxServlet 2012-01-16 23:58:48 -08:00
Andy Janata 76d9be8f1c more constants instead of immediate strings.
add a wrapper around the request parameters so we can use our enum values as the parameter names.
2012-01-16 16:28:21 -08:00
Andy Janata 61451105b0 do not return error messages, only return the error code and let the client look up the error message. this could eventually allow for localization of the error messages (but not the rest of the client yet) 2012-01-16 14:33:58 -08:00
Andy Janata 9a281cd38f use constants for long poll events, ajax request operation names, ajax response field names, and error codes 2012-01-12 21:36:31 -08:00
Andy Janata f33070ab7e move the js constant updater build tool down after java compile since it needs the new constant file compiled first
make the js constant updater only run on enums
2012-01-12 21:33:54 -08:00
Andy Janata 61fc4ece55 fix a compiler warning 2012-01-12 20:05:48 -08:00
Andy Janata 8da78ebac7 move MessageType back inside QueuedMessage since the client doesn't need it
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
2012-01-12 20:05:39 -08:00
Andy Janata a7cc7c8d36 messing around with the ajax stuff to make autocomplete work better 2012-01-12 17:05:09 -08:00
Andy Janata 9e8c46ec2f make ajax requests come from a builder to work on removing constant strings 2012-01-12 14:25:04 -08:00
Andy Janata 7f1158f59c add findbugs to build 2012-01-12 14:24:23 -08:00
Andy Janata 45e5705e56 move Type and DisconnectReason enums to a single file, preparing to do the same for all the scattered strings for operations 2012-01-12 13:35:53 -08:00
Andy Janata de1be43753 tweak GameTest 2012-01-12 13:13:51 -08:00
Andy Janata 0183bb0732 game data object with methods to add and remove players from the game 2012-01-12 13:09:01 -08:00
Andy Janata 3906b5582c cleanup 2012-01-12 13:07:34 -08:00
Andy Janata bdf401c443 don't display ourselves connecting at the beginning 2012-01-12 13:07:19 -08:00
Andy Janata c4210a3faa properly invalidate sessions when ping timeout occurs so when the user comes back they'll get a new session 2012-01-12 13:07:05 -08:00
Andy Janata 3c391f23cd add names list when connecting 2012-01-12 13:05:49 -08:00
Andy Janata 264d0e0187 add easymock 2012-01-12 13:04:46 -08:00
Andy Janata c66c08cd4f we have to be able to deal with longpoll error data returned not in an array, so make it look like an array if it's an error 2012-01-06 16:49:43 -08:00
Andy Janata eba02a35bd add support for being able to return more than one event in a single long poll request, since the client will poll no more often than every half-second. this could have caused a rather large backlog of events to deliver if chat was active. 2012-01-06 16:43:40 -08:00
Andy Janata 8a45078d77 remove dead clients
refactor the injector out to the servlet context
2012-01-06 15:53:55 -08:00
Andy Janata 9508575949 log out button 2012-01-06 15:53:04 -08:00
Andy Janata ce273d533c fix some compiler warnings after tweaking what it warns on 2011-12-24 19:51:49 -08:00
Andy Janata 401b3fed2e remove an unused instance variable in AjaxServlet 2011-12-24 19:38:33 -08:00
Andy Janata 29d3ca9190 only scroll the log window if it was already scrolled to the bottom 2011-12-24 19:38:19 -08:00
Andy Janata 37cc770ed3 convert cah.ajax into an object to make things a little neater 2011-12-24 19:38:02 -08:00
Andy Janata 0183ca5357 - change register error message only showing up once instead of repeating every time you try and get an error. it probably should blank when you start typing again though
- pull the long polling handlers out to their own file like the ajax response handlers
- chat
2011-12-24 19:37:45 -08:00
Andy Janata b73320d614 keep track of the last time a client started a long polling operation so we can eventually use that to remove dead clients 2011-12-24 19:35:28 -08:00
Andy Janata 10a4d4e62e refactor ConnectedUsers a bit to make broadcasting easier 2011-12-24 19:34:57 -08:00
Andy Janata c1e033cd65 refactor Handler:
- abstract class
- so I could make an error() function to create the Map in one place

RegisterHandler also checks nicks against a regex
2011-12-24 19:34:22 -08:00
Andy Janata 87c77993af refactor the js code into several files. need to further refactor the ajax handlers, and make the server automatically assemble the list of files the client needs.
some sort of dependency ordering needs enforced too.
2011-12-22 18:48:20 -08:00
Andy Janata 1b9caf3bef rework the initial request error checking in the servlets to be a bit better, and return an error code to the client that the client can then act on (instead of just a string) 2011-12-22 18:44:03 -08:00
Andy Janata cb4d4413c2 randomize the timeout in the long poll servlet so all clients don't hammer it at the same time 2011-12-22 18:43:13 -08:00
Andy Janata 5aacc0ac32 - add long polling support
- broadcast a message when a new user connects
- utilize the long polling to deliver the message to existing clients
2011-12-22 14:19:59 -08:00
Andy Janata 727f1cf3c0 - refactor out common things from AjaxServlet so it can be used elsewhere
- fix some guice stuff
2011-12-22 14:19:22 -08:00