From 136ce95572d3ebce5411df729591e386253cf956 Mon Sep 17 00:00:00 2001 From: emckee2006 Date: Sun, 22 Feb 2015 23:39:13 -0500 Subject: [PATCH] Update deps and use proper connection pooling with the db --- .classpath | 11 +- .../oracle.eclipse.tools.webtier.ui.prefs | 5 + .settings/org.eclipse.jdt.core.prefs | 7 +- ....eclipse.wst.common.project.facet.core.xml | 6 +- WebContent/js/cah.constants.js | 538 +++++++-------- pom.xml | 618 +++++++++--------- .../WEB-INF/classes/hibernate.cfg.xml | 43 +- .../net/socialgamer/cah/HibernateUtil.java | 26 +- .../cah/handlers/PlayCardHandler.java | 10 +- .../cah/hibernate/SqliteDialect.java | 10 +- .../net/socialgamer/cah/servlets/Schema.java | 16 +- .../socialgamer/cah/data/GameManagerTest.java | 4 - 12 files changed, 663 insertions(+), 631 deletions(-) create mode 100644 .settings/oracle.eclipse.tools.webtier.ui.prefs diff --git a/.classpath b/.classpath index 698778fe..6e476308 100644 --- a/.classpath +++ b/.classpath @@ -17,14 +17,19 @@ - + - + - + + + + + + diff --git a/.settings/oracle.eclipse.tools.webtier.ui.prefs b/.settings/oracle.eclipse.tools.webtier.ui.prefs new file mode 100644 index 00000000..b0107e52 --- /dev/null +++ b/.settings/oracle.eclipse.tools.webtier.ui.prefs @@ -0,0 +1,5 @@ +_hiddenCategory_\:HTML=false +_hiddenCategory_\:ManagedBeans=false +_hiddenCategory_\:PageVariables=false +_hiddenCategory_\:jsp11=false +eclipse.preferences.version=1 diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index ff57fc10..194c98bc 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,14 +1,15 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index 19a347a2..069f1ccb 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,10 +1,10 @@ - + - - + + diff --git a/WebContent/js/cah.constants.js b/WebContent/js/cah.constants.js index e6722afe..6cd17b73 100644 --- a/WebContent/js/cah.constants.js +++ b/WebContent/js/cah.constants.js @@ -2,331 +2,332 @@ cah.$ = {}; -cah.$.GamePlayerStatus = function() { - // Dummy constructor to make Eclipse auto-complete. -}; -cah.$.GamePlayerStatus.prototype.dummyForAutocomplete = undefined; -cah.$.GamePlayerStatus.SPECTATOR = "sv"; -cah.$.GamePlayerStatus.HOST = "sh"; -cah.$.GamePlayerStatus.IDLE = "si"; -cah.$.GamePlayerStatus.WINNER = "sw"; -cah.$.GamePlayerStatus.PLAYING = "sp"; -cah.$.GamePlayerStatus.JUDGE = "sj"; -cah.$.GamePlayerStatus.JUDGING = "sjj"; -cah.$.GamePlayerStatus_msg = {}; -cah.$.GamePlayerStatus_msg['sp'] = "Playing"; -cah.$.GamePlayerStatus_msg['sv'] = "Spectator"; -cah.$.GamePlayerStatus_msg['sh'] = "Host"; -cah.$.GamePlayerStatus_msg['sw'] = "Winner!"; -cah.$.GamePlayerStatus_msg['sj'] = "Card Czar"; -cah.$.GamePlayerStatus_msg['sjj'] = "Selecting"; -cah.$.GamePlayerStatus_msg['si'] = ""; -cah.$.GamePlayerStatus_msg_2 = {}; -cah.$.GamePlayerStatus_msg_2['sp'] = "Select a card to play."; -cah.$.GamePlayerStatus_msg_2['sv'] = "You are just spectating."; -cah.$.GamePlayerStatus_msg_2['sh'] = "Wait for players then click Start Game."; -cah.$.GamePlayerStatus_msg_2['sw'] = "You have won!"; -cah.$.GamePlayerStatus_msg_2['sj'] = "You are the Card Czar."; -cah.$.GamePlayerStatus_msg_2['sjj'] = "Select a winning card."; -cah.$.GamePlayerStatus_msg_2['si'] = "Waiting for players..."; - -cah.$.GamePlayerInfo = function() { - // Dummy constructor to make Eclipse auto-complete. -}; -cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined; -cah.$.GamePlayerInfo.NAME = "N"; -cah.$.GamePlayerInfo.SCORE = "sc"; -cah.$.GamePlayerInfo.STATUS = "st"; - -cah.$.GameOptionData = function() { - // Dummy constructor to make Eclipse auto-complete. -}; -cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined; -cah.$.GameOptionData.USE_TIMER = "ut"; -cah.$.GameOptionData.CARD_SETS = "css"; -cah.$.GameOptionData.BLANKS_LIMIT = "bl"; -cah.$.GameOptionData.SPECTATOR_LIMIT = "vL"; -cah.$.GameOptionData.PLAYER_LIMIT = "pL"; -cah.$.GameOptionData.PASSWORD = "pw"; -cah.$.GameOptionData.SCORE_LIMIT = "sl"; - -cah.$.GameInfo = function() { +cah.$.AjaxOperation = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.GameInfo.prototype.dummyForAutocomplete = undefined; -cah.$.GameInfo.HOST = "H"; -cah.$.GameInfo.STATE = "S"; -cah.$.GameInfo.PLAYERS = "P"; -cah.$.GameInfo.SPECTATORS = "V"; -cah.$.GameInfo.ID = "gid"; -cah.$.GameInfo.GAME_OPTIONS = "go"; -cah.$.GameInfo.HAS_PASSWORD = "hp"; +cah.$.AjaxOperation.prototype.dummyForAutocomplete = undefined; +cah.$.AjaxOperation.NAMES = "gn"; +cah.$.AjaxOperation.SCORE = "SC"; +cah.$.AjaxOperation.LEAVE_GAME = "lg"; +cah.$.AjaxOperation.JOIN_GAME = "jg"; +cah.$.AjaxOperation.CHAT = "c"; +cah.$.AjaxOperation.GAME_LIST = "ggl"; +cah.$.AjaxOperation.CARDCAST_ADD_CARDSET = "cac"; +cah.$.AjaxOperation.CARDCAST_LIST_CARDSETS = "clc"; +cah.$.AjaxOperation.PLAY_CARD = "pc"; +cah.$.AjaxOperation.CHANGE_GAME_OPTIONS = "cgo"; +cah.$.AjaxOperation.GET_GAME_INFO = "ggi"; +cah.$.AjaxOperation.GET_CARDS = "gc"; +cah.$.AjaxOperation.ADMIN_SET_VERBOSE_LOG = "svl"; +cah.$.AjaxOperation.REGISTER = "r"; +cah.$.AjaxOperation.CARDCAST_REMOVE_CARDSET = "crc"; +cah.$.AjaxOperation.KICK = "K"; +cah.$.AjaxOperation.FIRST_LOAD = "fl"; +cah.$.AjaxOperation.START_GAME = "sg"; +cah.$.AjaxOperation.LOG_OUT = "lo"; +cah.$.AjaxOperation.BAN = "b"; +cah.$.AjaxOperation.CREATE_GAME = "cg"; +cah.$.AjaxOperation.STOP_GAME = "Sg"; +cah.$.AjaxOperation.GAME_CHAT = "GC"; +cah.$.AjaxOperation.SPECTATE_GAME = "vg"; +cah.$.AjaxOperation.JUDGE_SELECT = "js"; -cah.$.GameState = function() { +cah.$.AjaxRequest = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.GameState.prototype.dummyForAutocomplete = undefined; -cah.$.GameState.PLAYING = "p"; -cah.$.GameState.ROUND_OVER = "ro"; -cah.$.GameState.LOBBY = "l"; -cah.$.GameState.JUDGING = "j"; -cah.$.GameState.DEALING = "d"; -cah.$.GameState_msg = {}; -cah.$.GameState_msg['ro'] = "In Progress"; -cah.$.GameState_msg['d'] = "In Progress"; -cah.$.GameState_msg['p'] = "In Progress"; -cah.$.GameState_msg['l'] = "Not Started"; -cah.$.GameState_msg['j'] = "In Progress"; +cah.$.AjaxRequest.prototype.dummyForAutocomplete = undefined; +cah.$.AjaxRequest.SERIAL = "s"; +cah.$.AjaxRequest.GAME_OPTIONS = "go"; +cah.$.AjaxRequest.MESSAGE = "m"; +cah.$.AjaxRequest.OP = "o"; +cah.$.AjaxRequest.NICKNAME = "n"; +cah.$.AjaxRequest.WALL = "wall"; +cah.$.AjaxRequest.PASSWORD = "pw"; +cah.$.AjaxRequest.EMOTE = "me"; +cah.$.AjaxRequest.CARD_ID = "cid"; +cah.$.AjaxRequest.CARDCAST_ID = "cci"; +cah.$.AjaxRequest.GAME_ID = "gid"; -cah.$.CardSetData = function() { +cah.$.AjaxResponse = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.CardSetData.prototype.dummyForAutocomplete = undefined; -cah.$.CardSetData.CARD_SET_DESCRIPTION = "csd"; -cah.$.CardSetData.WEIGHT = "w"; -cah.$.CardSetData.CARD_SET_NAME = "csn"; -cah.$.CardSetData.ID = "cid"; -cah.$.CardSetData.WHITE_CARDS_IN_DECK = "wcid"; -cah.$.CardSetData.BLACK_CARDS_IN_DECK = "bcid"; -cah.$.CardSetData.BASE_DECK = "bd"; +cah.$.AjaxResponse.prototype.dummyForAutocomplete = undefined; +cah.$.AjaxResponse.SERIAL = "s"; +cah.$.AjaxResponse.NAMES = "nl"; +cah.$.AjaxResponse.GAMES = "gl"; +cah.$.AjaxResponse.PLAYER_INFO = "pi"; +cah.$.AjaxResponse.GAME_ID = "gid"; +cah.$.AjaxResponse.WHITE_CARDS = "wc"; +cah.$.AjaxResponse.HAND = "h"; +cah.$.AjaxResponse.ERROR_CODE = "ec"; +cah.$.AjaxResponse.MAX_GAMES = "mg"; +cah.$.AjaxResponse.IN_PROGRESS = "ip"; +cah.$.AjaxResponse.GAME_OPTIONS = "go"; +cah.$.AjaxResponse.NICKNAME = "n"; +cah.$.AjaxResponse.BLACK_CARD = "bc"; +cah.$.AjaxResponse.NEXT = "next"; +cah.$.AjaxResponse.GAME_INFO = "gi"; +cah.$.AjaxResponse.CARD_ID = "cid"; +cah.$.AjaxResponse.ERROR = "e"; +cah.$.AjaxResponse.CARD_SETS = "css"; cah.$.BlackCardData = function() { // Dummy constructor to make Eclipse auto-complete. }; cah.$.BlackCardData.prototype.dummyForAutocomplete = undefined; -cah.$.BlackCardData.TEXT = "T"; +cah.$.BlackCardData.DRAW = "D"; cah.$.BlackCardData.PICK = "PK"; +cah.$.BlackCardData.TEXT = "T"; cah.$.BlackCardData.ID = "cid"; cah.$.BlackCardData.WATERMARK = "W"; -cah.$.BlackCardData.DRAW = "D"; - -cah.$.WhiteCardData = function() { - // Dummy constructor to make Eclipse auto-complete. -}; -cah.$.WhiteCardData.prototype.dummyForAutocomplete = undefined; -cah.$.WhiteCardData.WRITE_IN = "wi"; -cah.$.WhiteCardData.TEXT = "T"; -cah.$.WhiteCardData.ID = "cid"; -cah.$.WhiteCardData.WATERMARK = "W"; -cah.$.LongPollResponse = function() { +cah.$.CardSetData = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.LongPollResponse.prototype.dummyForAutocomplete = undefined; -cah.$.LongPollResponse.WALL = "wall"; -cah.$.LongPollResponse.WHITE_CARDS = "wc"; -cah.$.LongPollResponse.REASON = "qr"; -cah.$.LongPollResponse.GAME_ID = "gid"; -cah.$.LongPollResponse.EMOTE = "me"; -cah.$.LongPollResponse.HAND = "h"; -cah.$.LongPollResponse.INTERMISSION = "i"; -cah.$.LongPollResponse.PLAYER_INFO = "pi"; -cah.$.LongPollResponse.BLACK_CARD = "bc"; -cah.$.LongPollResponse.WINNING_CARD = "WC"; -cah.$.LongPollResponse.GAME_STATE = "gs"; -cah.$.LongPollResponse.NICKNAME = "n"; -cah.$.LongPollResponse.CARDCAST_DECK_INFO = "cdi"; -cah.$.LongPollResponse.PLAY_TIMER = "Pt"; -cah.$.LongPollResponse.MESSAGE = "m"; -cah.$.LongPollResponse.FROM_ADMIN = "fa"; -cah.$.LongPollResponse.GAME_INFO = "gi"; -cah.$.LongPollResponse.ERROR = "e"; -cah.$.LongPollResponse.EVENT = "E"; -cah.$.LongPollResponse.FROM = "f"; -cah.$.LongPollResponse.ERROR_CODE = "ec"; -cah.$.LongPollResponse.TIMESTAMP = "ts"; -cah.$.LongPollResponse.ROUND_WINNER = "rw"; +cah.$.CardSetData.prototype.dummyForAutocomplete = undefined; +cah.$.CardSetData.WHITE_CARDS_IN_DECK = "wcid"; +cah.$.CardSetData.BLACK_CARDS_IN_DECK = "bcid"; +cah.$.CardSetData.CARD_SET_NAME = "csn"; +cah.$.CardSetData.CARD_SET_DESCRIPTION = "csd"; +cah.$.CardSetData.BASE_DECK = "bd"; +cah.$.CardSetData.ID = "cid"; +cah.$.CardSetData.WEIGHT = "w"; -cah.$.LongPollEvent = function() { +cah.$.DisconnectReason = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.LongPollEvent.prototype.dummyForAutocomplete = undefined; -cah.$.LongPollEvent.KICKED = "k"; -cah.$.LongPollEvent.HURRY_UP = "hu"; -cah.$.LongPollEvent.GAME_JUDGE_SKIPPED = "gjs"; -cah.$.LongPollEvent.GAME_PLAYER_LEAVE = "gpl"; -cah.$.LongPollEvent.KICKED_FROM_GAME_IDLE = "kfgi"; -cah.$.LongPollEvent.GAME_ROUND_COMPLETE = "grc"; -cah.$.LongPollEvent.GAME_STATE_CHANGE = "gsc"; -cah.$.LongPollEvent.GAME_OPTIONS_CHANGED = "goc"; -cah.$.LongPollEvent.GAME_PLAYER_SKIPPED = "gps"; -cah.$.LongPollEvent.CHAT = "c"; -cah.$.LongPollEvent.BANNED = "B&"; -cah.$.LongPollEvent.GAME_SPECTATOR_LEAVE = "gvl"; -cah.$.LongPollEvent.CARDCAST_ADD_CARDSET = "cac"; -cah.$.LongPollEvent.NEW_PLAYER = "np"; -cah.$.LongPollEvent.GAME_PLAYER_JOIN = "gpj"; -cah.$.LongPollEvent.GAME_SPECTATOR_JOIN = "gvj"; -cah.$.LongPollEvent.GAME_LIST_REFRESH = "glr"; -cah.$.LongPollEvent.NOOP = "_"; -cah.$.LongPollEvent.GAME_PLAYER_KICKED_IDLE = "gpki"; -cah.$.LongPollEvent.GAME_PLAYER_INFO_CHANGE = "gpic"; -cah.$.LongPollEvent.CARDCAST_REMOVE_CARDSET = "crc"; -cah.$.LongPollEvent.GAME_BLACK_RESHUFFLE = "gbr"; -cah.$.LongPollEvent.GAME_WHITE_RESHUFFLE = "gwr"; -cah.$.LongPollEvent.PLAYER_LEAVE = "pl"; -cah.$.LongPollEvent.HAND_DEAL = "hd"; -cah.$.LongPollEvent.GAME_JUDGE_LEFT = "gjl"; +cah.$.DisconnectReason.prototype.dummyForAutocomplete = undefined; +cah.$.DisconnectReason.PING_TIMEOUT = "pt"; +cah.$.DisconnectReason.BANNED = "B&"; +cah.$.DisconnectReason.IDLE_TIMEOUT = "it"; +cah.$.DisconnectReason.KICKED = "k"; +cah.$.DisconnectReason.MANUAL = "man"; cah.$.ErrorCode = function() { // Dummy constructor to make Eclipse auto-complete. }; cah.$.ErrorCode.prototype.dummyForAutocomplete = undefined; -cah.$.ErrorCode.TOO_MANY_GAMES = "tmg"; -cah.$.ErrorCode.NO_CARD_SPECIFIED = "ncs"; -cah.$.ErrorCode.ACCESS_DENIED = "ad"; +cah.$.ErrorCode.INVALID_NICK = "in"; +cah.$.ErrorCode.TOO_MANY_USERS = "tmu"; cah.$.ErrorCode.NOT_GAME_HOST = "ngh"; -cah.$.ErrorCode.CANNOT_JOIN_ANOTHER_GAME = "cjag"; -cah.$.ErrorCode.INVALID_CARD = "ic"; +cah.$.ErrorCode.MESSAGE_TOO_LONG = "mtl"; +cah.$.ErrorCode.NO_NICK_SPECIFIED = "nns"; +cah.$.ErrorCode.BANNED = "B&"; +cah.$.ErrorCode.WRONG_PASSWORD = "wp"; cah.$.ErrorCode.RESERVED_NICK = "rn"; -cah.$.ErrorCode.TOO_MANY_USERS = "tmu"; -cah.$.ErrorCode.NO_GAME_SPECIFIED = "ngs"; -cah.$.ErrorCode.SESSION_EXPIRED = "se"; -cah.$.ErrorCode.CARDCAST_INVALID_ID = "cii"; -cah.$.ErrorCode.BAD_OP = "bo"; -cah.$.ErrorCode.TOO_FAST = "tf"; +cah.$.ErrorCode.TOO_MANY_GAMES = "tmg"; +cah.$.ErrorCode.CANNOT_JOIN_ANOTHER_GAME = "cjag"; +cah.$.ErrorCode.NO_MSG_SPECIFIED = "nms"; +cah.$.ErrorCode.ALREADY_STARTED = "as"; +cah.$.ErrorCode.NOT_ADMIN = "na"; +cah.$.ErrorCode.INVALID_GAME = "ig"; cah.$.ErrorCode.NO_SESSION = "ns"; -cah.$.ErrorCode.NOT_REGISTERED = "nr"; -cah.$.ErrorCode.OP_NOT_SPECIFIED = "ons"; -cah.$.ErrorCode.NOT_JUDGE = "nj"; -cah.$.ErrorCode.WRONG_PASSWORD = "wp"; -cah.$.ErrorCode.NOT_IN_THAT_GAME = "nitg"; +cah.$.ErrorCode.ACCESS_DENIED = "ad"; cah.$.ErrorCode.NICK_IN_USE = "niu"; +cah.$.ErrorCode.NOT_JUDGE = "nj"; cah.$.ErrorCode.SERVER_ERROR = "serr"; -cah.$.ErrorCode.GAME_FULL = "gf"; -cah.$.ErrorCode.NO_NICK_SPECIFIED = "nns"; -cah.$.ErrorCode.NOT_ADMIN = "na"; -cah.$.ErrorCode.NOT_YOUR_TURN = "nyt"; -cah.$.ErrorCode.BANNED = "B&"; -cah.$.ErrorCode.INVALID_NICK = "in"; -cah.$.ErrorCode.ALREADY_STARTED = "as"; +cah.$.ErrorCode.CARDCAST_INVALID_ID = "cii"; +cah.$.ErrorCode.TOO_FAST = "tf"; +cah.$.ErrorCode.NOT_ENOUGH_CARDS = "nec"; +cah.$.ErrorCode.NO_CARD_SPECIFIED = "ncs"; +cah.$.ErrorCode.NO_GAME_SPECIFIED = "ngs"; +cah.$.ErrorCode.OP_NOT_SPECIFIED = "ons"; cah.$.ErrorCode.BAD_REQUEST = "br"; +cah.$.ErrorCode.NOT_ENOUGH_PLAYERS = "nep"; +cah.$.ErrorCode.CARDCAST_CANNOT_FIND = "ccf"; +cah.$.ErrorCode.NOT_IN_THAT_GAME = "nitg"; cah.$.ErrorCode.NO_SUCH_USER = "nsu"; +cah.$.ErrorCode.NOT_REGISTERED = "nr"; +cah.$.ErrorCode.BAD_OP = "bo"; cah.$.ErrorCode.DO_NOT_HAVE_CARD = "dnhc"; -cah.$.ErrorCode.MESSAGE_TOO_LONG = "mtl"; +cah.$.ErrorCode.NOT_YOUR_TURN = "nyt"; cah.$.ErrorCode.ALREADY_STOPPED = "aS"; -cah.$.ErrorCode.NOT_ENOUGH_PLAYERS = "nep"; -cah.$.ErrorCode.INVALID_GAME = "ig"; -cah.$.ErrorCode.CARDCAST_CANNOT_FIND = "ccf"; -cah.$.ErrorCode.NO_MSG_SPECIFIED = "nms"; -cah.$.ErrorCode.NOT_ENOUGH_CARDS = "nec"; -cah.$.ErrorCode_msg = {}; -cah.$.ErrorCode_msg['tmg'] = "There are too many games already in progress. Either join an existing game, or wait for one to become available."; -cah.$.ErrorCode_msg['ncs'] = "No card specified."; -cah.$.ErrorCode_msg['ns'] = "Session not detected. Make sure you have cookies enabled."; -cah.$.ErrorCode_msg['rn'] = "That nick is reserved."; +cah.$.ErrorCode.SESSION_EXPIRED = "se"; +cah.$.ErrorCode.GAME_FULL = "gf"; +cah.$.ErrorCode.INVALID_CARD = "ic"; +cah.$.ErrorCode_msg = {}; +cah.$.ErrorCode_msg['cii'] = "Invalid Cardcast ID. Must be exactly 5 characters."; cah.$.ErrorCode_msg['nr'] = "Not registered. Refresh the page."; -cah.$.ErrorCode_msg['nitg'] = "You are not in that game."; -cah.$.ErrorCode_msg['nep'] = "There are not enough players to start the game."; -cah.$.ErrorCode_msg['tf'] = "You are chatting too fast. Wait a few seconds and try again."; +cah.$.ErrorCode_msg['ns'] = "Session not detected. Make sure you have cookies enabled."; +cah.$.ErrorCode_msg['ccf'] = "Cannot find Cardcast deck with given ID. If you just added this deck to Cardcast, wait a few minutes and try again."; cah.$.ErrorCode_msg['nyt'] = "It is not your turn to play a card."; -cah.$.ErrorCode_msg['gf'] = "That game is full. Join another."; -cah.$.ErrorCode_msg['aS'] = "The game has already stopped."; -cah.$.ErrorCode_msg['mtl'] = "Messages cannot be longer than 200 characters."; -cah.$.ErrorCode_msg['br'] = "Bad request."; -cah.$.ErrorCode_msg['ngs'] = "No game specified."; -cah.$.ErrorCode_msg['ic'] = "Invalid card specified."; cah.$.ErrorCode_msg['bo'] = "Invalid operation."; -cah.$.ErrorCode_msg['tmu'] = "There are too many users connected. Either join another server, or wait for a user to disconnect."; -cah.$.ErrorCode_msg['dnhc'] = "You don't have that card."; -cah.$.ErrorCode_msg['ons'] = "Operation not specified."; -cah.$.ErrorCode_msg['cjag'] = "You cannot join another game."; -cah.$.ErrorCode_msg['ig'] = "Invalid game specified."; -cah.$.ErrorCode_msg['nns'] = "No nickname specified."; -cah.$.ErrorCode_msg['cii'] = "Invalid Cardcast ID. Must be exactly 5 characters."; -cah.$.ErrorCode_msg['ngh'] = "Only the game host can do that."; cah.$.ErrorCode_msg['nec'] = "You must add card sets containing at least 50 black cards and 20 times the player limit white cards."; -cah.$.ErrorCode_msg['serr'] = "An error occured on the server."; -cah.$.ErrorCode_msg['ccf'] = "Cannot find Cardcast deck with given ID. If you just added this deck to Cardcast, wait a few minutes and try again."; +cah.$.ErrorCode_msg['ngh'] = "Only the game host can do that."; +cah.$.ErrorCode_msg['tmg'] = "There are too many games already in progress. Either join an existing game, or wait for one to become available."; +cah.$.ErrorCode_msg['br'] = "Bad request."; cah.$.ErrorCode_msg['nsu'] = "No such user."; -cah.$.ErrorCode_msg['wp'] = "That password is incorrect."; -cah.$.ErrorCode_msg['as'] = "The game has already started."; +cah.$.ErrorCode_msg['aS'] = "The game has already stopped."; cah.$.ErrorCode_msg['se'] = "Your session has expired. Refresh the page."; -cah.$.ErrorCode_msg['in'] = "Nickname must contain only upper and lower case letters, numbers, or underscores, must be 3 to 30 characters long, and must not start with a number."; cah.$.ErrorCode_msg['nms'] = "No message specified."; -cah.$.ErrorCode_msg['na'] = "You are not an administrator."; +cah.$.ErrorCode_msg['nep'] = "There are not enough players to start the game."; +cah.$.ErrorCode_msg['wp'] = "That password is incorrect."; +cah.$.ErrorCode_msg['ic'] = "Invalid card specified."; cah.$.ErrorCode_msg['niu'] = "Nickname is already in use."; -cah.$.ErrorCode_msg['B&'] = "Banned."; +cah.$.ErrorCode_msg['ngs'] = "No game specified."; +cah.$.ErrorCode_msg['nitg'] = "You are not in that game."; +cah.$.ErrorCode_msg['tmu'] = "There are too many users connected. Either join another server, or wait for a user to disconnect."; +cah.$.ErrorCode_msg['ig'] = "Invalid game specified."; +cah.$.ErrorCode_msg['gf'] = "That game is full. Join another."; +cah.$.ErrorCode_msg['ncs'] = "No card specified."; cah.$.ErrorCode_msg['ad'] = "Access denied."; +cah.$.ErrorCode_msg['cjag'] = "You cannot join another game."; +cah.$.ErrorCode_msg['B&'] = "Banned."; +cah.$.ErrorCode_msg['mtl'] = "Messages cannot be longer than 200 characters."; +cah.$.ErrorCode_msg['in'] = "Nickname must contain only upper and lower case letters, numbers, or underscores, must be 3 to 30 characters long, and must not start with a number."; +cah.$.ErrorCode_msg['serr'] = "An error occured on the server."; +cah.$.ErrorCode_msg['dnhc'] = "You don't have that card."; +cah.$.ErrorCode_msg['as'] = "The game has already started."; +cah.$.ErrorCode_msg['nns'] = "No nickname specified."; +cah.$.ErrorCode_msg['tf'] = "You are chatting too fast. Wait a few seconds and try again."; +cah.$.ErrorCode_msg['na'] = "You are not an administrator."; +cah.$.ErrorCode_msg['ons'] = "Operation not specified."; cah.$.ErrorCode_msg['nj'] = "You are not the judge."; +cah.$.ErrorCode_msg['rn'] = "That nick is reserved."; cah.$.ErrorInformation = function() { // Dummy constructor to make Eclipse auto-complete. }; cah.$.ErrorInformation.prototype.dummyForAutocomplete = undefined; -cah.$.ErrorInformation.WHITE_CARDS_REQUIRED = "wcr"; cah.$.ErrorInformation.WHITE_CARDS_PRESENT = "wcp"; +cah.$.ErrorInformation.WHITE_CARDS_REQUIRED = "wcr"; cah.$.ErrorInformation.BLACK_CARDS_REQUIRED = "bcr"; cah.$.ErrorInformation.BLACK_CARDS_PRESENT = "bcp"; -cah.$.AjaxResponse = function() { +cah.$.GameInfo = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.AjaxResponse.prototype.dummyForAutocomplete = undefined; -cah.$.AjaxResponse.WHITE_CARDS = "wc"; -cah.$.AjaxResponse.CARD_SETS = "css"; -cah.$.AjaxResponse.GAME_ID = "gid"; -cah.$.AjaxResponse.HAND = "h"; -cah.$.AjaxResponse.PLAYER_INFO = "pi"; -cah.$.AjaxResponse.BLACK_CARD = "bc"; -cah.$.AjaxResponse.GAME_OPTIONS = "go"; -cah.$.AjaxResponse.IN_PROGRESS = "ip"; -cah.$.AjaxResponse.GAMES = "gl"; -cah.$.AjaxResponse.NICKNAME = "n"; -cah.$.AjaxResponse.CARD_ID = "cid"; -cah.$.AjaxResponse.NEXT = "next"; -cah.$.AjaxResponse.GAME_INFO = "gi"; -cah.$.AjaxResponse.ERROR = "e"; -cah.$.AjaxResponse.ERROR_CODE = "ec"; -cah.$.AjaxResponse.SERIAL = "s"; -cah.$.AjaxResponse.MAX_GAMES = "mg"; -cah.$.AjaxResponse.NAMES = "nl"; +cah.$.GameInfo.prototype.dummyForAutocomplete = undefined; +cah.$.GameInfo.GAME_OPTIONS = "go"; +cah.$.GameInfo.PLAYERS = "P"; +cah.$.GameInfo.SPECTATORS = "V"; +cah.$.GameInfo.HOST = "H"; +cah.$.GameInfo.STATE = "S"; +cah.$.GameInfo.ID = "gid"; +cah.$.GameInfo.HAS_PASSWORD = "hp"; -cah.$.AjaxRequest = function() { +cah.$.GameOptionData = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.AjaxRequest.prototype.dummyForAutocomplete = undefined; -cah.$.AjaxRequest.WALL = "wall"; -cah.$.AjaxRequest.MESSAGE = "m"; -cah.$.AjaxRequest.CARD_ID = "cid"; -cah.$.AjaxRequest.GAME_ID = "gid"; -cah.$.AjaxRequest.EMOTE = "me"; -cah.$.AjaxRequest.CARDCAST_ID = "cci"; -cah.$.AjaxRequest.GAME_OPTIONS = "go"; -cah.$.AjaxRequest.SERIAL = "s"; -cah.$.AjaxRequest.PASSWORD = "pw"; -cah.$.AjaxRequest.OP = "o"; -cah.$.AjaxRequest.NICKNAME = "n"; +cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined; +cah.$.GameOptionData.PASSWORD = "pw"; +cah.$.GameOptionData.SPECTATOR_LIMIT = "vL"; +cah.$.GameOptionData.SCORE_LIMIT = "sl"; +cah.$.GameOptionData.BLANKS_LIMIT = "bl"; +cah.$.GameOptionData.PLAYER_LIMIT = "pL"; +cah.$.GameOptionData.USE_TIMER = "ut"; +cah.$.GameOptionData.CARD_SETS = "css"; -cah.$.AjaxOperation = function() { +cah.$.GamePlayerInfo = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.AjaxOperation.prototype.dummyForAutocomplete = undefined; -cah.$.AjaxOperation.FIRST_LOAD = "fl"; -cah.$.AjaxOperation.START_GAME = "sg"; -cah.$.AjaxOperation.JUDGE_SELECT = "js"; -cah.$.AjaxOperation.LOG_OUT = "lo"; -cah.$.AjaxOperation.GAME_LIST = "ggl"; -cah.$.AjaxOperation.CHANGE_GAME_OPTIONS = "cgo"; -cah.$.AjaxOperation.PLAY_CARD = "pc"; -cah.$.AjaxOperation.CREATE_GAME = "cg"; -cah.$.AjaxOperation.CARDCAST_LIST_CARDSETS = "clc"; -cah.$.AjaxOperation.GAME_CHAT = "GC"; -cah.$.AjaxOperation.KICK = "K"; -cah.$.AjaxOperation.ADMIN_SET_VERBOSE_LOG = "svl"; -cah.$.AjaxOperation.GET_CARDS = "gc"; -cah.$.AjaxOperation.JOIN_GAME = "jg"; -cah.$.AjaxOperation.CHAT = "c"; -cah.$.AjaxOperation.NAMES = "gn"; -cah.$.AjaxOperation.SPECTATE_GAME = "vg"; -cah.$.AjaxOperation.BAN = "b"; -cah.$.AjaxOperation.SCORE = "SC"; -cah.$.AjaxOperation.GET_GAME_INFO = "ggi"; -cah.$.AjaxOperation.CARDCAST_ADD_CARDSET = "cac"; -cah.$.AjaxOperation.CARDCAST_REMOVE_CARDSET = "crc"; -cah.$.AjaxOperation.REGISTER = "r"; -cah.$.AjaxOperation.STOP_GAME = "Sg"; -cah.$.AjaxOperation.LEAVE_GAME = "lg"; +cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined; +cah.$.GamePlayerInfo.STATUS = "st"; +cah.$.GamePlayerInfo.SCORE = "sc"; +cah.$.GamePlayerInfo.NAME = "N"; + +cah.$.GamePlayerStatus = function() { + // Dummy constructor to make Eclipse auto-complete. +}; +cah.$.GamePlayerStatus.prototype.dummyForAutocomplete = undefined; +cah.$.GamePlayerStatus.SPECTATOR = "sv"; +cah.$.GamePlayerStatus.WINNER = "sw"; +cah.$.GamePlayerStatus.IDLE = "si"; +cah.$.GamePlayerStatus.HOST = "sh"; +cah.$.GamePlayerStatus.JUDGING = "sjj"; +cah.$.GamePlayerStatus.JUDGE = "sj"; +cah.$.GamePlayerStatus.PLAYING = "sp"; +cah.$.GamePlayerStatus_msg = {}; +cah.$.GamePlayerStatus_msg['sjj'] = "Selecting"; +cah.$.GamePlayerStatus_msg['sv'] = "Spectator"; +cah.$.GamePlayerStatus_msg['sw'] = "Winner!"; +cah.$.GamePlayerStatus_msg['sh'] = "Host"; +cah.$.GamePlayerStatus_msg['si'] = ""; +cah.$.GamePlayerStatus_msg['sj'] = "Card Czar"; +cah.$.GamePlayerStatus_msg['sp'] = "Playing"; +cah.$.GamePlayerStatus_msg_2 = {}; +cah.$.GamePlayerStatus_msg_2['sjj'] = "Select a winning card."; +cah.$.GamePlayerStatus_msg_2['sv'] = "You are just spectating."; +cah.$.GamePlayerStatus_msg_2['sw'] = "You have won!"; +cah.$.GamePlayerStatus_msg_2['sh'] = "Wait for players then click Start Game."; +cah.$.GamePlayerStatus_msg_2['si'] = "Waiting for players..."; +cah.$.GamePlayerStatus_msg_2['sj'] = "You are the Card Czar."; +cah.$.GamePlayerStatus_msg_2['sp'] = "Select a card to play."; + +cah.$.GameState = function() { + // Dummy constructor to make Eclipse auto-complete. +}; +cah.$.GameState.prototype.dummyForAutocomplete = undefined; +cah.$.GameState.ROUND_OVER = "ro"; +cah.$.GameState.LOBBY = "l"; +cah.$.GameState.DEALING = "d"; +cah.$.GameState.JUDGING = "j"; +cah.$.GameState.PLAYING = "p"; +cah.$.GameState_msg = {}; +cah.$.GameState_msg['p'] = "In Progress"; +cah.$.GameState_msg['d'] = "In Progress"; +cah.$.GameState_msg['j'] = "In Progress"; +cah.$.GameState_msg['l'] = "Not Started"; +cah.$.GameState_msg['ro'] = "In Progress"; + +cah.$.LongPollEvent = function() { + // Dummy constructor to make Eclipse auto-complete. +}; +cah.$.LongPollEvent.prototype.dummyForAutocomplete = undefined; +cah.$.LongPollEvent.GAME_ROUND_COMPLETE = "grc"; +cah.$.LongPollEvent.BANNED = "B&"; +cah.$.LongPollEvent.NOOP = "_"; +cah.$.LongPollEvent.CHAT = "c"; +cah.$.LongPollEvent.GAME_PLAYER_INFO_CHANGE = "gpic"; +cah.$.LongPollEvent.HAND_DEAL = "hd"; +cah.$.LongPollEvent.CARDCAST_ADD_CARDSET = "cac"; +cah.$.LongPollEvent.PLAYER_LEAVE = "pl"; +cah.$.LongPollEvent.GAME_BLACK_RESHUFFLE = "gbr"; +cah.$.LongPollEvent.GAME_JUDGE_SKIPPED = "gjs"; +cah.$.LongPollEvent.GAME_LIST_REFRESH = "glr"; +cah.$.LongPollEvent.NEW_PLAYER = "np"; +cah.$.LongPollEvent.GAME_PLAYER_SKIPPED = "gps"; +cah.$.LongPollEvent.GAME_PLAYER_JOIN = "gpj"; +cah.$.LongPollEvent.GAME_WHITE_RESHUFFLE = "gwr"; +cah.$.LongPollEvent.CARDCAST_REMOVE_CARDSET = "crc"; +cah.$.LongPollEvent.GAME_OPTIONS_CHANGED = "goc"; +cah.$.LongPollEvent.GAME_PLAYER_KICKED_IDLE = "gpki"; +cah.$.LongPollEvent.GAME_SPECTATOR_LEAVE = "gvl"; +cah.$.LongPollEvent.GAME_PLAYER_LEAVE = "gpl"; +cah.$.LongPollEvent.GAME_SPECTATOR_JOIN = "gvj"; +cah.$.LongPollEvent.HURRY_UP = "hu"; +cah.$.LongPollEvent.GAME_JUDGE_LEFT = "gjl"; +cah.$.LongPollEvent.KICKED = "k"; +cah.$.LongPollEvent.KICKED_FROM_GAME_IDLE = "kfgi"; +cah.$.LongPollEvent.GAME_STATE_CHANGE = "gsc"; + +cah.$.LongPollResponse = function() { + // Dummy constructor to make Eclipse auto-complete. +}; +cah.$.LongPollResponse.prototype.dummyForAutocomplete = undefined; +cah.$.LongPollResponse.WALL = "wall"; +cah.$.LongPollResponse.PLAY_TIMER = "Pt"; +cah.$.LongPollResponse.ROUND_WINNER = "rw"; +cah.$.LongPollResponse.EMOTE = "me"; +cah.$.LongPollResponse.CARDCAST_DECK_INFO = "cdi"; +cah.$.LongPollResponse.PLAYER_INFO = "pi"; +cah.$.LongPollResponse.FROM = "f"; +cah.$.LongPollResponse.GAME_ID = "gid"; +cah.$.LongPollResponse.WHITE_CARDS = "wc"; +cah.$.LongPollResponse.EVENT = "E"; +cah.$.LongPollResponse.HAND = "h"; +cah.$.LongPollResponse.ERROR_CODE = "ec"; +cah.$.LongPollResponse.MESSAGE = "m"; +cah.$.LongPollResponse.WINNING_CARD = "WC"; +cah.$.LongPollResponse.NICKNAME = "n"; +cah.$.LongPollResponse.BLACK_CARD = "bc"; +cah.$.LongPollResponse.FROM_ADMIN = "fa"; +cah.$.LongPollResponse.TIMESTAMP = "ts"; +cah.$.LongPollResponse.GAME_STATE = "gs"; +cah.$.LongPollResponse.GAME_INFO = "gi"; +cah.$.LongPollResponse.ERROR = "e"; +cah.$.LongPollResponse.INTERMISSION = "i"; +cah.$.LongPollResponse.REASON = "qr"; cah.$.ReconnectNextAction = function() { // Dummy constructor to make Eclipse auto-complete. @@ -335,13 +336,12 @@ cah.$.ReconnectNextAction.prototype.dummyForAutocomplete = undefined; cah.$.ReconnectNextAction.GAME = "game"; cah.$.ReconnectNextAction.NONE = "none"; -cah.$.DisconnectReason = function() { +cah.$.WhiteCardData = function() { // Dummy constructor to make Eclipse auto-complete. }; -cah.$.DisconnectReason.prototype.dummyForAutocomplete = undefined; -cah.$.DisconnectReason.BANNED = "B&"; -cah.$.DisconnectReason.PING_TIMEOUT = "pt"; -cah.$.DisconnectReason.KICKED = "k"; -cah.$.DisconnectReason.MANUAL = "man"; -cah.$.DisconnectReason.IDLE_TIMEOUT = "it"; +cah.$.WhiteCardData.prototype.dummyForAutocomplete = undefined; +cah.$.WhiteCardData.WRITE_IN = "wi"; +cah.$.WhiteCardData.TEXT = "T"; +cah.$.WhiteCardData.ID = "cid"; +cah.$.WhiteCardData.WATERMARK = "W"; diff --git a/pom.xml b/pom.xml index f1f20618..4d793e99 100644 --- a/pom.xml +++ b/pom.xml @@ -1,326 +1,324 @@ - 4.0.0 + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + 4.0.0 - net.socialgamer - pyx - 0.5.0-SNAPSHOT - jar + net.socialgamer + pyx + 0.5.0-SNAPSHOT + war - pyx + pyx - - https://github.com/ajanata/PretendYoureXyzzy - + + https://github.com/ajanata/PretendYoureXyzzy + - - UTF-8 - - - - - hibernatesqlite-maven - https://hibernate-sqlite.googlecode.com/svn/trunk/mavenrepo - - + + UTF-8 + 4.3.8.Final + 1.7.10 + 4.0-beta + - - - ajanata - Andy Janata - ajanata@gmail.com - - + + + hibernatesqlite-maven + https://hibernate-sqlite.googlecode.com/svn/trunk/mavenrepo + + + - - ROOT - - - org.codehaus.mojo - exec-maven-plugin - 1.1 - - - update-js-constants - package - - java - - - - - net.socialgamer.cah.UpdateJsConstants - - - - maven-compiler-plugin - 3.1 - - 1.7 - 1.7 - ${java.home}/bin + + + ajanata + Andy Janata + ajanata@gmail.com + + - - false - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.3.1 - - - enforce-files-exist - validate - - enforce - - - - - - build.properties - - - - true - - - - - - - org.codehaus.mojo - properties-maven-plugin - 1.0-alpha-2 - - - read-build-properties - initialize - - read-project-properties - - - - read-report-properties - pre-site - - read-project-properties - - - - - - build.properties - - - - - org.apache.maven.plugins - maven-war-plugin - 2.4 + + ROOT + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + + update-js-constants + package + + java + + + + + net.socialgamer.cah.UpdateJsConstants + + + + maven-compiler-plugin + 3.1 + + 1.8 + 1.8 + ${java.home}/bin - - + + false + + + + org.apache.maven.plugins + maven-enforcer-plugin + 1.3.1 + + + enforce-files-exist + validate + + enforce + + + + + + build.properties + + + + true + + + + + + + org.codehaus.mojo + properties-maven-plugin + 1.0-alpha-2 + + + read-build-properties + initialize + + read-project-properties + + + + read-report-properties + pre-site + + read-project-properties + + + + + + build.properties + + + + + org.apache.maven.plugins + maven-war-plugin + 2.4 - - - - src/main/resources - false - - - src/main/filtered-resources - true - - - WebContent - false - - + + - - false + + + + src/main/resources + false + + + src/main/filtered-resources + true + + + WebContent + false + + - - true - - - - org.eclipse.jetty - jetty-maven-plugin - 9.1.2.v20140210 + + false - - - - - - ${project.build.directory}/${project.build.artifact.name}/WEB-INF/web.xml - - - src/main/resources - - ${project.build.directory}/ROOT - - - - src/main/filtered-resources - - 0 - manual - WebContent - 8081 - STOP - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - - org.codehaus.mojo - - - properties-maven-plugin - - - [1.0-alpha-2,) - - - - read-project-properties - - - - - - - - - - - - - - + + true + + + + org.eclipse.jetty + jetty-maven-plugin + 9.1.2.v20140210 - - - com.google.inject - guice - 3.0 - - - com.google.inject.extensions - guice-assistedinject - 3.0 - - - com.google.inject.extensions - guice-servlet - 3.0 - - - commons-collections - commons-collections - 3.1 - - - org.apache.commons - commons-lang3 - 3.1 - - - org.hibernate - hibernate-core - 3.6.10.Final - - - com.googlecode.json-simple - json-simple - 1.1 - - - javax.servlet - javax.servlet-api - 3.0.1 - - - org.xerial - sqlite-jdbc - 3.8.7 - - - org.slf4j - slf4j-log4j12 - 1.6.1 - runtime - - - org.slf4j - slf4j-api - 1.6.1 - compile - - - log4j - log4j - 1.2.17 - - - postgresql - postgresql - 8.4-702.jdbc3 - - - org.easymock - easymock - 3.1 - test - - - junit - junit - 4.11 - test - - - net.sourceforge.findbugs - jsr305 - 1.3.2 - compile - - - org.javassist - javassist - 3.19.0-GA - runtime - - + + + + + + ${project.build.directory}/${project.build.artifact.name}/WEB-INF/web.xml + + + + src/main/resources + + ${project.build.directory}/ROOT + + + + src/main/filtered-resources + + 0 + manual + WebContent + 8081 + STOP + + + + + + + + org.eclipse.m2e + lifecycle-mapping + 1.0.0 + + + + + + + org.codehaus.mojo + + + properties-maven-plugin + + + [1.0-alpha-2,) + + + + read-project-properties + + + + + + + + + + + + + + + + + + com.google.inject + guice + ${com.google.inject.version} + + + com.google.inject.extensions + guice-assistedinject + ${com.google.inject.version} + + + com.google.inject.extensions + guice-servlet + ${com.google.inject.version} + + + org.apache.commons + commons-collections4 + 4.0 + + + org.apache.commons + commons-lang3 + 3.3.2 + + + org.hibernate + hibernate-core + ${org.hibernate.version} + + + org.hibernate + hibernate-c3p0 + ${org.hibernate.version} + + + com.googlecode.json-simple + json-simple + 1.1.1 + + + javax.servlet + javax.servlet-api + 3.1.0 + + + org.xerial + sqlite-jdbc + 3.8.7 + + + org.slf4j + slf4j-log4j12 + ${org.slf4j.version} + runtime + + + org.slf4j + slf4j-api + ${org.slf4j.version} + compile + + + log4j + log4j + 1.2.17 + + + org.postgresql + postgresql + 9.4-1200-jdbc41 + + + org.easymock + easymock + 3.3.1 + test + + + junit + junit + 4.12 + test + + + com.google.code.findbugs + jsr305 + 3.0.0 + compile + + + org.javassist + javassist + 3.19.0-GA + runtime + + diff --git a/src/main/filtered-resources/WEB-INF/classes/hibernate.cfg.xml b/src/main/filtered-resources/WEB-INF/classes/hibernate.cfg.xml index 8929c62a..3f545202 100644 --- a/src/main/filtered-resources/WEB-INF/classes/hibernate.cfg.xml +++ b/src/main/filtered-resources/WEB-INF/classes/hibernate.cfg.xml @@ -1,25 +1,38 @@ + "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> - - ${hibernate.dialect} - ${hibernate.driver_class} - ${hibernate.url} - ${hibernate.username} - ${hibernate.password} - org.hibernate.transaction.JDBCTransactionFactory + + org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider + ${hibernate.dialect} + ${hibernate.driver_class} + ${hibernate.url} + ${hibernate.username} + ${hibernate.password} + org.hibernate.transaction.JDBCTransactionFactory + + + 3 + 25 + 3000 + 50 + 300 + 5 + 10000 + ${hibernate.cache.use_second_level_cache} ${hibernate.cache.provider_class} ${hibernate.cache.use_query_cache} - ${hibernate.sql.show} - ${hibernate.sql.format} - - - - - + ${hibernate.sql.show} + ${hibernate.sql.format} + + + + + + + diff --git a/src/main/java/net/socialgamer/cah/HibernateUtil.java b/src/main/java/net/socialgamer/cah/HibernateUtil.java index 23751569..0d38f467 100644 --- a/src/main/java/net/socialgamer/cah/HibernateUtil.java +++ b/src/main/java/net/socialgamer/cah/HibernateUtil.java @@ -1,16 +1,16 @@ /** * Copyright (c) 2012, Andy Janata * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: - * + * * * Redistributions of source code must retain the above copyright notice, this list of conditions * and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR @@ -23,13 +23,16 @@ package net.socialgamer.cah; +import org.hibernate.HibernateException; import org.hibernate.SessionFactory; -import org.hibernate.cfg.AnnotationConfiguration; +import org.hibernate.boot.registry.StandardServiceRegistryBuilder; +import org.hibernate.cfg.Configuration; +import org.hibernate.service.ServiceRegistry; /** * Utility class for Hibernate. - * + * * @author Andy Janata (ajanata@socialgamer.net) */ public class HibernateUtil { @@ -39,8 +42,19 @@ public class HibernateUtil { * Hibernate session factory to use. */ public final SessionFactory sessionFactory; + private static ServiceRegistry serviceRegistry; private HibernateUtil() { - sessionFactory = new AnnotationConfiguration().configure().buildSessionFactory(); + final Configuration configuration = new Configuration(); + try { + configuration + .configure(); + } catch (final HibernateException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + serviceRegistry = new StandardServiceRegistryBuilder().applySettings( + configuration.getProperties()).build(); + sessionFactory = configuration.buildSessionFactory(serviceRegistry); } } diff --git a/src/main/java/net/socialgamer/cah/handlers/PlayCardHandler.java b/src/main/java/net/socialgamer/cah/handlers/PlayCardHandler.java index 969704f2..21cf6d50 100644 --- a/src/main/java/net/socialgamer/cah/handlers/PlayCardHandler.java +++ b/src/main/java/net/socialgamer/cah/handlers/PlayCardHandler.java @@ -1,16 +1,16 @@ /** * Copyright (c) 2012, Andy Janata * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: - * + * * * Redistributions of source code must retain the above copyright notice, this list of conditions * and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR @@ -44,7 +44,7 @@ /** * Handler to play a card. - * + * * @author Andy Janata (ajanata@socialgamer.net) */ public class PlayCardHandler extends GameWithPlayerHandler { @@ -74,7 +74,7 @@ public Map handleWithUserInGame(final RequestWrapper req String text = request.getParameter(AjaxRequest.MESSAGE); if (text != null && text.contains("<")) { // somebody must be using a hacked client, because this should have been escaped already. - text = StringEscapeUtils.escapeXml(text); + text = StringEscapeUtils.escapeXml11(text); } final ErrorCode ec = game.playCard(user, cardId, text); diff --git a/src/main/java/net/socialgamer/cah/hibernate/SqliteDialect.java b/src/main/java/net/socialgamer/cah/hibernate/SqliteDialect.java index 0e7eb394..89d4fd88 100644 --- a/src/main/java/net/socialgamer/cah/hibernate/SqliteDialect.java +++ b/src/main/java/net/socialgamer/cah/hibernate/SqliteDialect.java @@ -13,11 +13,11 @@ import java.sql.Types; -import org.hibernate.Hibernate; import org.hibernate.dialect.Dialect; import org.hibernate.dialect.function.SQLFunctionTemplate; import org.hibernate.dialect.function.StandardSQLFunction; import org.hibernate.dialect.function.VarArgsSQLFunction; +import org.hibernate.type.StandardBasicTypes; public class SqliteDialect extends Dialect { @@ -47,10 +47,10 @@ public SqliteDialect() { registerColumnType(Types.CLOB, "clob"); registerColumnType(Types.BOOLEAN, "integer"); - registerFunction("concat", new VarArgsSQLFunction(Hibernate.STRING, "", "||", "")); - registerFunction("mod", new SQLFunctionTemplate(Hibernate.INTEGER, "?1 % ?2")); - registerFunction("substr", new StandardSQLFunction("substr", Hibernate.STRING)); - registerFunction("substring", new StandardSQLFunction("substr", Hibernate.STRING)); + registerFunction("concat", new VarArgsSQLFunction(StandardBasicTypes.STRING, "", "||", "")); + registerFunction("mod", new SQLFunctionTemplate(StandardBasicTypes.INTEGER, "?1 % ?2")); + registerFunction("substr", new StandardSQLFunction("substr", StandardBasicTypes.STRING)); + registerFunction("substring", new StandardSQLFunction("substr", StandardBasicTypes.STRING)); } @Override diff --git a/src/main/java/net/socialgamer/cah/servlets/Schema.java b/src/main/java/net/socialgamer/cah/servlets/Schema.java index d83f387d..9fd1528e 100644 --- a/src/main/java/net/socialgamer/cah/servlets/Schema.java +++ b/src/main/java/net/socialgamer/cah/servlets/Schema.java @@ -1,16 +1,16 @@ /** * Copyright (c) 2012, Andy Janata * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: - * + * * * Redistributions of source code must retain the above copyright notice, this list of conditions * and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR @@ -32,13 +32,13 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.hibernate.cfg.AnnotationConfiguration; -import org.hibernate.dialect.PostgreSQLDialect; +import org.hibernate.cfg.Configuration; +import org.hibernate.dialect.PostgreSQL82Dialect; /** * Servlet implementation class Schema. - * + * * Get the database schema for known Hibernate objects. */ @WebServlet("/Schema") @@ -51,9 +51,9 @@ public class Schema extends HttpServlet { @Override protected void doGet(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException { - final AnnotationConfiguration c = new AnnotationConfiguration(); + final Configuration c = new Configuration(); c.configure(); - final String[] ls = c.generateSchemaCreationScript(new PostgreSQLDialect()); + final String[] ls = c.generateSchemaCreationScript(new PostgreSQL82Dialect()); final PrintWriter out = response.getWriter(); for (final String l : ls) { out.println(l + ";"); diff --git a/src/test/java/net/socialgamer/cah/data/GameManagerTest.java b/src/test/java/net/socialgamer/cah/data/GameManagerTest.java index c4813f22..7296355d 100644 --- a/src/test/java/net/socialgamer/cah/data/GameManagerTest.java +++ b/src/test/java/net/socialgamer/cah/data/GameManagerTest.java @@ -96,27 +96,23 @@ public Thread newThread(final Runnable r) { bind(ScheduledThreadPoolExecutor.class).toInstance(threadPool); } - @SuppressWarnings("unused") @Provides @MaxGames Integer provideMaxGames() { return 3; } - @SuppressWarnings("unused") @Provides @GameId Integer provideGameId() { return gameId; } - @SuppressWarnings("unused") @Provides Session provideSession() { return HibernateUtil.instance.sessionFactory.openSession(); } - @SuppressWarnings("unused") @Provides @CardcastCardId Integer provideCardcastCardId() {