Commit Graph

11 Commits

Author SHA1 Message Date
Andy Janata 0e45c4f886 Switch to using a ScheduledThreadPoolExecutor instead of a Timer for scheduled tasks. This will allow 2 * CPU count threads to handle background tasks instead of using a single thread, which could cause the server to effectively die if a task gets stuck for some reason. This addresse the symptom of #89, but not the cause (which is yet to be determined). 2014-02-16 00:43:13 -08:00
Andy Janata fd3dce4c62 Reduce Hibernate Session lifetimes for games, which may be related to #89. Now, we're loading the cards out of the database when the game host tells us which card sets to use, and never touching the database again if the card sets never change.
Also, don't load every card in every card set when loading the card sets when a player connects to the server. We only need a count of the cards in the card set at that point.
2014-02-16 00:18:54 -08:00
Andy Janata 8221ab7b54 - Remove some pointless @Provides methods and .bind().toInstance().
- Use a single global Timer and schedule multiple TimerTasks on it. Moving to a ScheduledThreadPoolExecutor may be preferable as now all TimerTasks are serialized.
- Fix tests that were broken by changed behavior in 638fac780a (shows how often I run the few crappy tests I have...)
2013-12-01 09:53:47 +00: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 16483c94b3 fix tests. I really need to run these more often, and write more. 2012-03-15 14:51:36 -07:00
Andy Janata 88b68c87b6 comment ALL the files! 2012-02-06 14:00:24 -08:00
Andy Janata 4d5fddd293 add 2-clause bsd-style license to source files 2012-02-02 14:47:23 -08:00
Andy Janata 8b6d171d66 fix warnings 2012-01-20 19:11:39 -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 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