Merge remote-tracking branch 'refs/remotes/ajanata/master'
# Conflicts: # WebContent/js/cah.constants.js
This commit is contained in:
commit
29d36344be
|
@ -20,6 +20,7 @@
|
|||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||
<attributes>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v8.0">
|
||||
|
@ -27,9 +28,9 @@
|
|||
<attribute name="owner.project.facets" value="jst.web"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_31">
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
<attribute name="maven.pomderived" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="output" path="target/classes"/>
|
||||
|
|
16
.project
16
.project
|
@ -20,11 +20,16 @@
|
|||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.hibernate.eclipse.console.hibernateBuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||
<arguments>
|
||||
|
@ -38,5 +43,6 @@
|
|||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.hibernate.eclipse.console.hibernateNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
|
|
|
@ -9,6 +9,7 @@ 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.problem.forbiddenReference=warning
|
||||
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
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/test"/>
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp"/>
|
||||
<property name="java-output-path" value="/cah/build/classes"/>
|
||||
<property name="context-root" value="zy"/>
|
||||
<property name="context-root" value="ROOT"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
disabled=06target
|
||||
eclipse.preferences.version=1
|
|
@ -1,4 +1,3 @@
|
|||
#Thu Jan 12 14:12:39 PST 2012
|
||||
default.configuration=
|
||||
default.configuration=pyx
|
||||
eclipse.preferences.version=1
|
||||
hibernate3.enabled=false
|
||||
hibernate3.enabled=true
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
{"libs":["ecma5","browser"],"plugins":{"guess-types":{},"outline":{}},"ide":{}}
|
|
@ -428,13 +428,28 @@ HttpSession hSession = request.getSession(true);
|
|||
</select>
|
||||
Spectators can watch and chat, but not actually play. Not even as Czar.
|
||||
<br/>
|
||||
<input type="checkbox" checked="checked" id="use_timer_template" class="use_timer"
|
||||
title="Players will be skipped if they have not played within a reasonable amount of time."
|
||||
aria-label="Use idle timer. Players will be skipped if they have not played within a reasonable amount of time."/>
|
||||
<label id="use_timer_template_label" for="use_timer_template"
|
||||
title="Players will be skipped if they have not played within a reasonable amount of time.">
|
||||
Use idle timer.
|
||||
<label id="timer_multiplier_template_label" for="timer_multiplier_template"
|
||||
title="Players will be skipped if they have not played within a reasonable amount of time. This is the multiplier to apply to the default timeouts, or Unlimited to disable timeouts.">
|
||||
Idle timer multiplier:
|
||||
</label>
|
||||
<select id="timer_multiplier_template" class="timer_multiplier"
|
||||
title="Players will be skipped if they have not played within a reasonable amount of time. This is the multiplier to apply to the default timeouts, or Unlimited to disable timeouts."
|
||||
aria-label="Players will be skipped if they have not played within a reasonable amount of time. This is the multiplier to apply to the default timeouts, or Unlimited to disable timeouts.">
|
||||
<option value="0.25x">0.25x</option>
|
||||
<option value="0.5x">0.5x</option>
|
||||
<option value="0.75x">0.75x</option>
|
||||
<option selected="selected" value="1x">1x</option>
|
||||
<option value="1.25x">1.25x</option>
|
||||
<option value="1.5x">1.5x</option>
|
||||
<option value="1.75x">1.75x</option>
|
||||
<option value="2x">2x</option>
|
||||
<option value="2.5x">2.5x</option>
|
||||
<option value="3x">3x</option>
|
||||
<option value="4x">4x</option>
|
||||
<option value="5x">5x</option>
|
||||
<option value="10x">10x</option>
|
||||
<option value="Unlimited">Unlimited</option>
|
||||
</select>
|
||||
<br/>
|
||||
<fieldset class="card_sets">
|
||||
<legend>Card Sets</legend>
|
||||
|
|
|
@ -2,88 +2,85 @@
|
|||
|
||||
cah.$ = {};
|
||||
|
||||
cah.$.AjaxOperation = function() {
|
||||
cah.$.GamePlayerStatus = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.$.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.$.GamePlayerInfo = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined;
|
||||
cah.$.GamePlayerInfo.STATUS = "st";
|
||||
cah.$.GamePlayerInfo.SCORE = "sc";
|
||||
cah.$.GamePlayerInfo.NAME = "N";
|
||||
|
||||
cah.$.GameOptionData = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined;
|
||||
cah.$.GameOptionData.TIMER_MULTIPLIER = "tm";
|
||||
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.CARD_SETS = "css";
|
||||
|
||||
cah.$.GameInfo = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.$.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.$.AjaxResponse = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.DRAW = "D";
|
||||
cah.$.BlackCardData.PICK = "PK";
|
||||
cah.$.BlackCardData.TEXT = "T";
|
||||
cah.$.BlackCardData.ID = "cid";
|
||||
cah.$.BlackCardData.WATERMARK = "W";
|
||||
|
||||
cah.$.CardSetData = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
cah.$.CardSetData.prototype.dummyForAutocomplete = undefined;
|
||||
cah.$.CardSetData.WHITE_CARDS_IN_DECK = "wcid";
|
||||
cah.$.CardSetData.BLACK_CARDS_IN_DECK = "bcid";
|
||||
|
@ -93,15 +90,83 @@ cah.$.CardSetData.BASE_DECK = "bd";
|
|||
cah.$.CardSetData.ID = "cid";
|
||||
cah.$.CardSetData.WEIGHT = "w";
|
||||
|
||||
cah.$.BlackCardData = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
cah.$.BlackCardData.prototype.dummyForAutocomplete = undefined;
|
||||
cah.$.BlackCardData.DRAW = "D";
|
||||
cah.$.BlackCardData.PICK = "PK";
|
||||
cah.$.BlackCardData.TEXT = "T";
|
||||
cah.$.BlackCardData.ID = "cid";
|
||||
cah.$.BlackCardData.WATERMARK = "W";
|
||||
|
||||
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.$.CardSetData = 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.$.DisconnectReason = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.$.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.$.ErrorCode = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
|
@ -197,137 +262,71 @@ cah.$.ErrorInformation.BLACK_CARDS_PRESENT = "bcp";
|
|||
cah.$.GameInfo = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.$.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.$.GameOptionData = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.$.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.$.GamePlayerInfo = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
};
|
||||
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.$.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.$.ReconnectNextAction = function() {
|
||||
// Dummy constructor to make Eclipse auto-complete.
|
||||
|
@ -339,9 +338,9 @@ cah.$.ReconnectNextAction.NONE = "none";
|
|||
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.$.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";
|
||||
|
|
|
@ -95,7 +95,7 @@ cah.Game = function(id) {
|
|||
$("#game_password_template_label", this.optionsElement_).attr("for", "game_password_" + id);
|
||||
$("#game_hide_password_template_label", this.optionsElement_).attr("for",
|
||||
"game_hide_password_" + id);
|
||||
$("#use_timer_template_label", this.optionsElement_).attr("for", "use_timer_" + id);
|
||||
$("#timer_multiplier_template_label", this.optionsElement_).attr("for", "timer_multiplier_" + id);
|
||||
|
||||
$("#score_limit_template", this.optionsElement_).attr("id", "score_limit_" + id);
|
||||
$("#player_limit_template", this.optionsElement_).attr("id", "player_limit_" + id);
|
||||
|
@ -104,7 +104,7 @@ cah.Game = function(id) {
|
|||
$("#game_password_template", this.optionsElement_).attr("id", "game_password_" + id);
|
||||
$("#game_fake_password_template", this.optionsElement_).attr("id", "game_fake_password_" + id);
|
||||
$("#game_hide_password_template", this.optionsElement_).attr("id", "game_hide_password_" + id);
|
||||
$("#use_timer_template", this.optionsElement_).attr("id", "use_timer_" + id);
|
||||
$("#timer_multiplier_template", this.optionsElement_).attr("id", "timer_multiplier_" + id);
|
||||
$("#blanks_limit_template", this.optionsElement_).attr("id", "blanks_limit_" + id);
|
||||
|
||||
for ( var key in cah.CardSet.byWeight) {
|
||||
|
@ -307,7 +307,7 @@ cah.Game = function(id) {
|
|||
$(".game_show_options", this.element_).click(cah.bind(this, this.showOptionsClick_));
|
||||
$("select", this.optionsElement_).change(cah.bind(this, this.optionChanged_));
|
||||
$("input", this.optionsElement_).blur(cah.bind(this, this.optionChanged_));
|
||||
$(".use_timer", this.optionsElement_).change(cah.bind(this, this.optionChanged_));
|
||||
$(".timer_multiplier", this.optionsElement_).change(cah.bind(this, this.optionChanged_));
|
||||
$(".card_set", this.optionsElement_).change(cah.bind(this, this.optionChanged_));
|
||||
$(".game_hide_password", this.optionsElement_).click(cah.bind(this, this.showOrHidePassword_));
|
||||
|
||||
|
@ -853,11 +853,8 @@ cah.Game.prototype.updateGameStatus = function(data) {
|
|||
$(".player_limit", this.optionsElement_).val(options[cah.$.GameOptionData.PLAYER_LIMIT]);
|
||||
$(".spectator_limit", this.optionsElement_).val(options[cah.$.GameOptionData.SPECTATOR_LIMIT]);
|
||||
$(".game_password", this.optionsElement_).val(options[cah.$.GameOptionData.PASSWORD]);
|
||||
if (options[cah.$.GameOptionData.USE_TIMER]) {
|
||||
$(".use_timer", this.optionsElement_).attr("checked", "checked");
|
||||
} else {
|
||||
$(".use_timer", this.optionsElement_).removeAttr("checked");
|
||||
}
|
||||
$(".timer_multiplier", this.optionsElement_).val(options[cah.$.GameOptionData.TIMER_MULTIPLIER]);
|
||||
|
||||
var cardSetIds = options[cah.$.GameOptionData.CARD_SETS];// .split(',');
|
||||
$(".card_set", this.optionsElement_).removeAttr("checked");
|
||||
for ( var key in cardSetIds) {
|
||||
|
@ -1482,7 +1479,8 @@ cah.Game.prototype.optionChanged_ = function(e) {
|
|||
options[cah.$.GameOptionData.SPECTATOR_LIMIT] = $(".spectator_limit", this.optionsElement_).val();
|
||||
options[cah.$.GameOptionData.PASSWORD] = $(".game_password", this.optionsElement_).val();
|
||||
options[cah.$.GameOptionData.BLANKS_LIMIT] = $(".blanks_limit", this.optionsElement_).val();
|
||||
options[cah.$.GameOptionData.USE_TIMER] = !!$('.use_timer', this.optionsElement_).attr('checked');
|
||||
options[cah.$.GameOptionData.TIMER_MULTIPLIER] = $('.timer_multiplier', this.optionsElement_)
|
||||
.val();
|
||||
|
||||
cah.Ajax.build(cah.$.AjaxOperation.CHANGE_GAME_OPTIONS).withGameId(this.id_).withGameOptions(
|
||||
options).run();
|
||||
|
|
801
cah_cards.sql
801
cah_cards.sql
File diff suppressed because it is too large
Load Diff
|
@ -54,7 +54,7 @@ public class Constants {
|
|||
add("0:0:0:0:0:0:0:1");
|
||||
add("127.0.0.1");
|
||||
// ajanata
|
||||
add("73.202.162.31");
|
||||
add("73.222.116.50");
|
||||
// vsTerminus
|
||||
add("207.161.130.75");
|
||||
}
|
||||
|
@ -670,7 +670,7 @@ public class Constants {
|
|||
PLAYER_LIMIT("pL"),
|
||||
SPECTATOR_LIMIT("vL"),
|
||||
SCORE_LIMIT("sl"),
|
||||
USE_TIMER("ut");
|
||||
TIMER_MULTIPLIER("tm");
|
||||
|
||||
private final String key;
|
||||
|
||||
|
|
|
@ -171,6 +171,10 @@ public class CardcastService {
|
|||
final List<String> strs = new ArrayList<String>(texts.size());
|
||||
for (final Object o : texts) {
|
||||
final String cardCastString = (String) o;
|
||||
if (cardCastString.isEmpty()) {
|
||||
// skip blank segments
|
||||
continue;
|
||||
}
|
||||
final StringBuilder pyxString = new StringBuilder();
|
||||
|
||||
// Cardcast's recommended format is to not capitalize the first letter
|
||||
|
@ -186,8 +190,12 @@ public class CardcastService {
|
|||
strs.add(pyxString.toString());
|
||||
}
|
||||
final String text = StringUtils.join(strs, "");
|
||||
final CardcastWhiteCard card = new CardcastWhiteCard(cardIdProvider.get(), text, setId);
|
||||
deck.getWhiteCards().add(card);
|
||||
// don't add blank cards, they don't do anything
|
||||
if (!text.isEmpty()) {
|
||||
final CardcastWhiteCard card = new CardcastWhiteCard(cardIdProvider.get(), text,
|
||||
setId);
|
||||
deck.getWhiteCards().add(card);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeSet;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
@ -40,6 +41,12 @@ import java.util.concurrent.TimeUnit;
|
|||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Session;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
|
||||
import net.socialgamer.cah.Constants.BlackCardData;
|
||||
import net.socialgamer.cah.Constants.ErrorCode;
|
||||
import net.socialgamer.cah.Constants.GameInfo;
|
||||
|
@ -56,12 +63,6 @@ import net.socialgamer.cah.data.GameManager.GameId;
|
|||
import net.socialgamer.cah.data.QueuedMessage.MessageType;
|
||||
import net.socialgamer.cah.task.SafeTimerTask;
|
||||
|
||||
import org.apache.log4j.Logger;
|
||||
import org.hibernate.Session;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Provider;
|
||||
|
||||
|
||||
/**
|
||||
* Game data and logic class. Games are simple finite state machines, with 3 states that wait for
|
||||
|
@ -151,6 +152,14 @@ public class Game {
|
|||
*/
|
||||
private final static int JUDGE_TIMEOUT_PER_CARD = 7 * 1000;
|
||||
private final static int MAX_SKIPS_BEFORE_KICK = 2;
|
||||
private final static Set<String> FINITE_PLAYTIMES;
|
||||
static
|
||||
{
|
||||
final Set<String> finitePlaytimes = new TreeSet<String>(Arrays.asList(
|
||||
new String[]{"0.25x", "0.5x", "0.75x", "1x", "1.25x", "1.5x", "1.75x", "2x", "2.5x", "3x", "4x", "5x", "10x"}));
|
||||
FINITE_PLAYTIMES = Collections.unmodifiableSet(finitePlaytimes);
|
||||
}
|
||||
|
||||
/**
|
||||
* Lock object to prevent judging during idle judge detection and vice-versa.
|
||||
*/
|
||||
|
@ -818,8 +827,7 @@ public class Game {
|
|||
}
|
||||
|
||||
// Perhaps figure out a better way to do this...
|
||||
final int playTimer = options.useIdleTimer ? PLAY_TIMEOUT_BASE
|
||||
+ (PLAY_TIMEOUT_PER_CARD * blackCard.getPick()) : Integer.MAX_VALUE;
|
||||
final int playTimer = calculateTime(PLAY_TIMEOUT_BASE + (PLAY_TIMEOUT_PER_CARD * blackCard.getPick()));
|
||||
|
||||
final HashMap<ReturnableData, Object> data = getEventMap();
|
||||
data.put(LongPollResponse.EVENT, LongPollEvent.GAME_STATE_CHANGE.toString());
|
||||
|
@ -841,6 +849,28 @@ public class Game {
|
|||
}
|
||||
}
|
||||
|
||||
private int calculateTime(final int base) {
|
||||
double factor = 1.0d;
|
||||
final String tm = options.timerMultiplier;
|
||||
|
||||
if(tm.equals("Unlimited")) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
if(FINITE_PLAYTIMES.contains(tm))
|
||||
{
|
||||
factor = Double.valueOf(tm.substring(0, tm.length() - 1));
|
||||
}
|
||||
|
||||
final long retval = Math.round(base * factor);
|
||||
|
||||
if(retval > Integer.MAX_VALUE) {
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
return (int) retval;
|
||||
}
|
||||
|
||||
/**
|
||||
* Warn players that have not yet played that they are running out of time to do so.
|
||||
* <br/>
|
||||
|
@ -1010,8 +1040,7 @@ public class Game {
|
|||
state = GameState.JUDGING;
|
||||
|
||||
// Perhaps figure out a better way to do this...
|
||||
final int judgeTimer = options.useIdleTimer ? JUDGE_TIMEOUT_BASE
|
||||
+ (JUDGE_TIMEOUT_PER_CARD * playedCards.size() * blackCard.getPick()) : Integer.MAX_VALUE;
|
||||
final int judgeTimer = calculateTime(JUDGE_TIMEOUT_BASE + (JUDGE_TIMEOUT_PER_CARD * playedCards.size() * blackCard.getPick()));
|
||||
|
||||
final HashMap<ReturnableData, Object> data = getEventMap();
|
||||
data.put(LongPollResponse.EVENT, LongPollEvent.GAME_STATE_CHANGE.toString());
|
||||
|
|
|
@ -59,7 +59,7 @@ public class GameOptions {
|
|||
public int scoreGoal = DEFAULT_SCORE_LIMIT;
|
||||
public final Set<Integer> cardSetIds = new HashSet<Integer>();
|
||||
public String password = "";
|
||||
public boolean useIdleTimer = true;
|
||||
public String timerMultiplier = "1.0x";
|
||||
|
||||
/**
|
||||
* Update the options in-place (so that the Game doesn't need more locks).
|
||||
|
@ -77,7 +77,7 @@ public class GameOptions {
|
|||
}
|
||||
this.blanksInDeck = newOptions.blanksInDeck;
|
||||
this.password = newOptions.password;
|
||||
this.useIdleTimer = newOptions.useIdleTimer;
|
||||
this.timerMultiplier = newOptions.timerMultiplier;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -96,7 +96,7 @@ public class GameOptions {
|
|||
info.put(GameOptionData.PLAYER_LIMIT, playerLimit);
|
||||
info.put(GameOptionData.SPECTATOR_LIMIT, spectatorLimit);
|
||||
info.put(GameOptionData.SCORE_LIMIT, scoreGoal);
|
||||
info.put(GameOptionData.USE_TIMER, useIdleTimer);
|
||||
info.put(GameOptionData.TIMER_MULTIPLIER, timerMultiplier);
|
||||
if (includePassword) {
|
||||
info.put(GameOptionData.PASSWORD, password);
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class GameOptions {
|
|||
json.getInteger(GameOptionData.SPECTATOR_LIMIT, options.spectatorLimit)));
|
||||
options.scoreGoal = Math.max(MIN_SCORE_LIMIT, Math.min(MAX_SCORE_LIMIT,
|
||||
json.getInteger(GameOptionData.SCORE_LIMIT, options.scoreGoal)));
|
||||
options.useIdleTimer = json.getBoolean(GameOptionData.USE_TIMER, options.useIdleTimer);
|
||||
options.timerMultiplier = json.getString(GameOptionData.TIMER_MULTIPLIER, options.timerMultiplier);
|
||||
options.password = json.getString(GameOptionData.PASSWORD, options.password);
|
||||
|
||||
return options;
|
||||
|
|
|
@ -17,4 +17,14 @@
|
|||
<filter-name>SetCacheControl</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
</web-app>
|
||||
<!--
|
||||
<filter>
|
||||
<filter-name>CorsFilter</filter-name>
|
||||
<filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
|
||||
</filter>
|
||||
<filter-mapping>
|
||||
<filter-name>CorsFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
-->
|
||||
</web-app>
|
||||
|
|
Loading…
Reference in New Issue