Add option to disable game chat.

This commit is contained in:
Andy Janata 2018-07-28 10:08:16 -07:00
parent c40c2d194b
commit 57597669fe
10 changed files with 635 additions and 597 deletions

View File

@ -2,80 +2,101 @@
cah.$ = {}; cah.$ = {};
cah.$.GamePlayerStatus = function() { cah.$.AjaxOperation = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GamePlayerStatus.prototype.dummyForAutocomplete = undefined; cah.$.AjaxOperation.prototype.dummyForAutocomplete = undefined;
cah.$.GamePlayerStatus.SPECTATOR = "sv"; cah.$.AjaxOperation.NAMES = "gn";
cah.$.GamePlayerStatus.WINNER = "sw"; cah.$.AjaxOperation.SCORE = "SC";
cah.$.GamePlayerStatus.IDLE = "si"; cah.$.AjaxOperation.LEAVE_GAME = "lg";
cah.$.GamePlayerStatus.HOST = "sh"; cah.$.AjaxOperation.JOIN_GAME = "jg";
cah.$.GamePlayerStatus.JUDGING = "sjj"; cah.$.AjaxOperation.CHAT = "c";
cah.$.GamePlayerStatus.JUDGE = "sj"; cah.$.AjaxOperation.GAME_LIST = "ggl";
cah.$.GamePlayerStatus.PLAYING = "sp"; cah.$.AjaxOperation.CARDCAST_ADD_CARDSET = "cac";
cah.$.GamePlayerStatus_msg = {}; cah.$.AjaxOperation.CARDCAST_LIST_CARDSETS = "clc";
cah.$.GamePlayerStatus_msg['sjj'] = "Selecting"; cah.$.AjaxOperation.PLAY_CARD = "pc";
cah.$.GamePlayerStatus_msg['sv'] = "Spectator"; cah.$.AjaxOperation.CHANGE_GAME_OPTIONS = "cgo";
cah.$.GamePlayerStatus_msg['sw'] = "Winner!"; cah.$.AjaxOperation.GET_GAME_INFO = "ggi";
cah.$.GamePlayerStatus_msg['sh'] = "Host"; cah.$.AjaxOperation.GET_CARDS = "gc";
cah.$.GamePlayerStatus_msg['si'] = ""; cah.$.AjaxOperation.ADMIN_SET_VERBOSE_LOG = "svl";
cah.$.GamePlayerStatus_msg['sj'] = "Card Czar"; cah.$.AjaxOperation.REGISTER = "r";
cah.$.GamePlayerStatus_msg['sp'] = "Playing"; cah.$.AjaxOperation.CARDCAST_REMOVE_CARDSET = "crc";
cah.$.GamePlayerStatus_msg_2 = {}; cah.$.AjaxOperation.WHOIS = "Wi";
cah.$.GamePlayerStatus_msg_2['sjj'] = "Select a winning card."; cah.$.AjaxOperation.KICK = "K";
cah.$.GamePlayerStatus_msg_2['sv'] = "You are just spectating."; cah.$.AjaxOperation.FIRST_LOAD = "fl";
cah.$.GamePlayerStatus_msg_2['sw'] = "You have won!"; cah.$.AjaxOperation.START_GAME = "sg";
cah.$.GamePlayerStatus_msg_2['sh'] = "Wait for players then click Start Game."; cah.$.AjaxOperation.LOG_OUT = "lo";
cah.$.GamePlayerStatus_msg_2['si'] = "Waiting for players..."; cah.$.AjaxOperation.BAN = "b";
cah.$.GamePlayerStatus_msg_2['sj'] = "You are the Card Czar."; cah.$.AjaxOperation.CREATE_GAME = "cg";
cah.$.GamePlayerStatus_msg_2['sp'] = "Select a card to play."; cah.$.AjaxOperation.STOP_GAME = "Sg";
cah.$.AjaxOperation.GAME_CHAT = "GC";
cah.$.AjaxOperation.SPECTATE_GAME = "vg";
cah.$.AjaxOperation.JUDGE_SELECT = "js";
cah.$.GamePlayerInfo = function() { cah.$.AjaxRequest = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined; cah.$.AjaxRequest.prototype.dummyForAutocomplete = undefined;
cah.$.GamePlayerInfo.STATUS = "st"; cah.$.AjaxRequest.SERIAL = "s";
cah.$.GamePlayerInfo.SCORE = "sc"; cah.$.AjaxRequest.OP = "o";
cah.$.GamePlayerInfo.NAME = "N"; cah.$.AjaxRequest.WALL = "wall";
cah.$.AjaxRequest.PERSISTENT_ID = "pid";
cah.$.AjaxRequest.EMOTE = "me";
cah.$.AjaxRequest.CARDCAST_ID = "cci";
cah.$.AjaxRequest.GAME_ID = "gid";
cah.$.AjaxRequest.GAME_OPTIONS = "go";
cah.$.AjaxRequest.MESSAGE = "m";
cah.$.AjaxRequest.NICKNAME = "n";
cah.$.AjaxRequest.PASSWORD = "pw";
cah.$.AjaxRequest.CARD_ID = "cid";
cah.$.AjaxRequest.ID_CODE = "idc";
cah.$.GameOptionData = function() { cah.$.AjaxResponse = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined; cah.$.AjaxResponse.prototype.dummyForAutocomplete = undefined;
cah.$.GameOptionData.TIMER_MULTIPLIER = "tm"; cah.$.AjaxResponse.NAMES = "nl";
cah.$.GameOptionData.PASSWORD = "pw"; cah.$.AjaxResponse.CLIENT_NAME = "cn";
cah.$.GameOptionData.SPECTATOR_LIMIT = "vL"; cah.$.AjaxResponse.GAME_CHAT_ENABLED = "Gce";
cah.$.GameOptionData.SCORE_LIMIT = "sl"; cah.$.AjaxResponse.PLAYER_INFO = "pi";
cah.$.GameOptionData.BLANKS_LIMIT = "bl"; cah.$.AjaxResponse.CONNECTED_AT = "ca";
cah.$.GameOptionData.PLAYER_LIMIT = "pL"; cah.$.AjaxResponse.WHITE_CARDS = "wc";
cah.$.GameOptionData.CARD_SETS = "css"; cah.$.AjaxResponse.HAND = "h";
cah.$.AjaxResponse.ERROR_CODE = "ec";
cah.$.AjaxResponse.GLOBAL_CHAT_ENABLED = "gce";
cah.$.AjaxResponse.SERVER_STARTED = "SS";
cah.$.AjaxResponse.NEXT = "next";
cah.$.AjaxResponse.GAME_INFO = "gi";
cah.$.AjaxResponse.ERROR = "e";
cah.$.AjaxResponse.GAME_STATE_DESCRIPTION = "gss";
cah.$.AjaxResponse.ID_CODE = "idc";
cah.$.AjaxResponse.CARD_SETS = "css";
cah.$.AjaxResponse.SERIAL = "s";
cah.$.AjaxResponse.PERSISTENT_ID = "pid";
cah.$.AjaxResponse.USER_PERMALINK = "up";
cah.$.AjaxResponse.GAMES = "gl";
cah.$.AjaxResponse.SIGIL = "?";
cah.$.AjaxResponse.GAME_ID = "gid";
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.GAME_PERMALINK = "gp";
cah.$.AjaxResponse.IDLE = "idl";
cah.$.AjaxResponse.CARD_ID = "cid";
cah.$.AjaxResponse.IP_ADDRESS = "IP";
cah.$.AjaxResponse.SESSION_PERMALINK = "sP";
cah.$.GameInfo = function() { cah.$.BlackCardData = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.GameInfo.prototype.dummyForAutocomplete = undefined; cah.$.BlackCardData.prototype.dummyForAutocomplete = undefined;
cah.$.GameInfo.GAME_OPTIONS = "go"; cah.$.BlackCardData.DRAW = "D";
cah.$.GameInfo.CREATED = "gca"; cah.$.BlackCardData.PICK = "PK";
cah.$.GameInfo.PLAYERS = "P"; cah.$.BlackCardData.TEXT = "T";
cah.$.GameInfo.SPECTATORS = "V"; cah.$.BlackCardData.ID = "cid";
cah.$.GameInfo.HOST = "H"; cah.$.BlackCardData.WATERMARK = "W";
cah.$.GameInfo.STATE = "S";
cah.$.GameInfo.ID = "gid";
cah.$.GameInfo.HAS_PASSWORD = "hp";
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.JUDGING = "j";
cah.$.GameState.PLAYING = "p";
cah.$.GameState_msg = {};
cah.$.GameState_msg['p'] = "In Progress";
cah.$.GameState_msg['j'] = "In Progress";
cah.$.GameState_msg['l'] = "Not Started";
cah.$.GameState_msg['ro'] = "In Progress";
cah.$.CardSetData = function() { cah.$.CardSetData = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
@ -89,96 +110,21 @@ cah.$.CardSetData.BASE_DECK = "bd";
cah.$.CardSetData.ID = "cid"; cah.$.CardSetData.ID = "cid";
cah.$.CardSetData.WEIGHT = "w"; cah.$.CardSetData.WEIGHT = "w";
cah.$.BlackCardData = function() { cah.$.DisconnectReason = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.BlackCardData.prototype.dummyForAutocomplete = undefined; cah.$.DisconnectReason.prototype.dummyForAutocomplete = undefined;
cah.$.BlackCardData.DRAW = "D"; cah.$.DisconnectReason.PING_TIMEOUT = "pt";
cah.$.BlackCardData.PICK = "PK"; cah.$.DisconnectReason.BANNED = "B&";
cah.$.BlackCardData.TEXT = "T"; cah.$.DisconnectReason.IDLE_TIMEOUT = "it";
cah.$.BlackCardData.ID = "cid"; cah.$.DisconnectReason.KICKED = "k";
cah.$.BlackCardData.WATERMARK = "W"; cah.$.DisconnectReason.MANUAL = "man";
cah.$.DisconnectReason_msg = {};
cah.$.WhiteCardData = function() { cah.$.DisconnectReason_msg['B&'] = "Banned";
// Dummy constructor to make Eclipse auto-complete. cah.$.DisconnectReason_msg['pt'] = "Ping timeout";
}; cah.$.DisconnectReason_msg['it'] = "Kicked due to idle";
cah.$.WhiteCardData.prototype.dummyForAutocomplete = undefined; cah.$.DisconnectReason_msg['k'] = "Kicked by server administrator";
cah.$.WhiteCardData.WRITE_IN = "wi"; cah.$.DisconnectReason_msg['man'] = "Leaving";
cah.$.WhiteCardData.TEXT = "T";
cah.$.WhiteCardData.ID = "cid";
cah.$.WhiteCardData.WATERMARK = "W";
cah.$.Sigil = function() {
// Dummy constructor to make Eclipse auto-complete.
};
cah.$.Sigil.prototype.dummyForAutocomplete = undefined;
cah.$.Sigil.NORMAL_USER = "";
cah.$.Sigil.ADMIN = "@";
cah.$.Sigil.ID_CODE = "+";
cah.$.LongPollResponse = function() {
// Dummy constructor to make Eclipse auto-complete.
};
cah.$.LongPollResponse.prototype.dummyForAutocomplete = undefined;
cah.$.LongPollResponse.PLAY_TIMER = "Pt";
cah.$.LongPollResponse.PLAYER_INFO = "pi";
cah.$.LongPollResponse.FROM = "f";
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.FROM_ADMIN = "fa";
cah.$.LongPollResponse.TIMESTAMP = "ts";
cah.$.LongPollResponse.GAME_INFO = "gi";
cah.$.LongPollResponse.ERROR = "e";
cah.$.LongPollResponse.ID_CODE = "idc";
cah.$.LongPollResponse.REASON = "qr";
cah.$.LongPollResponse.WALL = "wall";
cah.$.LongPollResponse.ROUND_WINNER = "rw";
cah.$.LongPollResponse.SIGIL = "?";
cah.$.LongPollResponse.EMOTE = "me";
cah.$.LongPollResponse.CARDCAST_DECK_INFO = "cdi";
cah.$.LongPollResponse.GAME_ID = "gid";
cah.$.LongPollResponse.ROUND_PERMALINK = "rP";
cah.$.LongPollResponse.NICKNAME = "n";
cah.$.LongPollResponse.BLACK_CARD = "bc";
cah.$.LongPollResponse.GAME_PERMALINK = "gp";
cah.$.LongPollResponse.GAME_STATE = "gs";
cah.$.LongPollResponse.INTERMISSION = "i";
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.FILTERED_CHAT = "FC";
cah.$.LongPollEvent.GAME_STATE_CHANGE = "gsc";
cah.$.ErrorCode = function() { cah.$.ErrorCode = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
@ -263,7 +209,7 @@ cah.$.ErrorCode_msg['B&'] = "Banned.";
cah.$.ErrorCode_msg['mtl'] = "Messages cannot be longer than 200 characters."; 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['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['rW'] = "You must use more unique words in your message."; cah.$.ErrorCode_msg['rW'] = "You must use more unique words in your message.";
cah.$.ErrorCode_msg['serr'] = "An error occured on the server."; cah.$.ErrorCode_msg['serr'] = "An error occurred on the server.";
cah.$.ErrorCode_msg['CL'] = "Try turning caps lock off."; cah.$.ErrorCode_msg['CL'] = "Try turning caps lock off.";
cah.$.ErrorCode_msg['dnhc'] = "You don't have that card."; cah.$.ErrorCode_msg['dnhc'] = "You don't have that card.";
cah.$.ErrorCode_msg['as'] = "The game has already started."; cah.$.ErrorCode_msg['as'] = "The game has already started.";
@ -285,90 +231,144 @@ cah.$.ErrorInformation.WHITE_CARDS_REQUIRED = "wcr";
cah.$.ErrorInformation.BLACK_CARDS_REQUIRED = "bcr"; cah.$.ErrorInformation.BLACK_CARDS_REQUIRED = "bcr";
cah.$.ErrorInformation.BLACK_CARDS_PRESENT = "bcp"; cah.$.ErrorInformation.BLACK_CARDS_PRESENT = "bcp";
cah.$.AjaxResponse = function() { cah.$.GameInfo = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.AjaxResponse.prototype.dummyForAutocomplete = undefined; cah.$.GameInfo.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxResponse.NAMES = "nl"; cah.$.GameInfo.GAME_OPTIONS = "go";
cah.$.AjaxResponse.CLIENT_NAME = "cn"; cah.$.GameInfo.CREATED = "gca";
cah.$.AjaxResponse.PLAYER_INFO = "pi"; cah.$.GameInfo.PLAYERS = "P";
cah.$.AjaxResponse.CONNECTED_AT = "ca"; cah.$.GameInfo.SPECTATORS = "V";
cah.$.AjaxResponse.WHITE_CARDS = "wc"; cah.$.GameInfo.HOST = "H";
cah.$.AjaxResponse.HAND = "h"; cah.$.GameInfo.STATE = "S";
cah.$.AjaxResponse.ERROR_CODE = "ec"; cah.$.GameInfo.ID = "gid";
cah.$.AjaxResponse.GLOBAL_CHAT_ENABLED = "gce"; cah.$.GameInfo.HAS_PASSWORD = "hp";
cah.$.AjaxResponse.SERVER_STARTED = "SS";
cah.$.AjaxResponse.NEXT = "next";
cah.$.AjaxResponse.GAME_INFO = "gi";
cah.$.AjaxResponse.ERROR = "e";
cah.$.AjaxResponse.GAME_STATE_DESCRIPTION = "gss";
cah.$.AjaxResponse.ID_CODE = "idc";
cah.$.AjaxResponse.CARD_SETS = "css";
cah.$.AjaxResponse.SERIAL = "s";
cah.$.AjaxResponse.PERSISTENT_ID = "pid";
cah.$.AjaxResponse.USER_PERMALINK = "up";
cah.$.AjaxResponse.GAMES = "gl";
cah.$.AjaxResponse.SIGIL = "?";
cah.$.AjaxResponse.GAME_ID = "gid";
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.GAME_PERMALINK = "gp";
cah.$.AjaxResponse.IDLE = "idl";
cah.$.AjaxResponse.CARD_ID = "cid";
cah.$.AjaxResponse.IP_ADDRESS = "IP";
cah.$.AjaxResponse.SESSION_PERMALINK = "sP";
cah.$.AjaxRequest = function() { cah.$.GameOptionData = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.AjaxRequest.prototype.dummyForAutocomplete = undefined; cah.$.GameOptionData.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxRequest.SERIAL = "s"; cah.$.GameOptionData.TIMER_MULTIPLIER = "tm";
cah.$.AjaxRequest.OP = "o"; cah.$.GameOptionData.PASSWORD = "pw";
cah.$.AjaxRequest.WALL = "wall"; cah.$.GameOptionData.SPECTATOR_LIMIT = "vL";
cah.$.AjaxRequest.PERSISTENT_ID = "pid"; cah.$.GameOptionData.SCORE_LIMIT = "sl";
cah.$.AjaxRequest.EMOTE = "me"; cah.$.GameOptionData.BLANKS_LIMIT = "bl";
cah.$.AjaxRequest.CARDCAST_ID = "cci"; cah.$.GameOptionData.PLAYER_LIMIT = "pL";
cah.$.AjaxRequest.GAME_ID = "gid"; cah.$.GameOptionData.CARD_SETS = "css";
cah.$.AjaxRequest.GAME_OPTIONS = "go";
cah.$.AjaxRequest.MESSAGE = "m";
cah.$.AjaxRequest.NICKNAME = "n";
cah.$.AjaxRequest.PASSWORD = "pw";
cah.$.AjaxRequest.CARD_ID = "cid";
cah.$.AjaxRequest.ID_CODE = "idc";
cah.$.AjaxOperation = function() { cah.$.GamePlayerInfo = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.AjaxOperation.prototype.dummyForAutocomplete = undefined; cah.$.GamePlayerInfo.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxOperation.NAMES = "gn"; cah.$.GamePlayerInfo.STATUS = "st";
cah.$.AjaxOperation.SCORE = "SC"; cah.$.GamePlayerInfo.SCORE = "sc";
cah.$.AjaxOperation.LEAVE_GAME = "lg"; cah.$.GamePlayerInfo.NAME = "N";
cah.$.AjaxOperation.JOIN_GAME = "jg";
cah.$.AjaxOperation.CHAT = "c"; cah.$.GamePlayerStatus = function() {
cah.$.AjaxOperation.GAME_LIST = "ggl"; // Dummy constructor to make Eclipse auto-complete.
cah.$.AjaxOperation.CARDCAST_ADD_CARDSET = "cac"; };
cah.$.AjaxOperation.CARDCAST_LIST_CARDSETS = "clc"; cah.$.GamePlayerStatus.prototype.dummyForAutocomplete = undefined;
cah.$.AjaxOperation.PLAY_CARD = "pc"; cah.$.GamePlayerStatus.SPECTATOR = "sv";
cah.$.AjaxOperation.CHANGE_GAME_OPTIONS = "cgo"; cah.$.GamePlayerStatus.WINNER = "sw";
cah.$.AjaxOperation.GET_GAME_INFO = "ggi"; cah.$.GamePlayerStatus.IDLE = "si";
cah.$.AjaxOperation.GET_CARDS = "gc"; cah.$.GamePlayerStatus.HOST = "sh";
cah.$.AjaxOperation.ADMIN_SET_VERBOSE_LOG = "svl"; cah.$.GamePlayerStatus.JUDGING = "sjj";
cah.$.AjaxOperation.REGISTER = "r"; cah.$.GamePlayerStatus.JUDGE = "sj";
cah.$.AjaxOperation.CARDCAST_REMOVE_CARDSET = "crc"; cah.$.GamePlayerStatus.PLAYING = "sp";
cah.$.AjaxOperation.WHOIS = "Wi"; cah.$.GamePlayerStatus_msg = {};
cah.$.AjaxOperation.KICK = "K"; cah.$.GamePlayerStatus_msg['sjj'] = "Selecting";
cah.$.AjaxOperation.FIRST_LOAD = "fl"; cah.$.GamePlayerStatus_msg['sv'] = "Spectator";
cah.$.AjaxOperation.START_GAME = "sg"; cah.$.GamePlayerStatus_msg['sw'] = "Winner!";
cah.$.AjaxOperation.LOG_OUT = "lo"; cah.$.GamePlayerStatus_msg['sh'] = "Host";
cah.$.AjaxOperation.BAN = "b"; cah.$.GamePlayerStatus_msg['si'] = "";
cah.$.AjaxOperation.CREATE_GAME = "cg"; cah.$.GamePlayerStatus_msg['sj'] = "Card Czar";
cah.$.AjaxOperation.STOP_GAME = "Sg"; cah.$.GamePlayerStatus_msg['sp'] = "Playing";
cah.$.AjaxOperation.GAME_CHAT = "GC"; cah.$.GamePlayerStatus_msg_2 = {};
cah.$.AjaxOperation.SPECTATE_GAME = "vg"; cah.$.GamePlayerStatus_msg_2['sjj'] = "Select a winning card.";
cah.$.AjaxOperation.JUDGE_SELECT = "js"; 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.JUDGING = "j";
cah.$.GameState.PLAYING = "p";
cah.$.GameState_msg = {};
cah.$.GameState_msg['p'] = "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.FILTERED_CHAT = "FC";
cah.$.LongPollEvent.GAME_STATE_CHANGE = "gsc";
cah.$.LongPollResponse = function() {
// Dummy constructor to make Eclipse auto-complete.
};
cah.$.LongPollResponse.prototype.dummyForAutocomplete = undefined;
cah.$.LongPollResponse.PLAY_TIMER = "Pt";
cah.$.LongPollResponse.PLAYER_INFO = "pi";
cah.$.LongPollResponse.FROM = "f";
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.FROM_ADMIN = "fa";
cah.$.LongPollResponse.TIMESTAMP = "ts";
cah.$.LongPollResponse.GAME_INFO = "gi";
cah.$.LongPollResponse.ERROR = "e";
cah.$.LongPollResponse.ID_CODE = "idc";
cah.$.LongPollResponse.REASON = "qr";
cah.$.LongPollResponse.WALL = "wall";
cah.$.LongPollResponse.ROUND_WINNER = "rw";
cah.$.LongPollResponse.SIGIL = "?";
cah.$.LongPollResponse.EMOTE = "me";
cah.$.LongPollResponse.CARDCAST_DECK_INFO = "cdi";
cah.$.LongPollResponse.GAME_ID = "gid";
cah.$.LongPollResponse.ROUND_PERMALINK = "rP";
cah.$.LongPollResponse.NICKNAME = "n";
cah.$.LongPollResponse.BLACK_CARD = "bc";
cah.$.LongPollResponse.GAME_PERMALINK = "gp";
cah.$.LongPollResponse.GAME_STATE = "gs";
cah.$.LongPollResponse.INTERMISSION = "i";
cah.$.ReconnectNextAction = function() { cah.$.ReconnectNextAction = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
@ -377,19 +377,20 @@ cah.$.ReconnectNextAction.prototype.dummyForAutocomplete = undefined;
cah.$.ReconnectNextAction.GAME = "game"; cah.$.ReconnectNextAction.GAME = "game";
cah.$.ReconnectNextAction.NONE = "none"; cah.$.ReconnectNextAction.NONE = "none";
cah.$.DisconnectReason = function() { cah.$.Sigil = function() {
// Dummy constructor to make Eclipse auto-complete. // Dummy constructor to make Eclipse auto-complete.
}; };
cah.$.DisconnectReason.prototype.dummyForAutocomplete = undefined; cah.$.Sigil.prototype.dummyForAutocomplete = undefined;
cah.$.DisconnectReason.PING_TIMEOUT = "pt"; cah.$.Sigil.NORMAL_USER = "";
cah.$.DisconnectReason.BANNED = "B&"; cah.$.Sigil.ADMIN = "@";
cah.$.DisconnectReason.IDLE_TIMEOUT = "it"; cah.$.Sigil.ID_CODE = "+";
cah.$.DisconnectReason.KICKED = "k";
cah.$.DisconnectReason.MANUAL = "man"; cah.$.WhiteCardData = function() {
cah.$.DisconnectReason_msg = {}; // Dummy constructor to make Eclipse auto-complete.
cah.$.DisconnectReason_msg['B&'] = "Banned"; };
cah.$.DisconnectReason_msg['pt'] = "Ping timeout"; cah.$.WhiteCardData.prototype.dummyForAutocomplete = undefined;
cah.$.DisconnectReason_msg['it'] = "Kicked due to idle"; cah.$.WhiteCardData.WRITE_IN = "wi";
cah.$.DisconnectReason_msg['k'] = "Kicked by server administrator"; cah.$.WhiteCardData.TEXT = "T";
cah.$.DisconnectReason_msg['man'] = "Leaving"; cah.$.WhiteCardData.ID = "cid";
cah.$.WhiteCardData.WATERMARK = "W";

View File

@ -335,6 +335,9 @@ cah.Game.joinGame = function(gameId, data) {
game.showGamePermalink_(data); game.showGamePermalink_(data);
cah.updateHash('game=' + gameId); cah.updateHash('game=' + gameId);
if (!cah.GAME_CHAT_ENABLED) {
cah.log.status_with_game(game, "IMPORTANT: Game chat has been disabled.", "error");
}
}; };
/** /**

View File

@ -4,6 +4,7 @@ pyx.max_games=25
pyx.include_inactive_cardsets=true pyx.include_inactive_cardsets=true
pyx.broadcast_connects_and_disconnects=true pyx.broadcast_connects_and_disconnects=true
pyx.global_chat_enabled=true pyx.global_chat_enabled=true
pyx.game_chat_enabled=true
# allow fill-in-the-blank cards at all. Limits are set via constants in GameOptions. # allow fill-in-the-blank cards at all. Limits are set via constants in GameOptions.
pyx.allow_blank_cards=true pyx.allow_blank_cards=true
# allow identification codes to be used without HTTPS # allow identification codes to be used without HTTPS

View File

@ -4,111 +4,158 @@ package pyx
import () import ()
// GamePlayerStatus // AjaxOperation
const ( const (
GamePlayerStatus_SPECTATOR = "sv" AjaxOperation_NAMES = "gn"
GamePlayerStatus_WINNER = "sw" AjaxOperation_SCORE = "SC"
GamePlayerStatus_IDLE = "si" AjaxOperation_LEAVE_GAME = "lg"
GamePlayerStatus_HOST = "sh" AjaxOperation_JOIN_GAME = "jg"
GamePlayerStatus_JUDGING = "sjj" AjaxOperation_CHAT = "c"
GamePlayerStatus_JUDGE = "sj" AjaxOperation_GAME_LIST = "ggl"
GamePlayerStatus_PLAYING = "sp" AjaxOperation_CARDCAST_ADD_CARDSET = "cac"
AjaxOperation_CARDCAST_LIST_CARDSETS = "clc"
AjaxOperation_PLAY_CARD = "pc"
AjaxOperation_CHANGE_GAME_OPTIONS = "cgo"
AjaxOperation_GET_GAME_INFO = "ggi"
AjaxOperation_GET_CARDS = "gc"
AjaxOperation_ADMIN_SET_VERBOSE_LOG = "svl"
AjaxOperation_REGISTER = "r"
AjaxOperation_CARDCAST_REMOVE_CARDSET = "crc"
AjaxOperation_WHOIS = "Wi"
AjaxOperation_KICK = "K"
AjaxOperation_FIRST_LOAD = "fl"
AjaxOperation_START_GAME = "sg"
AjaxOperation_LOG_OUT = "lo"
AjaxOperation_BAN = "b"
AjaxOperation_CREATE_GAME = "cg"
AjaxOperation_STOP_GAME = "Sg"
AjaxOperation_GAME_CHAT = "GC"
AjaxOperation_SPECTATE_GAME = "vg"
AjaxOperation_JUDGE_SELECT = "js"
) )
var GamePlayerStatusMsgs = map[string]string{
"sjj": "Selecting",
"sv": "Spectator",
"sw": "Winner!",
"sh": "Host",
"si": "",
"sj": "Card Czar",
"sp": "Playing",
}
var GamePlayerStatusMsgs2 = map[string]string{ // AjaxRequest
"sjj": "Select a winning card.",
"sv": "You are just spectating.",
"sw": "You have won!",
"sh": "Wait for players then click Start Game.",
"si": "Waiting for players...",
"sj": "You are the Card Czar.",
"sp": "Select a card to play.",
}
// GamePlayerInfo
const ( const (
GamePlayerInfo_STATUS = "st" AjaxRequest_SERIAL = "s"
GamePlayerInfo_SCORE = "sc" AjaxRequest_OP = "o"
GamePlayerInfo_NAME = "N" AjaxRequest_WALL = "wall"
AjaxRequest_PERSISTENT_ID = "pid"
AjaxRequest_EMOTE = "me"
AjaxRequest_CARDCAST_ID = "cci"
AjaxRequest_GAME_ID = "gid"
AjaxRequest_GAME_OPTIONS = "go"
AjaxRequest_MESSAGE = "m"
AjaxRequest_NICKNAME = "n"
AjaxRequest_PASSWORD = "pw"
AjaxRequest_CARD_ID = "cid"
AjaxRequest_ID_CODE = "idc"
) )
type GamePlayerInfo struct { type AjaxRequest struct {
Status string `json:"st"` Serial int `json:"s"`
Score int `json:"sc"` Op string `json:"o"`
Name string `json:"N"` Wall bool `json:"wall"`
} PersistentId string `json:"pid"`
Emote bool `json:"me"`
CardcastId string `json:"cci"`
// GameOptionData GameId int `json:"gid"`
const (
GameOptionData_TIMER_MULTIPLIER = "tm"
GameOptionData_PASSWORD = "pw"
GameOptionData_SPECTATOR_LIMIT = "vL"
GameOptionData_SCORE_LIMIT = "sl"
GameOptionData_BLANKS_LIMIT = "bl"
GameOptionData_PLAYER_LIMIT = "pL"
GameOptionData_CARD_SETS = "css"
)
type GameOptionData struct {
TimerMultiplier string `json:"tm"`
Password string `json:"pw"`
SpectatorLimit int `json:"vL"`
ScoreLimit int `json:"sl"`
BlanksLimit int `json:"bl"`
PlayerLimit int `json:"pL"`
CardSets []int `json:"css"`
}
// GameInfo
const (
GameInfo_GAME_OPTIONS = "go"
GameInfo_CREATED = "gca"
GameInfo_PLAYERS = "P"
GameInfo_SPECTATORS = "V"
GameInfo_HOST = "H"
GameInfo_STATE = "S"
GameInfo_ID = "gid"
GameInfo_HAS_PASSWORD = "hp"
)
type GameInfo struct {
GameOptions GameOptionData `json:"go"` GameOptions GameOptionData `json:"go"`
Created int64 `json:"gca"` Message string `json:"m"`
Players []string `json:"P"` Nickname string `json:"n"`
Spectators []string `json:"V"` Password string `json:"pw"`
Host string `json:"H"` CardId int `json:"cid"`
State string `json:"S"` IdCode string `json:"idc"`
Id int `json:"gid"`
HasPassword bool `json:"hp"`
} }
// GameState // AjaxResponse
const ( const (
GameState_ROUND_OVER = "ro" AjaxResponse_NAMES = "nl"
GameState_LOBBY = "l" AjaxResponse_CLIENT_NAME = "cn"
GameState_JUDGING = "j" AjaxResponse_GAME_CHAT_ENABLED = "Gce"
GameState_PLAYING = "p" AjaxResponse_PLAYER_INFO = "pi"
AjaxResponse_CONNECTED_AT = "ca"
AjaxResponse_WHITE_CARDS = "wc"
AjaxResponse_HAND = "h"
AjaxResponse_ERROR_CODE = "ec"
AjaxResponse_GLOBAL_CHAT_ENABLED = "gce"
AjaxResponse_SERVER_STARTED = "SS"
AjaxResponse_NEXT = "next"
AjaxResponse_GAME_INFO = "gi"
AjaxResponse_ERROR = "e"
AjaxResponse_GAME_STATE_DESCRIPTION = "gss"
AjaxResponse_ID_CODE = "idc"
AjaxResponse_CARD_SETS = "css"
AjaxResponse_SERIAL = "s"
AjaxResponse_PERSISTENT_ID = "pid"
AjaxResponse_USER_PERMALINK = "up"
AjaxResponse_GAMES = "gl"
AjaxResponse_SIGIL = "?"
AjaxResponse_GAME_ID = "gid"
AjaxResponse_MAX_GAMES = "mg"
AjaxResponse_IN_PROGRESS = "ip"
AjaxResponse_GAME_OPTIONS = "go"
AjaxResponse_NICKNAME = "n"
AjaxResponse_BLACK_CARD = "bc"
AjaxResponse_GAME_PERMALINK = "gp"
AjaxResponse_IDLE = "idl"
AjaxResponse_CARD_ID = "cid"
AjaxResponse_IP_ADDRESS = "IP"
AjaxResponse_SESSION_PERMALINK = "sP"
) )
var GameStateMsgs = map[string]string{ type AjaxResponse struct {
"p": "In Progress", Names []string `json:"nl"`
"j": "In Progress", ClientName string `json:"cn"`
"l": "Not Started", GameChatEnabled bool `json:"Gce"`
"ro": "In Progress", PlayerInfo []GamePlayerInfo `json:"pi"`
ConnectedAt int64 `json:"ca"`
WhiteCards []int `json:"wc"`
Hand []int `json:"h"`
ErrorCode string `json:"ec"`
GlobalChatEnabled bool `json:"gce"`
ServerStarted int64 `json:"SS"`
Next string `json:"next"`
GameInfo GameInfo `json:"gi"`
Error bool `json:"e"`
GameStateDescription string `json:"gss"`
IdCode string `json:"idc"`
CardSets []CardSetData `json:"css"`
Serial int `json:"s"`
PersistentId string `json:"pid"`
UserPermalink string `json:"up"`
Games []GameInfo `json:"gl"`
Sigil string `json:"?"`
GameId *int `json:"gid"`
MaxGames int `json:"mg"`
InProgress bool `json:"ip"`
GameOptions GameOptionData `json:"go"`
Nickname string `json:"n"`
BlackCard int `json:"bc"`
GamePermalink string `json:"gp"`
Idle int64 `json:"idl"`
CardId int `json:"cid"`
IpAddress string `json:"IP"`
SessionPermalink string `json:"sP"`
}
// BlackCardData
const (
BlackCardData_DRAW = "D"
BlackCardData_PICK = "PK"
BlackCardData_TEXT = "T"
BlackCardData_ID = "cid"
BlackCardData_WATERMARK = "W"
)
type BlackCardData struct {
Draw int `json:"D"`
Pick int `json:"PK"`
Text string `json:"T"`
Id int `json:"cid"`
Watermark string `json:"W"`
} }
@ -134,142 +181,24 @@ type CardSetData struct {
} }
// BlackCardData // DisconnectReason
const ( const (
BlackCardData_DRAW = "D" DisconnectReason_PING_TIMEOUT = "pt"
BlackCardData_PICK = "PK" DisconnectReason_BANNED = "B&"
BlackCardData_TEXT = "T" DisconnectReason_IDLE_TIMEOUT = "it"
BlackCardData_ID = "cid" DisconnectReason_KICKED = "k"
BlackCardData_WATERMARK = "W" DisconnectReason_MANUAL = "man"
) )
type BlackCardData struct { var DisconnectReasonMsgs = map[string]string{
Draw int `json:"D"` "B&": "Banned",
Pick int `json:"PK"` "pt": "Ping timeout",
Text string `json:"T"` "it": "Kicked due to idle",
Id int `json:"cid"` "k": "Kicked by server administrator",
Watermark string `json:"W"` "man": "Leaving",
} }
// WhiteCardData
const (
WhiteCardData_WRITE_IN = "wi"
WhiteCardData_TEXT = "T"
WhiteCardData_ID = "cid"
WhiteCardData_WATERMARK = "W"
)
type WhiteCardData struct {
WriteIn bool `json:"wi"`
Text string `json:"T"`
Id int `json:"cid"`
Watermark string `json:"W"`
}
// Sigil
const (
Sigil_NORMAL_USER = ""
Sigil_ADMIN = "@"
Sigil_ID_CODE = "+"
)
// LongPollResponse
const (
LongPollResponse_PLAY_TIMER = "Pt"
LongPollResponse_PLAYER_INFO = "pi"
LongPollResponse_FROM = "f"
LongPollResponse_WHITE_CARDS = "wc"
LongPollResponse_EVENT = "E"
LongPollResponse_HAND = "h"
LongPollResponse_ERROR_CODE = "ec"
LongPollResponse_MESSAGE = "m"
LongPollResponse_WINNING_CARD = "WC"
LongPollResponse_FROM_ADMIN = "fa"
LongPollResponse_TIMESTAMP = "ts"
LongPollResponse_GAME_INFO = "gi"
LongPollResponse_ERROR = "e"
LongPollResponse_ID_CODE = "idc"
LongPollResponse_REASON = "qr"
LongPollResponse_WALL = "wall"
LongPollResponse_ROUND_WINNER = "rw"
LongPollResponse_SIGIL = "?"
LongPollResponse_EMOTE = "me"
LongPollResponse_CARDCAST_DECK_INFO = "cdi"
LongPollResponse_GAME_ID = "gid"
LongPollResponse_ROUND_PERMALINK = "rP"
LongPollResponse_NICKNAME = "n"
LongPollResponse_BLACK_CARD = "bc"
LongPollResponse_GAME_PERMALINK = "gp"
LongPollResponse_GAME_STATE = "gs"
LongPollResponse_INTERMISSION = "i"
)
type LongPollResponse struct {
PlayTimer int `json:"Pt"`
PlayerInfo []GamePlayerInfo `json:"pi"`
From string `json:"f"`
WhiteCards [][]WhiteCardData `json:"wc"`
Event string `json:"E"`
Hand []WhiteCardData `json:"h"`
ErrorCode string `json:"ec"`
Message string `json:"m"`
WinningCard int `json:"WC"`
FromAdmin bool `json:"fa"`
Timestamp int64 `json:"ts"`
GameInfo GameInfo `json:"gi"`
Error bool `json:"e"`
IdCode string `json:"idc"`
Reason string `json:"qr"`
Wall bool `json:"wall"`
RoundWinner string `json:"rw"`
Sigil string `json:"?"`
Emote bool `json:"me"`
CardcastDeckInfo string `json:"cdi"`
GameId *int `json:"gid"`
RoundPermalink string `json:"rP"`
Nickname string `json:"n"`
BlackCard BlackCardData `json:"bc"`
GamePermalink string `json:"gp"`
GameState string `json:"gs"`
Intermission int `json:"i"`
}
// LongPollEvent
const (
LongPollEvent_GAME_ROUND_COMPLETE = "grc"
LongPollEvent_BANNED = "B&"
LongPollEvent_NOOP = "_"
LongPollEvent_CHAT = "c"
LongPollEvent_GAME_PLAYER_INFO_CHANGE = "gpic"
LongPollEvent_HAND_DEAL = "hd"
LongPollEvent_CARDCAST_ADD_CARDSET = "cac"
LongPollEvent_PLAYER_LEAVE = "pl"
LongPollEvent_GAME_BLACK_RESHUFFLE = "gbr"
LongPollEvent_GAME_JUDGE_SKIPPED = "gjs"
LongPollEvent_GAME_LIST_REFRESH = "glr"
LongPollEvent_NEW_PLAYER = "np"
LongPollEvent_GAME_PLAYER_SKIPPED = "gps"
LongPollEvent_GAME_PLAYER_JOIN = "gpj"
LongPollEvent_GAME_WHITE_RESHUFFLE = "gwr"
LongPollEvent_CARDCAST_REMOVE_CARDSET = "crc"
LongPollEvent_GAME_OPTIONS_CHANGED = "goc"
LongPollEvent_GAME_PLAYER_KICKED_IDLE = "gpki"
LongPollEvent_GAME_SPECTATOR_LEAVE = "gvl"
LongPollEvent_GAME_PLAYER_LEAVE = "gpl"
LongPollEvent_GAME_SPECTATOR_JOIN = "gvj"
LongPollEvent_HURRY_UP = "hu"
LongPollEvent_GAME_JUDGE_LEFT = "gjl"
LongPollEvent_KICKED = "k"
LongPollEvent_KICKED_FROM_GAME_IDLE = "kfgi"
LongPollEvent_FILTERED_CHAT = "FC"
LongPollEvent_GAME_STATE_CHANGE = "gsc"
)
// ErrorCode // ErrorCode
const ( const (
ErrorCode_INVALID_NICK = "in" ErrorCode_INVALID_NICK = "in"
@ -353,7 +282,7 @@ var ErrorCodeMsgs = map[string]string{
"mtl": "Messages cannot be longer than 200 characters.", "mtl": "Messages cannot be longer than 200 characters.",
"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.", "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.",
"rW": "You must use more unique words in your message.", "rW": "You must use more unique words in your message.",
"serr": "An error occured on the server.", "serr": "An error occurred on the server.",
"CL": "Try turning caps lock off.", "CL": "Try turning caps lock off.",
"dnhc": "You don't have that card.", "dnhc": "You don't have that card.",
"as": "The game has already started.", "as": "The game has already started.",
@ -377,141 +306,208 @@ const (
) )
// AjaxResponse // GameInfo
const ( const (
AjaxResponse_NAMES = "nl" GameInfo_GAME_OPTIONS = "go"
AjaxResponse_CLIENT_NAME = "cn" GameInfo_CREATED = "gca"
AjaxResponse_PLAYER_INFO = "pi" GameInfo_PLAYERS = "P"
AjaxResponse_CONNECTED_AT = "ca" GameInfo_SPECTATORS = "V"
AjaxResponse_WHITE_CARDS = "wc" GameInfo_HOST = "H"
AjaxResponse_HAND = "h" GameInfo_STATE = "S"
AjaxResponse_ERROR_CODE = "ec" GameInfo_ID = "gid"
AjaxResponse_GLOBAL_CHAT_ENABLED = "gce" GameInfo_HAS_PASSWORD = "hp"
AjaxResponse_SERVER_STARTED = "SS"
AjaxResponse_NEXT = "next"
AjaxResponse_GAME_INFO = "gi"
AjaxResponse_ERROR = "e"
AjaxResponse_GAME_STATE_DESCRIPTION = "gss"
AjaxResponse_ID_CODE = "idc"
AjaxResponse_CARD_SETS = "css"
AjaxResponse_SERIAL = "s"
AjaxResponse_PERSISTENT_ID = "pid"
AjaxResponse_USER_PERMALINK = "up"
AjaxResponse_GAMES = "gl"
AjaxResponse_SIGIL = "?"
AjaxResponse_GAME_ID = "gid"
AjaxResponse_MAX_GAMES = "mg"
AjaxResponse_IN_PROGRESS = "ip"
AjaxResponse_GAME_OPTIONS = "go"
AjaxResponse_NICKNAME = "n"
AjaxResponse_BLACK_CARD = "bc"
AjaxResponse_GAME_PERMALINK = "gp"
AjaxResponse_IDLE = "idl"
AjaxResponse_CARD_ID = "cid"
AjaxResponse_IP_ADDRESS = "IP"
AjaxResponse_SESSION_PERMALINK = "sP"
) )
type AjaxResponse struct { type GameInfo struct {
Names []string `json:"nl"` GameOptions GameOptionData `json:"go"`
ClientName string `json:"cn"` Created int64 `json:"gca"`
Players []string `json:"P"`
Spectators []string `json:"V"`
Host string `json:"H"`
State string `json:"S"`
Id int `json:"gid"`
HasPassword bool `json:"hp"`
}
// GameOptionData
const (
GameOptionData_TIMER_MULTIPLIER = "tm"
GameOptionData_PASSWORD = "pw"
GameOptionData_SPECTATOR_LIMIT = "vL"
GameOptionData_SCORE_LIMIT = "sl"
GameOptionData_BLANKS_LIMIT = "bl"
GameOptionData_PLAYER_LIMIT = "pL"
GameOptionData_CARD_SETS = "css"
)
type GameOptionData struct {
TimerMultiplier string `json:"tm"`
Password string `json:"pw"`
SpectatorLimit int `json:"vL"`
ScoreLimit int `json:"sl"`
BlanksLimit int `json:"bl"`
PlayerLimit int `json:"pL"`
CardSets []int `json:"css"`
}
// GamePlayerInfo
const (
GamePlayerInfo_STATUS = "st"
GamePlayerInfo_SCORE = "sc"
GamePlayerInfo_NAME = "N"
)
type GamePlayerInfo struct {
Status string `json:"st"`
Score int `json:"sc"`
Name string `json:"N"`
}
// GamePlayerStatus
const (
GamePlayerStatus_SPECTATOR = "sv"
GamePlayerStatus_WINNER = "sw"
GamePlayerStatus_IDLE = "si"
GamePlayerStatus_HOST = "sh"
GamePlayerStatus_JUDGING = "sjj"
GamePlayerStatus_JUDGE = "sj"
GamePlayerStatus_PLAYING = "sp"
)
var GamePlayerStatusMsgs = map[string]string{
"sjj": "Selecting",
"sv": "Spectator",
"sw": "Winner!",
"sh": "Host",
"si": "",
"sj": "Card Czar",
"sp": "Playing",
}
var GamePlayerStatusMsgs2 = map[string]string{
"sjj": "Select a winning card.",
"sv": "You are just spectating.",
"sw": "You have won!",
"sh": "Wait for players then click Start Game.",
"si": "Waiting for players...",
"sj": "You are the Card Czar.",
"sp": "Select a card to play.",
}
// GameState
const (
GameState_ROUND_OVER = "ro"
GameState_LOBBY = "l"
GameState_JUDGING = "j"
GameState_PLAYING = "p"
)
var GameStateMsgs = map[string]string{
"p": "In Progress",
"j": "In Progress",
"l": "Not Started",
"ro": "In Progress",
}
// LongPollEvent
const (
LongPollEvent_GAME_ROUND_COMPLETE = "grc"
LongPollEvent_BANNED = "B&"
LongPollEvent_NOOP = "_"
LongPollEvent_CHAT = "c"
LongPollEvent_GAME_PLAYER_INFO_CHANGE = "gpic"
LongPollEvent_HAND_DEAL = "hd"
LongPollEvent_CARDCAST_ADD_CARDSET = "cac"
LongPollEvent_PLAYER_LEAVE = "pl"
LongPollEvent_GAME_BLACK_RESHUFFLE = "gbr"
LongPollEvent_GAME_JUDGE_SKIPPED = "gjs"
LongPollEvent_GAME_LIST_REFRESH = "glr"
LongPollEvent_NEW_PLAYER = "np"
LongPollEvent_GAME_PLAYER_SKIPPED = "gps"
LongPollEvent_GAME_PLAYER_JOIN = "gpj"
LongPollEvent_GAME_WHITE_RESHUFFLE = "gwr"
LongPollEvent_CARDCAST_REMOVE_CARDSET = "crc"
LongPollEvent_GAME_OPTIONS_CHANGED = "goc"
LongPollEvent_GAME_PLAYER_KICKED_IDLE = "gpki"
LongPollEvent_GAME_SPECTATOR_LEAVE = "gvl"
LongPollEvent_GAME_PLAYER_LEAVE = "gpl"
LongPollEvent_GAME_SPECTATOR_JOIN = "gvj"
LongPollEvent_HURRY_UP = "hu"
LongPollEvent_GAME_JUDGE_LEFT = "gjl"
LongPollEvent_KICKED = "k"
LongPollEvent_KICKED_FROM_GAME_IDLE = "kfgi"
LongPollEvent_FILTERED_CHAT = "FC"
LongPollEvent_GAME_STATE_CHANGE = "gsc"
)
// LongPollResponse
const (
LongPollResponse_PLAY_TIMER = "Pt"
LongPollResponse_PLAYER_INFO = "pi"
LongPollResponse_FROM = "f"
LongPollResponse_WHITE_CARDS = "wc"
LongPollResponse_EVENT = "E"
LongPollResponse_HAND = "h"
LongPollResponse_ERROR_CODE = "ec"
LongPollResponse_MESSAGE = "m"
LongPollResponse_WINNING_CARD = "WC"
LongPollResponse_FROM_ADMIN = "fa"
LongPollResponse_TIMESTAMP = "ts"
LongPollResponse_GAME_INFO = "gi"
LongPollResponse_ERROR = "e"
LongPollResponse_ID_CODE = "idc"
LongPollResponse_REASON = "qr"
LongPollResponse_WALL = "wall"
LongPollResponse_ROUND_WINNER = "rw"
LongPollResponse_SIGIL = "?"
LongPollResponse_EMOTE = "me"
LongPollResponse_CARDCAST_DECK_INFO = "cdi"
LongPollResponse_GAME_ID = "gid"
LongPollResponse_ROUND_PERMALINK = "rP"
LongPollResponse_NICKNAME = "n"
LongPollResponse_BLACK_CARD = "bc"
LongPollResponse_GAME_PERMALINK = "gp"
LongPollResponse_GAME_STATE = "gs"
LongPollResponse_INTERMISSION = "i"
)
type LongPollResponse struct {
PlayTimer int `json:"Pt"`
PlayerInfo []GamePlayerInfo `json:"pi"` PlayerInfo []GamePlayerInfo `json:"pi"`
ConnectedAt int64 `json:"ca"` From string `json:"f"`
WhiteCards []int `json:"wc"` WhiteCards [][]WhiteCardData `json:"wc"`
Hand []int `json:"h"` Event string `json:"E"`
Hand []WhiteCardData `json:"h"`
ErrorCode string `json:"ec"` ErrorCode string `json:"ec"`
GlobalChatEnabled bool `json:"gce"` Message string `json:"m"`
ServerStarted int64 `json:"SS"` WinningCard int `json:"WC"`
Next string `json:"next"` FromAdmin bool `json:"fa"`
Timestamp int64 `json:"ts"`
GameInfo GameInfo `json:"gi"` GameInfo GameInfo `json:"gi"`
Error bool `json:"e"` Error bool `json:"e"`
GameStateDescription string `json:"gss"`
IdCode string `json:"idc"` IdCode string `json:"idc"`
CardSets []CardSetData `json:"css"` Reason string `json:"qr"`
Serial int `json:"s"`
PersistentId string `json:"pid"`
UserPermalink string `json:"up"`
Games []GameInfo `json:"gl"`
Sigil string `json:"?"`
GameId *int `json:"gid"`
MaxGames int `json:"mg"`
InProgress bool `json:"ip"`
GameOptions GameOptionData `json:"go"`
Nickname string `json:"n"`
BlackCard int `json:"bc"`
GamePermalink string `json:"gp"`
Idle int64 `json:"idl"`
CardId int `json:"cid"`
IpAddress string `json:"IP"`
SessionPermalink string `json:"sP"`
}
// AjaxRequest
const (
AjaxRequest_SERIAL = "s"
AjaxRequest_OP = "o"
AjaxRequest_WALL = "wall"
AjaxRequest_PERSISTENT_ID = "pid"
AjaxRequest_EMOTE = "me"
AjaxRequest_CARDCAST_ID = "cci"
AjaxRequest_GAME_ID = "gid"
AjaxRequest_GAME_OPTIONS = "go"
AjaxRequest_MESSAGE = "m"
AjaxRequest_NICKNAME = "n"
AjaxRequest_PASSWORD = "pw"
AjaxRequest_CARD_ID = "cid"
AjaxRequest_ID_CODE = "idc"
)
type AjaxRequest struct {
Serial int `json:"s"`
Op string `json:"o"`
Wall bool `json:"wall"` Wall bool `json:"wall"`
PersistentId string `json:"pid"` RoundWinner string `json:"rw"`
Sigil string `json:"?"`
Emote bool `json:"me"` Emote bool `json:"me"`
CardcastId string `json:"cci"` CardcastDeckInfo string `json:"cdi"`
GameId int `json:"gid"` GameId *int `json:"gid"`
GameOptions GameOptionData `json:"go"` RoundPermalink string `json:"rP"`
Message string `json:"m"`
Nickname string `json:"n"` Nickname string `json:"n"`
Password string `json:"pw"` BlackCard BlackCardData `json:"bc"`
CardId int `json:"cid"` GamePermalink string `json:"gp"`
IdCode string `json:"idc"` GameState string `json:"gs"`
Intermission int `json:"i"`
} }
// AjaxOperation
const (
AjaxOperation_NAMES = "gn"
AjaxOperation_SCORE = "SC"
AjaxOperation_LEAVE_GAME = "lg"
AjaxOperation_JOIN_GAME = "jg"
AjaxOperation_CHAT = "c"
AjaxOperation_GAME_LIST = "ggl"
AjaxOperation_CARDCAST_ADD_CARDSET = "cac"
AjaxOperation_CARDCAST_LIST_CARDSETS = "clc"
AjaxOperation_PLAY_CARD = "pc"
AjaxOperation_CHANGE_GAME_OPTIONS = "cgo"
AjaxOperation_GET_GAME_INFO = "ggi"
AjaxOperation_GET_CARDS = "gc"
AjaxOperation_ADMIN_SET_VERBOSE_LOG = "svl"
AjaxOperation_REGISTER = "r"
AjaxOperation_CARDCAST_REMOVE_CARDSET = "crc"
AjaxOperation_WHOIS = "Wi"
AjaxOperation_KICK = "K"
AjaxOperation_FIRST_LOAD = "fl"
AjaxOperation_START_GAME = "sg"
AjaxOperation_LOG_OUT = "lo"
AjaxOperation_BAN = "b"
AjaxOperation_CREATE_GAME = "cg"
AjaxOperation_STOP_GAME = "Sg"
AjaxOperation_GAME_CHAT = "GC"
AjaxOperation_SPECTATE_GAME = "vg"
AjaxOperation_JUDGE_SELECT = "js"
)
// ReconnectNextAction // ReconnectNextAction
const ( const (
ReconnectNextAction_GAME = "game" ReconnectNextAction_GAME = "game"
@ -519,21 +515,27 @@ const (
) )
// DisconnectReason // Sigil
const ( const (
DisconnectReason_PING_TIMEOUT = "pt" Sigil_NORMAL_USER = ""
DisconnectReason_BANNED = "B&" Sigil_ADMIN = "@"
DisconnectReason_IDLE_TIMEOUT = "it" Sigil_ID_CODE = "+"
DisconnectReason_KICKED = "k"
DisconnectReason_MANUAL = "man"
) )
var DisconnectReasonMsgs = map[string]string{
"B&": "Banned", // WhiteCardData
"pt": "Ping timeout", const (
"it": "Kicked due to idle", WhiteCardData_WRITE_IN = "wi"
"k": "Kicked by server administrator", WhiteCardData_TEXT = "T"
"man": "Leaving", WhiteCardData_ID = "cid"
WhiteCardData_WATERMARK = "W"
)
type WhiteCardData struct {
WriteIn bool `json:"wi"`
Text string `json:"T"`
Id int `json:"cid"`
Watermark string `json:"W"`
} }

View File

@ -4,6 +4,7 @@ pyx.server.max_users=${pyx.max_users}
pyx.server.max_games=${pyx.max_games} pyx.server.max_games=${pyx.max_games}
pyx.server.broadcast_connects_and_disconnects=${pyx.broadcast_connects_and_disconnects} pyx.server.broadcast_connects_and_disconnects=${pyx.broadcast_connects_and_disconnects}
pyx.server.global_chat_enabled=${pyx.global_chat_enabled} pyx.server.global_chat_enabled=${pyx.global_chat_enabled}
pyx.server.game_chat_enabled=${pyx.game_chat_enabled}
pyx.server.allow_blank_cards=${pyx.allow_blank_cards} pyx.server.allow_blank_cards=${pyx.allow_blank_cards}
pyx.server.id_code_salt=${pyx.id_code_salt} pyx.server.id_code_salt=${pyx.id_code_salt}
pyx.server.admin_addrs=${pyx.admin_addrs} pyx.server.admin_addrs=${pyx.admin_addrs}

View File

@ -169,6 +169,14 @@ public class CahModule extends AbstractModule {
} }
} }
@Provides
@GameChatEnabled
Boolean provideGameChatEnabled() {
synchronized (properties) {
return Boolean.valueOf(properties.getProperty("pyx.server.game_chat_enabled", "true"));
}
}
@Provides @Provides
@ShowGamePermalink @ShowGamePermalink
Boolean provideShowGamePermalink() { Boolean provideShowGamePermalink() {
@ -365,6 +373,11 @@ public class CahModule extends AbstractModule {
public @interface GlobalChatEnabled { public @interface GlobalChatEnabled {
} }
@BindingAnnotation
@Retention(RetentionPolicy.RUNTIME)
public @interface GameChatEnabled {
}
@BindingAnnotation @BindingAnnotation
@Retention(RetentionPolicy.RUNTIME) @Retention(RetentionPolicy.RUNTIME)
public @interface InsecureIdAllowed { public @interface InsecureIdAllowed {

View File

@ -274,6 +274,8 @@ public class Constants {
@GoDataType("[]GameInfo") @GoDataType("[]GameInfo")
GAMES("gl"), GAMES("gl"),
@GoDataType("bool") @GoDataType("bool")
GAME_CHAT_ENABLED("Gce"),
@GoDataType("bool")
GLOBAL_CHAT_ENABLED("gce"), GLOBAL_CHAT_ENABLED("gce"),
@GoDataType("[]int") @GoDataType("[]int")
HAND("h"), HAND("h"),

View File

@ -39,6 +39,7 @@ import org.hibernate.Transaction;
import com.google.inject.Inject; import com.google.inject.Inject;
import net.socialgamer.cah.CahModule.BanList; import net.socialgamer.cah.CahModule.BanList;
import net.socialgamer.cah.CahModule.GameChatEnabled;
import net.socialgamer.cah.CahModule.GlobalChatEnabled; import net.socialgamer.cah.CahModule.GlobalChatEnabled;
import net.socialgamer.cah.CahModule.IncludeInactiveCardsets; import net.socialgamer.cah.CahModule.IncludeInactiveCardsets;
import net.socialgamer.cah.CahModule.ServerStarted; import net.socialgamer.cah.CahModule.ServerStarted;
@ -72,6 +73,7 @@ public class FirstLoadHandler extends Handler {
private final Set<String> banList; private final Set<String> banList;
private final Session hibernateSession; private final Session hibernateSession;
private final boolean includeInactiveCardsets; private final boolean includeInactiveCardsets;
private final boolean gameChatEnabled;
private final boolean globalChatEnabled; private final boolean globalChatEnabled;
private final boolean showSessionPermalink; private final boolean showSessionPermalink;
private final String sessionPermalinkFormatString; private final String sessionPermalinkFormatString;
@ -82,6 +84,7 @@ public class FirstLoadHandler extends Handler {
@Inject @Inject
public FirstLoadHandler(final Session hibernateSession, @BanList final Set<String> banList, public FirstLoadHandler(final Session hibernateSession, @BanList final Set<String> banList,
@IncludeInactiveCardsets final boolean includeInactiveCardsets, @IncludeInactiveCardsets final boolean includeInactiveCardsets,
@GameChatEnabled final boolean gameChatEnabled,
@GlobalChatEnabled final boolean globalChatEnabled, @GlobalChatEnabled final boolean globalChatEnabled,
@ServerStarted final Date serverStarted, @ServerStarted final Date serverStarted,
@ShowSessionPermalink final boolean showSessionPermalink, @ShowSessionPermalink final boolean showSessionPermalink,
@ -91,6 +94,7 @@ public class FirstLoadHandler extends Handler {
this.banList = banList; this.banList = banList;
this.hibernateSession = hibernateSession; this.hibernateSession = hibernateSession;
this.includeInactiveCardsets = includeInactiveCardsets; this.includeInactiveCardsets = includeInactiveCardsets;
this.gameChatEnabled = gameChatEnabled;
this.globalChatEnabled = globalChatEnabled; this.globalChatEnabled = globalChatEnabled;
this.serverStarted = serverStarted; this.serverStarted = serverStarted;
this.showSessionPermalink = showSessionPermalink; this.showSessionPermalink = showSessionPermalink;
@ -103,6 +107,7 @@ public class FirstLoadHandler extends Handler {
public Map<ReturnableData, Object> handle(final RequestWrapper request, public Map<ReturnableData, Object> handle(final RequestWrapper request,
final HttpSession session) { final HttpSession session) {
final HashMap<ReturnableData, Object> ret = new HashMap<ReturnableData, Object>(); final HashMap<ReturnableData, Object> ret = new HashMap<ReturnableData, Object>();
ret.put(AjaxResponse.GAME_CHAT_ENABLED, gameChatEnabled);
ret.put(AjaxResponse.GLOBAL_CHAT_ENABLED, globalChatEnabled); ret.put(AjaxResponse.GLOBAL_CHAT_ENABLED, globalChatEnabled);
if (banList.contains(request.getRemoteAddr())) { if (banList.contains(request.getRemoteAddr())) {

View File

@ -32,6 +32,7 @@ import org.apache.log4j.Logger;
import com.google.inject.Inject; import com.google.inject.Inject;
import net.socialgamer.cah.CahModule.GameChatEnabled;
import net.socialgamer.cah.Constants.AjaxOperation; import net.socialgamer.cah.Constants.AjaxOperation;
import net.socialgamer.cah.Constants.AjaxRequest; import net.socialgamer.cah.Constants.AjaxRequest;
import net.socialgamer.cah.Constants.ErrorCode; import net.socialgamer.cah.Constants.ErrorCode;
@ -59,13 +60,15 @@ public class GameChatHandler extends GameWithPlayerHandler {
private final ChatFilter chatFilter; private final ChatFilter chatFilter;
private final ConnectedUsers users; private final ConnectedUsers users;
private final boolean gameChatEnabled;
@Inject @Inject
public GameChatHandler(final GameManager gameManager, final ChatFilter chatFilter, public GameChatHandler(final GameManager gameManager, final ChatFilter chatFilter,
final ConnectedUsers users) { final ConnectedUsers users, @GameChatEnabled final boolean gameChatEnabled) {
super(gameManager); super(gameManager);
this.chatFilter = chatFilter; this.chatFilter = chatFilter;
this.users = users; this.users = users;
this.gameChatEnabled = gameChatEnabled;
} }
@Override @Override
@ -78,6 +81,9 @@ public class GameChatHandler extends GameWithPlayerHandler {
LongPollEvent event = LongPollEvent.CHAT; LongPollEvent event = LongPollEvent.CHAT;
if (request.getParameter(AjaxRequest.MESSAGE) == null) { if (request.getParameter(AjaxRequest.MESSAGE) == null) {
return error(ErrorCode.NO_MSG_SPECIFIED); return error(ErrorCode.NO_MSG_SPECIFIED);
} else if (!gameChatEnabled && !user.isAdmin()) {
// game chat can be turned off in the properties file
return error(ErrorCode.NOT_ADMIN);
} else { } else {
final String message = request.getParameter(AjaxRequest.MESSAGE).trim(); final String message = request.getParameter(AjaxRequest.MESSAGE).trim();

View File

@ -38,6 +38,7 @@ import com.google.inject.Key;
import net.socialgamer.cah.CahModule.BroadcastConnectsAndDisconnects; import net.socialgamer.cah.CahModule.BroadcastConnectsAndDisconnects;
import net.socialgamer.cah.CahModule.CookieDomain; import net.socialgamer.cah.CahModule.CookieDomain;
import net.socialgamer.cah.CahModule.GameChatEnabled;
import net.socialgamer.cah.CahModule.GlobalChatEnabled; import net.socialgamer.cah.CahModule.GlobalChatEnabled;
import net.socialgamer.cah.CahModule.InsecureIdAllowed; import net.socialgamer.cah.CahModule.InsecureIdAllowed;
import net.socialgamer.cah.StartupUtils; import net.socialgamer.cah.StartupUtils;
@ -79,12 +80,15 @@ public class JavascriptConfigServlet extends HttpServlet {
final Injector injector = (Injector) getServletContext().getAttribute(StartupUtils.INJECTOR); final Injector injector = (Injector) getServletContext().getAttribute(StartupUtils.INJECTOR);
final String cookieDomain = injector.getInstance(Key.get(String.class, CookieDomain.class)); final String cookieDomain = injector.getInstance(Key.get(String.class, CookieDomain.class));
final Boolean globalChatEnabled = injector.getInstance(Key.get(Boolean.class, GlobalChatEnabled.class)); final Boolean globalChatEnabled = injector.getInstance(Key.get(Boolean.class, GlobalChatEnabled.class));
final Boolean gameChatEnabled = injector
.getInstance(Key.get(Boolean.class, GameChatEnabled.class));
final Boolean insecureIdAllowed = injector final Boolean insecureIdAllowed = injector
.getInstance(Key.get(Boolean.class, InsecureIdAllowed.class)); .getInstance(Key.get(Boolean.class, InsecureIdAllowed.class));
final Boolean broadcastingUsers = injector final Boolean broadcastingUsers = injector
.getInstance(Key.get(Boolean.class, BroadcastConnectsAndDisconnects.class)); .getInstance(Key.get(Boolean.class, BroadcastConnectsAndDisconnects.class));
builder.append(String.format("cah.COOKIE_DOMAIN = '%s';\n", cookieDomain)); builder.append(String.format("cah.COOKIE_DOMAIN = '%s';\n", cookieDomain));
builder.append(String.format("cah.GLOBAL_CHAT_ENABLED = %b;\n", globalChatEnabled)); builder.append(String.format("cah.GLOBAL_CHAT_ENABLED = %b;\n", globalChatEnabled));
builder.append(String.format("cah.GAME_CHAT_ENABLED = %b;\n", gameChatEnabled));
builder.append(String.format("cah.INSECURE_ID_ALLOWED = %b;\n", insecureIdAllowed)); builder.append(String.format("cah.INSECURE_ID_ALLOWED = %b;\n", insecureIdAllowed));
builder.append(String.format("cah.BROADCASTING_USERS = %b;\n", broadcastingUsers)); builder.append(String.format("cah.BROADCASTING_USERS = %b;\n", broadcastingUsers));