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.
This commit is contained in:
Andy Janata 2015-02-13 20:03:46 -08:00
parent 90c133587a
commit 832bcd8fc4
89 changed files with 556 additions and 327 deletions

View File

@ -1,71 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" output="target/classes" path="src/main/java">
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
<attributes> <attributes>
<attribute name="owner.project.facets" value="jst.web"/> <attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/> <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/javax.persistence.jar">
<attributes> <attributes>
<attribute name="javadoc_location" value="http://docs.oracle.com/javaee/6/api/"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/hibernate3.jar"> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="javadoc_location" value="file:/C:/Libraries/hibernate-distribution-3.6.9.Final/documentation/javadocs"/> <attribute name="optional" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-lang3-3.1.jar"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes> <attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/json_simple-1.1.jar"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/guice-3.0.jar"> <classpathentry kind="output" path="target/classes"/>
<attributes>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/easymock-3.1.jar">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/objenesis-1.2.jar">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/asm-4.0.jar">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/cglib-nodep-2.2.2.jar">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="WebContent/WEB-INF/lib/jsr305-2.0.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4">
<attributes>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.7.0_67">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="build/classes"/>
</classpath> </classpath>

2
.gitignore vendored
View File

@ -1 +1,3 @@
build build
build.properties
target

View File

@ -1,70 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>cah</name> <name>pyx</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/Update Handlers [Builder].launch</value>
</dictionary>
<dictionary>
<key>incclean</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name> <name>org.eclipse.jdt.core.javabuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<triggers>auto,full,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/Update JS Constants [Builder].launch</value>
</dictionary>
<dictionary>
<key>incclean</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>edu.umd.cs.findbugs.plugin.eclipse.findbugsNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="WebContent"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -0,0 +1,5 @@
eclipse.preferences.version=1
encoding//src/main/java=UTF-8
encoding//src/main/resources=UTF-8
encoding//src/test/java=UTF-8
encoding/<project>=UTF-8

View File

@ -0,0 +1,4 @@
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1

View File

@ -2,84 +2,81 @@
cah.$ = {}; cah.$ = {};
cah.$.AjaxOperation = function() { cah.$.GamePlayerStatus = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.AjaxOperation.prototype.dummyForAutocomplete = undefined; cah.$.GamePlayerStatus.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxOperation.FIRST_LOAD = "fl"; cah.$.GamePlayerStatus.SPECTATOR = "sv";
cah.$.AjaxOperation.START_GAME = "sg"; cah.$.GamePlayerStatus.HOST = "sh";
cah.$.AjaxOperation.JUDGE_SELECT = "js"; cah.$.GamePlayerStatus.IDLE = "si";
cah.$.AjaxOperation.LOG_OUT = "lo"; cah.$.GamePlayerStatus.WINNER = "sw";
cah.$.AjaxOperation.GAME_LIST = "ggl"; cah.$.GamePlayerStatus.PLAYING = "sp";
cah.$.AjaxOperation.CHANGE_GAME_OPTIONS = "cgo"; cah.$.GamePlayerStatus.JUDGE = "sj";
cah.$.AjaxOperation.PLAY_CARD = "pc"; cah.$.GamePlayerStatus.JUDGING = "sjj";
cah.$.AjaxOperation.CREATE_GAME = "cg"; cah.$.GamePlayerStatus_msg = {};
cah.$.AjaxOperation.CARDCAST_LIST_CARDSETS = "clc"; cah.$.GamePlayerStatus_msg['sp'] = "Playing";
cah.$.AjaxOperation.GAME_CHAT = "GC"; cah.$.GamePlayerStatus_msg['sv'] = "Spectator";
cah.$.AjaxOperation.KICK = "K"; cah.$.GamePlayerStatus_msg['sh'] = "Host";
cah.$.AjaxOperation.ADMIN_SET_VERBOSE_LOG = "svl"; cah.$.GamePlayerStatus_msg['sw'] = "Winner!";
cah.$.AjaxOperation.GET_CARDS = "gc"; cah.$.GamePlayerStatus_msg['sj'] = "Card Czar";
cah.$.AjaxOperation.JOIN_GAME = "jg"; cah.$.GamePlayerStatus_msg['sjj'] = "Selecting";
cah.$.AjaxOperation.CHAT = "c"; cah.$.GamePlayerStatus_msg['si'] = "";
cah.$.AjaxOperation.NAMES = "gn"; cah.$.GamePlayerStatus_msg_2 = {};
cah.$.AjaxOperation.SPECTATE_GAME = "vg"; cah.$.GamePlayerStatus_msg_2['sp'] = "Select a card to play.";
cah.$.AjaxOperation.BAN = "b"; cah.$.GamePlayerStatus_msg_2['sv'] = "You are just spectating.";
cah.$.AjaxOperation.SCORE = "SC"; cah.$.GamePlayerStatus_msg_2['sh'] = "Wait for players then click Start Game.";
cah.$.AjaxOperation.GET_GAME_INFO = "ggi"; cah.$.GamePlayerStatus_msg_2['sw'] = "You have won!";
cah.$.AjaxOperation.CARDCAST_ADD_CARDSET = "cac"; cah.$.GamePlayerStatus_msg_2['sj'] = "You are the Card Czar.";
cah.$.AjaxOperation.CARDCAST_REMOVE_CARDSET = "crc"; cah.$.GamePlayerStatus_msg_2['sjj'] = "Select a winning card.";
cah.$.AjaxOperation.REGISTER = "r"; cah.$.GamePlayerStatus_msg_2['si'] = "Waiting for players...";
cah.$.AjaxOperation.STOP_GAME = "Sg";
cah.$.AjaxOperation.LEAVE_GAME = "lg";
cah.$.AjaxRequest = function() { cah.$.GamePlayerInfo = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.AjaxRequest.prototype.dummyForAutocomplete = undefined; cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxRequest.WALL = "wall"; cah.$.GamePlayerInfo.NAME = "N";
cah.$.AjaxRequest.MESSAGE = "m"; cah.$.GamePlayerInfo.SCORE = "sc";
cah.$.AjaxRequest.CARD_ID = "cid"; cah.$.GamePlayerInfo.STATUS = "st";
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.$.AjaxResponse = function() { cah.$.GameOptionData = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.AjaxResponse.prototype.dummyForAutocomplete = undefined; cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxResponse.WHITE_CARDS = "wc"; cah.$.GameOptionData.USE_TIMER = "ut";
cah.$.AjaxResponse.CARD_SETS = "css"; cah.$.GameOptionData.CARD_SETS = "css";
cah.$.AjaxResponse.GAME_ID = "gid"; cah.$.GameOptionData.BLANKS_LIMIT = "bl";
cah.$.AjaxResponse.HAND = "h"; cah.$.GameOptionData.SPECTATOR_LIMIT = "vL";
cah.$.AjaxResponse.PLAYER_INFO = "pi"; cah.$.GameOptionData.PLAYER_LIMIT = "pL";
cah.$.AjaxResponse.BLACK_CARD = "bc"; cah.$.GameOptionData.PASSWORD = "pw";
cah.$.AjaxResponse.GAME_OPTIONS = "go"; cah.$.GameOptionData.SCORE_LIMIT = "sl";
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.$.BlackCardData = function() { cah.$.GameInfo = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.BlackCardData.prototype.dummyForAutocomplete = undefined; cah.$.GameInfo.prototype.dummyForAutocomplete = undefined;
cah.$.BlackCardData.TEXT = "T"; cah.$.GameInfo.HOST = "H";
cah.$.BlackCardData.PICK = "PK"; cah.$.GameInfo.STATE = "S";
cah.$.BlackCardData.ID = "cid"; cah.$.GameInfo.PLAYERS = "P";
cah.$.BlackCardData.WATERMARK = "W"; cah.$.GameInfo.SPECTATORS = "V";
cah.$.BlackCardData.DRAW = "D"; cah.$.GameInfo.ID = "gid";
cah.$.GameInfo.GAME_OPTIONS = "go";
cah.$.GameInfo.HAS_PASSWORD = "hp";
cah.$.GameState = 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.$.CardSetData = function() { cah.$.CardSetData = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
@ -93,15 +90,83 @@ cah.$.CardSetData.WHITE_CARDS_IN_DECK = "wcid";
cah.$.CardSetData.BLACK_CARDS_IN_DECK = "bcid"; cah.$.CardSetData.BLACK_CARDS_IN_DECK = "bcid";
cah.$.CardSetData.BASE_DECK = "bd"; cah.$.CardSetData.BASE_DECK = "bd";
cah.$.DisconnectReason = function() { cah.$.BlackCardData = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.DisconnectReason.prototype.dummyForAutocomplete = undefined; cah.$.BlackCardData.prototype.dummyForAutocomplete = undefined;
cah.$.DisconnectReason.BANNED = "B&"; cah.$.BlackCardData.TEXT = "T";
cah.$.DisconnectReason.PING_TIMEOUT = "pt"; cah.$.BlackCardData.PICK = "PK";
cah.$.DisconnectReason.KICKED = "k"; cah.$.BlackCardData.ID = "cid";
cah.$.DisconnectReason.MANUAL = "man"; cah.$.BlackCardData.WATERMARK = "W";
cah.$.DisconnectReason.IDLE_TIMEOUT = "it"; 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() {
// 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.$.LongPollEvent = 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.$.ErrorCode = function() { cah.$.ErrorCode = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
@ -185,140 +250,74 @@ cah.$.ErrorCode_msg['B&'] = "Banned.";
cah.$.ErrorCode_msg['ad'] = "Access denied."; cah.$.ErrorCode_msg['ad'] = "Access denied.";
cah.$.ErrorCode_msg['nj'] = "You are not the judge."; cah.$.ErrorCode_msg['nj'] = "You are not the judge.";
cah.$.GameInfo = function() { cah.$.AjaxResponse = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GameInfo.prototype.dummyForAutocomplete = undefined; cah.$.AjaxResponse.prototype.dummyForAutocomplete = undefined;
cah.$.GameInfo.HOST = "H"; cah.$.AjaxResponse.WHITE_CARDS = "wc";
cah.$.GameInfo.STATE = "S"; cah.$.AjaxResponse.CARD_SETS = "css";
cah.$.GameInfo.PLAYERS = "P"; cah.$.AjaxResponse.GAME_ID = "gid";
cah.$.GameInfo.SPECTATORS = "V"; cah.$.AjaxResponse.HAND = "h";
cah.$.GameInfo.ID = "gid"; cah.$.AjaxResponse.PLAYER_INFO = "pi";
cah.$.GameInfo.GAME_OPTIONS = "go"; cah.$.AjaxResponse.BLACK_CARD = "bc";
cah.$.GameInfo.HAS_PASSWORD = "hp"; 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.$.GameOptionData = function() { cah.$.AjaxRequest = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined; cah.$.AjaxRequest.prototype.dummyForAutocomplete = undefined;
cah.$.GameOptionData.USE_TIMER = "ut"; cah.$.AjaxRequest.WALL = "wall";
cah.$.GameOptionData.CARD_SETS = "css"; cah.$.AjaxRequest.MESSAGE = "m";
cah.$.GameOptionData.BLANKS_LIMIT = "bl"; cah.$.AjaxRequest.CARD_ID = "cid";
cah.$.GameOptionData.SPECTATOR_LIMIT = "vL"; cah.$.AjaxRequest.GAME_ID = "gid";
cah.$.GameOptionData.PLAYER_LIMIT = "pL"; cah.$.AjaxRequest.EMOTE = "me";
cah.$.GameOptionData.PASSWORD = "pw"; cah.$.AjaxRequest.CARDCAST_ID = "cci";
cah.$.GameOptionData.SCORE_LIMIT = "sl"; cah.$.AjaxRequest.GAME_OPTIONS = "go";
cah.$.AjaxRequest.SERIAL = "s";
cah.$.AjaxRequest.PASSWORD = "pw";
cah.$.AjaxRequest.OP = "o";
cah.$.AjaxRequest.NICKNAME = "n";
cah.$.GamePlayerInfo = function() { cah.$.AjaxOperation = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined; cah.$.AjaxOperation.prototype.dummyForAutocomplete = undefined;
cah.$.GamePlayerInfo.NAME = "N"; cah.$.AjaxOperation.FIRST_LOAD = "fl";
cah.$.GamePlayerInfo.SCORE = "sc"; cah.$.AjaxOperation.START_GAME = "sg";
cah.$.GamePlayerInfo.STATUS = "st"; cah.$.AjaxOperation.JUDGE_SELECT = "js";
cah.$.AjaxOperation.LOG_OUT = "lo";
cah.$.GamePlayerStatus = function() { cah.$.AjaxOperation.GAME_LIST = "ggl";
// Dummy constructor to make Eclipse auto-complete. cah.$.AjaxOperation.CHANGE_GAME_OPTIONS = "cgo";
}; cah.$.AjaxOperation.PLAY_CARD = "pc";
cah.$.GamePlayerStatus.prototype.dummyForAutocomplete = undefined; cah.$.AjaxOperation.CREATE_GAME = "cg";
cah.$.GamePlayerStatus.SPECTATOR = "sv"; cah.$.AjaxOperation.CARDCAST_LIST_CARDSETS = "clc";
cah.$.GamePlayerStatus.HOST = "sh"; cah.$.AjaxOperation.GAME_CHAT = "GC";
cah.$.GamePlayerStatus.IDLE = "si"; cah.$.AjaxOperation.KICK = "K";
cah.$.GamePlayerStatus.WINNER = "sw"; cah.$.AjaxOperation.ADMIN_SET_VERBOSE_LOG = "svl";
cah.$.GamePlayerStatus.PLAYING = "sp"; cah.$.AjaxOperation.GET_CARDS = "gc";
cah.$.GamePlayerStatus.JUDGE = "sj"; cah.$.AjaxOperation.JOIN_GAME = "jg";
cah.$.GamePlayerStatus.JUDGING = "sjj"; cah.$.AjaxOperation.CHAT = "c";
cah.$.GamePlayerStatus_msg = {}; cah.$.AjaxOperation.NAMES = "gn";
cah.$.GamePlayerStatus_msg['sp'] = "Playing"; cah.$.AjaxOperation.SPECTATE_GAME = "vg";
cah.$.GamePlayerStatus_msg['sv'] = "Spectator"; cah.$.AjaxOperation.BAN = "b";
cah.$.GamePlayerStatus_msg['sh'] = "Host"; cah.$.AjaxOperation.SCORE = "SC";
cah.$.GamePlayerStatus_msg['sw'] = "Winner!"; cah.$.AjaxOperation.GET_GAME_INFO = "ggi";
cah.$.GamePlayerStatus_msg['sj'] = "Card Czar"; cah.$.AjaxOperation.CARDCAST_ADD_CARDSET = "cac";
cah.$.GamePlayerStatus_msg['sjj'] = "Selecting"; cah.$.AjaxOperation.CARDCAST_REMOVE_CARDSET = "crc";
cah.$.GamePlayerStatus_msg['si'] = ""; cah.$.AjaxOperation.REGISTER = "r";
cah.$.GamePlayerStatus_msg_2 = {}; cah.$.AjaxOperation.STOP_GAME = "Sg";
cah.$.GamePlayerStatus_msg_2['sp'] = "Select a card to play."; cah.$.AjaxOperation.LEAVE_GAME = "lg";
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.$.GameState = 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.$.LongPollEvent = 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.$.LongPollResponse = 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.$.ReconnectNextAction = function() { cah.$.ReconnectNextAction = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
@ -327,12 +326,13 @@ cah.$.ReconnectNextAction.prototype.dummyForAutocomplete = undefined;
cah.$.ReconnectNextAction.GAME = "game"; cah.$.ReconnectNextAction.GAME = "game";
cah.$.ReconnectNextAction.NONE = "none"; cah.$.ReconnectNextAction.NONE = "none";
cah.$.WhiteCardData = function() { cah.$.DisconnectReason = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.WhiteCardData.prototype.dummyForAutocomplete = undefined; cah.$.DisconnectReason.prototype.dummyForAutocomplete = undefined;
cah.$.WhiteCardData.WRITE_IN = "wi"; cah.$.DisconnectReason.BANNED = "B&";
cah.$.WhiteCardData.TEXT = "T"; cah.$.DisconnectReason.PING_TIMEOUT = "pt";
cah.$.WhiteCardData.ID = "cid"; cah.$.DisconnectReason.KICKED = "k";
cah.$.WhiteCardData.WATERMARK = "W"; cah.$.DisconnectReason.MANUAL = "man";
cah.$.DisconnectReason.IDLE_TIMEOUT = "it";

5
build.properties.example Normal file
View File

@ -0,0 +1,5 @@
hibernate.url=jdbc:postgresql://localhost/pyx
hibernate.username=pyx
hibernate.password=CorrectHorseBatteryStaple
hibernate.sql.show=true
hibernate.sql.format=true

308
pom.xml Normal file
View File

@ -0,0 +1,308 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.socialgamer</groupId>
<artifactId>pyx</artifactId>
<version>0.5.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>pyx</name>
<scm>
<url>https://github.com/ajanata/PretendYoureXyzzy</url>
</scm>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<developers>
<developer>
<id>ajanata</id>
<name>Andy Janata</name>
<email>ajanata@gmail.com</email>
</developer>
</developers>
<build>
<finalName>ROOT</finalName>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>update-js-constants</id>
<phase>package</phase>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>net.socialgamer.cah.UpdateJsConstants</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<executable>${java.home}/bin</executable>
<!-- false = true and true = false... http://jira.codehaus.org/browse/MCOMPILER-209 -->
<useIncrementalCompilation>false</useIncrementalCompilation>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.3.1</version>
<executions>
<execution>
<id>enforce-files-exist</id>
<phase>validate</phase>
<goals>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<requireFilesExist>
<files>
<file>build.properties</file>
</files>
</requireFilesExist>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>
<!-- Read database credentials etc. from file. -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>properties-maven-plugin</artifactId>
<version>1.0-alpha-2</version>
<executions>
<execution>
<id>read-build-properties</id>
<phase>initialize</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
<execution>
<id>read-report-properties</id>
<phase>pre-site</phase>
<goals>
<goal>read-project-properties</goal>
</goals>
</execution>
</executions>
<configuration>
<files>
<file>build.properties</file>
</files>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<!-- for exploded war -->
<!--
<executions>
<execution>
<id>default-war</id>
<phase>none</phase>
</execution>
<execution>
<id>war-exploded</id>
<phase>package</phase>
<goals>
<goal>exploded</goal>
</goals>
</execution>
</executions>
-->
<configuration>
<webResources>
<resource>
<directory>src/main/resources</directory>
<filtering>false</filtering>
</resource>
<resource>
<directory>src/main/filtered-resources</directory>
<filtering>true</filtering>
</resource>
<resource>
<directory>WebContent</directory>
<filtering>false</filtering>
</resource>
</webResources>
<!-- Web XML is in a filtered folder due to the DTD -->
<failOnMissingWebXml>false</failOnMissingWebXml>
<!-- Pack classes into a jar -->
<archiveClasses>true</archiveClasses>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.1.2.v20140210</version>
<configuration>
<!-- Uncomment this to enable JMX in Jetty for debugging. -->
<!-- <jettyXml>${appserver.web-inf.dir}/jetty-jmx.xml</jettyXml> -->
<webApp>
<!--<defaultsDescriptor>${project.basedir}/jetty-defaults.xml</defaultsDescriptor> -->
<descriptor>${project.build.directory}/${project.build.artifact.name}/WEB-INF/web.xml</descriptor>
<resourceBases>
<!-- Non-filtered -->
<resource>src/main/resources</resource>
<!-- Filtered -->
<resource>${project.build.directory}/ROOT</resource>
</resourceBases>
</webApp>
<scanTargets>
<scanTarget>src/main/filtered-resources</scanTarget>
</scanTargets>
<scanIntervalSeconds>0</scanIntervalSeconds>
<reload>manual</reload>
<webAppSourceDirectory>WebContent</webAppSourceDirectory>
<stopPort>8081</stopPort>
<stopKey>STOP</stopKey>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.codehaus.mojo
</groupId>
<artifactId>
properties-maven-plugin
</artifactId>
<versionRange>
[1.0-alpha-2,)
</versionRange>
<goals>
<goal>
read-project-properties
</goal>
</goals>
</pluginExecutionFilter>
<action>
<execute></execute>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-assistedinject</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<version>3.0</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>3.6.10.Final</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>8.4-702.jdbc3</version>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.sourceforge.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>1.3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

View File

@ -5,14 +5,14 @@
<hibernate-configuration> <hibernate-configuration>
<session-factory> <session-factory>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property> <property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.password">a#kHA17Nqp*</property> <property name="hibernate.connection.url">${hibernate.url}</property>
<property name="hibernate.connection.url">jdbc:postgresql://pyx-master.int.socialgamer.net/cah</property> <property name="hibernate.connection.username">${hibernate.username}</property>
<property name="hibernate.connection.username">cah</property> <property name="hibernate.connection.password">${hibernate.password}</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property> <property name="transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="show_sql">false</property> <property name="show_sql">${hibernate.sql.show}</property>
<property name="format_sql">false</property> <property name="format_sql">${hibernate.sql.format}</property>
<mapping class="net.socialgamer.cah.db.PyxBlackCard" /> <mapping class="net.socialgamer.cah.db.PyxBlackCard" />
<mapping class="net.socialgamer.cah.db.PyxWhiteCard" /> <mapping class="net.socialgamer.cah.db.PyxWhiteCard" />

View File

@ -1,6 +1,8 @@
package net.socialgamer.cah; package net.socialgamer.cah;
import java.io.IOException; import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import javax.servlet.Filter; import javax.servlet.Filter;
@ -20,8 +22,10 @@ public class CacheControlFilter implements Filter {
final HttpServletResponse resp = (HttpServletResponse) response; final HttpServletResponse resp = (HttpServletResponse) response;
final DateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z");
resp.setHeader("Expires", "Tue, 03 Jul 2001 06:00:00 GMT"); resp.setHeader("Expires", "Tue, 03 Jul 2001 06:00:00 GMT");
resp.setHeader("Last-Modified", new Date().toString()); resp.setHeader("Last-Modified", format.format(new Date()));
resp.setHeader("Cache-Control", "must-revalidate, max-age=0"); resp.setHeader("Cache-Control", "must-revalidate, max-age=0");
chain.doFilter(request, response); chain.doFilter(request, response);