600, "Active Stats" => 3600, "Autoboot Mutex" => 300, "Board" => 3600, "Board List" => 3600, "Boot List" => 3600, "Current Turns" => 86400, "Game" => 3600, "Game Mutex" => 10, "New Users" => 600, "Open Game List" => 86400, "Popularity" => 432000, "Rankings" => 86400, "Server Settings" => 3600, "Sessions" => 300, "Stats" => 3600, "Tags" => 600, "Timestamp Writeback Interval" => 30, "Tournament_CheckReady_Mutex" => 300, "Top Board Ranks" => 86400, "Usernames" => 86400, "Users" => 300 ); // connect to memcache on Linux (PROD) or memcached on Mac (DEV) - used across entire site so easier to define it here // if (PHP_OS == "Darwin") $memcache = new Memcached; // else $memcache = new Memcache; $memcache->addServer('localhost', 11211); // MySQL System Tables $TBL_BLOCK_EMAIL = "block_email"; // MySQL blocked email addresses table $TBL_COUNTRIES = "countries"; // MySQL country names $TBL_EVENTS_STRIPE = "events_stripe"; $TBL_HISTORY = "history"; // MySQL generic history storage table $TBL_INFO = "info"; // MySQL information pages $TBL_SEARCH_HISTORY = "search_history"; // MySQL search history - stores search terms used by users and prevents spamming $TBL_SEARCH_RESULTS = "search_results"; // MySQL search results - stores results retrieved by search for caching and display $TBL_SESSIONS = "sessions"; // MySQL sessions info table $TBL_SETTINGS = "settings"; // MySQL server settings table $TBL_USERS = "users"; // MySQL user info table $TBL_USERS_FRIENDS = "users_friends"; // MySQL friends users table $TBL_USERS_ENEMIES = "users_enemies"; // MySQL enemies users table $TBL_USERS_REG = "users_reg"; // MySQL user registrations table // MySQL Private Messaging Tables $TBL_MSGS = "msgs"; // MySQL message store $TBL_MSGS_ARCHIVE = "msgs_archive"; // MySQL message archive $TBL_MSGS_FOLDERS = "msgs_folders"; // MySQL message user folders $TBL_PENDING_EMAILS = "pending_emails"; // Emails scheduled to be sent by regular cron process $TBL_PENDING_PUSHES = "pending_pushes"; // Pusher notifications scheduled to be sent by regular cron process // MySQL Forum Tables $TBL_FORUMS = "bb_forums"; // MySQL forums table $TBL_ICONS = "bb_icons"; // MySQL bb icons table $TBL_POSTS = "bb_posts"; // MySQL posts table $TBL_POSTS_ARCHIVE = "bb_posts_archive"; // MySQL posts archive table $TBL_POSTS_CACHE = "bb_posts_cache"; // MySQL posts cache table $TBL_SMILES = "bb_smiles"; // MySQL smiles table $TBL_THREADS = "bb_threads"; // MySQL threads table $TBL_THREADS_ARCHIVE = "bb_threads_archive"; // MySQL threads archive table $TBL_THREADS_CACHE = "bb_threads_cache"; // MySQL threads cache table $TBL_THREADS_FAVES = "bb_threads_faves"; // MySQL thread favourites table $TBL_THREADS_SUBS = "bb_threads_subs"; // MySQL thread subscriptions table // MySQL Site Specific Tables $TBL_AUTOBOOT_REGISTER = "autoboot_register"; // MySQL auto boot register table $TBL_BOARDS = "boards"; // MySQL boards table $TBL_BOARD_TAGS = "board_tags"; // MySQL relationship between boards and tags $TBL_BORDERS = "borders"; // MySQL borders table $TBL_CARDS = "cards"; // MySQL cards table $TBL_COLUMNS = "columns"; // MySQL columns table - holds list of column names and their attributes $TBL_NOTES = "notes"; // MySQL player notes table $TBL_CONTINENTS = "continents"; // MySQL continents table $TBL_GAMELOG = "gamelog"; // MySQL gamelog table $TBL_GAMEMSGS = "gamemsgs"; // MySQL game messages table $TBL_GAMES = "games"; // MySQL games table $TBL_INVITES = "invitations"; // MySQL invitations to WarGear table $TBL_NEWS = "news"; // MySQL site news table $TBL_RANKINGS = "rankings"; // MySQL board rankings table $TBL_RANKING_HISTORY = "ranking_history"; // MySQL board ranking history table $TBL_REVIEWS = "reviews"; // MySQL board reviews table $TBL_RULES = "rules"; // MySQL rules table $TBL_TAGS = "tags"; // MySQL board tags $TBL_TERRITORIES = "territories"; // MySQL territories table $TBL_TOURNAMENTS = "tournaments"; // MySQL tournaments table $TBL_TOURNAMENTMSGS = "tournamentmsgs"; // MySQL tournament messages table $TBL_USERS_GAMES = "users_games"; // MySQL list of games per user - used to index games table without LIKE queries $TBL_WALL = "wall_posts"; // MySQL profile wall postings $TBL_USERS_INTERIM = "users_interim"; // MySQL interim ranks table - used to store interim ranking data to reduce stats recalc times $TBL_RANKINGS_INTERIM = "rankings_interim"; // MySQL interim ranks table - as above $TBL_COMPETITION_HISTORY = "comp_history"; // MySQL monthly competition history // Payment tables $TBL_PAYMENTS_PAYPAL = "payments_paypal"; // MySQL PayPal IPN log // General Global variables $CODEROOT = "$WWWROOT"; $DATAROOT = "$WWWROOT/data"; // import / export / storage data locations // site images file root - used for image src locations $IMAGEDIR = "$CODEROOT/images"; // site images file root - used for file_exists() calls $HTMLDIR = "$CODEROOT/sections"; // PHP sections $LOGDIR = "$CODEROOT/logs"; // log files $SHAREDDIR = "$CODEROOT/shared"; // shared PHP code $COMMONDIR = "$SHAREDDIR/common"; // common file for every page $RESOURCEDIR = "$SHAREDDIR/resources"; // resources file root $POPUPDIR = "$SHAREDDIR/popups"; // popup page root $TABSDIR = "$SHAREDDIR/tabs"; // tabs page root $FRAMEDIR = "$SHAREDDIR/frames"; // frame page root $SSIDIR = "$SHAREDDIR/code"; // PHP codebase $WIDGETDIR = "$SHAREDDIR/widgets"; // widgets (chunks of shared pages, e.g. msgbox) $JAVADIR = "/shared/javascript"; // javascript code root $FLASHDIR = "/flash"; // flash files $FONTDIR = "$CODEROOT/fonts"; // fonts used by GD calls $BACKUPDIR = "$WWWROOT/backup"; // used to store backed up XML data $GAMELOGDIR = "/mnt/volume_nyc3_01"; $SOUNDSDIR = "$CODEROOT/sounds"; // notification sounds $GEOIPDIR = "$CODEROOT/geoip"; // GeoIP files (http://dev.maxmind.com/geoip/geolite) $UPLOADDIR = "$CODEROOT/uploads"; // location where files are uploaded to $UPLOADSRC = "$URL/CODEROOT/uploads"; // referred location when linking to uploaded files $STYLESRC = "$URL/shared/style"; // some handy timestamp constants $MYTIME = time(); $AMTIME = mktime(0, 0, 0, date("m"), date("d"), date("y")); // this is the time at the start of the day $ONE_DAY = 86400; $ONE_WEEK = $ONE_DAY * 7; // list of log file names $LOG_ADMIN = "admin"; $LOG_AJAX = "ajax"; $LOG_AUTH = "authentication"; $LOG_BOT = "bots"; $LOG_CRON = "cron"; $LOG_DOWNLOAD = "download"; $LOG_ERROR = "error"; $LOG_GENERAL = "general"; $LOG_MODERATION = "moderation"; $LOG_PMS = "pms"; $LOG_REST = "rest"; $LOG_SECURITY = "security"; $LOG_STATS = "stats"; $LOG_WARNING = "warning"; $LOG_RANKINGS = "rankings"; // list of possible section names - used as a whitelist for parse_uri $SECTION_NAMES = array("admin", "boards", "charts", "chat", "forum", "frames", "games", "help", "home", "player", "players", "pm", "popups", "rankings", "settings", "tabs", "tournaments"); // Bitwise security operators $SECLEVELS = array( "System_Admin" => 1, "User_Manager" => 2, "Messaging_Admin" => 4, "Forum_Admin" => 8, "Game_Admin" => 16, "Board_Admin" => 32, "Display_Errors" => 64, "News_Admin" => 128, "Approved_Designer" => 256, "Board_Reviewer" => 512, "Help_Admin" => 1024, "Game_Moderator" => 2048, "Flash_Tester" => 4096, "Tournament_Admin" => 8192, "Bogus_Admin" => 16384, "Multi_Hunter" => 32768, "Site_Tester" => 65536 ); $ADMIN_LINK_LEVEL = $SECLEVELS['System_Admin'] + $SECLEVELS['User_Manager'] + $SECLEVELS['Messaging_Admin'] + $SECLEVELS['Forum_Admin'] + $SECLEVELS['Game_Admin'] + $SECLEVELS['Board_Admin'] + $SECLEVELS['News_Admin'] + $SECLEVELS['Help_Admin']; // Bitwise IP blocking operators $IP_BLOCKING = array( "not_blocked" => 0, // access not blocked "registration_blocked" => 1, // registration blocked - sends duff password "login_blocked" => 2, // login blocked - read only access to site "access_blocked" => 4 // site is completely blocked - no browsing at all ); // Bitwise filter settings $FILTER_SETTINGS = array( "Threads" => 1, // filter threads "Post Headers" => 2, // message headers and posts "Post Contents" => 4, // message contents "Private Messages" => 8 // pms ); // Bitwise subscription settings $SUBSCRIPTION_SETTINGS = array( "Instant notification by email" => 1, "Daily updates by email" => 2, "Weekly updates by email" => 4 ); // Bitwise Thread settings $THREAD_SETTINGS = array( "Show Chart" => 1 ); // Bitwise Thread status options $THREAD_STATUS = array( "Thread Closed" => 1, "Thread Locked" => 2, "Thread Sticky" => 4 ); // Bitwise thread user settings $THREAD_USER_SETTINGS = array( "Show Header" => 1, "Hide Header" => 2, "Show Chart" => 4, "Hide Chart" => 8 ); // Bitwise game flags $GAME_FLAGS = array( "dev_mode_on" => 1, "review_mode_on" => 2, "beta_mode_on" => 4, "tournament_mode_on" => 8, "replay_mode_on" => 16 ); // Bitwise board flags $BOARD_FLAGS = array( "beta_enabled" => 1 ); $SUBMENU['forum'] = array( "/forum/startsearch" => "Search" ); $SUBMENU['pm'] = array( "/pm/pmhome" => "Inbox", "/pm/pmsend" => "New Message", "/pm/folders" => "Folders", ); $SUBMENU['user'] = array( "/settings/enemies" => "Filter" ); /* Boot intervals 12 hours = 43200 1 day = 86400 2 days = 172800 5 days = 432000 */ $BOOT_INTERVALS = array( 86400 => "Daily", 172800 => "Quick", 259200 => "Regular", 604800 => "Extended" ); /* $DELAY_LIMITS = array( 60 => "1 minute", 120 => "2 minutes", 180 => "3 minutes", 240 => "4 minutes", 300 => "5 minutes" ); */ // Standard user defaults $STANDARD_DEFAULTS = array( "active_game_limit" => 10, // maximum number of active games allowed "active_tournament_limit" => 10, // maximum number of active tournaments allowed "board_filesize_max" => 16777216, // maximum board image size (also set in Flex) "board_neutralsize_max" => 10240, // maximum neutral image size "board_max_name_chars" => 30, // max number of chars in board name "boards_per_page" => 40, // boards to show per page "boards_per_page_max" => 100, // boards to show per page "boot_expiry" => 30, // default boot expiry in days "boot_interval_default" => 259200, // default boot interval "boot_interval_realtime" => 600, // boot interval for realtime games in seconds "card_filesize_max" => 262144, // maximum board image size (also set in Flex) "charlimit_username" => 20, // maximum length of username in chars. DON'T SET THIS TO >= 32 or it will break function get_user() "comment_char_limit" => 1000000, // maximum characters allowable per comment "comments_per_page" => 10, // default number of forum messages per page "file_upload_limit" => 300, // max size of file uploads in kB "forum_cache" => 7, // number of days in forum cache "forum_days_to_show" => 'all', // number of days of forums to show "forum_post_edit_timeout" => 1800, // number of seconds for which you are allowed to edit a post "forum_post_char_limit" => 5000000, // maximum characters allowable per post "forum_post_spam_limit" => 1, // minimum number of seconds allowed between posts to forum (stops spamming) "forum_posts_per_page" => 20, // forum posts to show per page "forum_signature_length" => 500, // number of characters allowed in forum signature "forum_thread_edit_timeout" => 600, // number of seconds for which you are allowed to edit a thread subject / section / code "forum_thread_spam_limit" => 30, // minimum number of seconds allowed between creating new threads in forum (stops spamming) "forum_thread_subject_limit" => 70, // max length of a thread subject "forum_thread_subscribe_limit" => 10, // limit on number of threads you can subscribe to "forum_thread_tag_limit" => 255, // max length of list of thread tags "forum_threads_per_page" => 30, // forum threads to show per page "forum_title_length" => 19, // number of characters allowed in forum title "forum_topic_review_posts" => 10, // forum threads to show per page "game_max_name_chars" => 30, // max number of chars in game name "game_max_players" => 16, // max number of players per game "game_max_teams" => 8, // max number of teams available "game_msg_edit_timeout" => 300, // time limit after which game messages can't be edited "gamelog_entries_per_page" => 100, // game log entries to show per page "games_per_page" => 15, // games to show per page "games_per_page_max" => 100, // max games to show per page "open_game_limit" => 50, // max number of open games allowed per player "open_public_game_timeout_days" => 7, // timeout in days after which open games are deleted "open_private_game_timeout_days" => 30, // timeout in days after which open games are deleted "open_public_game_nojoin_timeout_days" => 2, // timeout in days after which open games are deleted "players_per_page" => 30, // players per page on user and ranking lists "pm_folder_limit" => 10, // limit on number of PM folders "pm_inbox_limit" => 50, // limit on number of messages which you may have in your inbox "pm_max_recipients" => 20, // limit number of people who users can send a message to at once "playerbar_online_status" => 'on', // show or hide online status bars above playerbar "pms_per_page" => 30, // private messages to show per page "profile_image_size" => 2048000, // maximum size of profile image in bytes "profile_comment_size" => 50000, // maximum size of profile comment in bytes "profile_comments_per_page" => 20, // number of wall posts per page "profile_text_size" => 50000, // maximum size of profile text in bytes "ranking_minimum_games" => 10, // default minimum games that must be played for players to appear in rankings table "ranking_score" => 1000, // default ranking score "search_results_limit" => 5, // number of results retrieved from database when doing a search "search_results_per_page" => 30, // number of search results per page "search_spam_limit" => 1, // number of seconds for which you are allowed to submit a forum search "search_timeout" => 60, // number of seconds after which the search results page times out "ticker_max_displayed" => 200, // max number of ticker updates displayed "ticker_max_stored" => 1000, // max number of ticker updates stored "team_max_name_chars" => 30, // max number of chars in team name "tournament_max_robin_size" => 20, // max number of players or teams in a round robin tournament "tournament_min_robin_size" => 4, // min number of players or teams in a round robin tournament "tournament_max_swiss_size" => 256, // max number of players or teams in a swiss tournament "tournament_min_swiss_size" => 8, // min number of players or teams in a swiss tournament "tournament_max_elim_size" => 256, // max number of players or teams in an elimination tournament "tournament_max_name_chars" => 50, // max number of chars in tournament name "tournament_max_total_size" => 256, // max number of players total in a tournament "tournament_max_open" => 2, // max number of open tournaments allowed per player "users_enemy_limit" => 0, // max number of enemies allowed "users_friend_limit" => 100, // max number of friends allowed "users_per_page" => 50 // number of users to list per page in memberlist ); // Premium user defaults - override the standard user settings above $PREMIUM_DEFAULTS = array( "active_game_limit" => 1000, // maximum board image size (also set in Flex) "active_tournament_limit" => 100, // maximum number of active tournaments allowed "pm_folder_limit" => 30, // limit on number of PM folders "pm_inbox_limit" => 1000, // limit on number of messages which you may have in your inbox "users_enemy_limit" => 50, // max number of filtered users allowed "users_friend_limit" => 1000, // max number of favourite users allowed "vacation_day_limit" => 30 // max number of days vacation allowed annually ); $DEFAULTS = $STANDARD_DEFAULTS; $FREE_PREMIUM_DAYS = 30; // number of days free premium account after joining $MAX_BETA_DAYS = 30; // number of days during which boards are allowed to remain in Beta status // Default views $VIEWS = array( "boardview_reviews_per_page" => 20, "boardlist_review_sortfield" => 'createstamp', "boardlist_review_sortorder" => 'asc', "designlist_select_options" => array("All", "Live", "Beta", "Dev"), "designlist_boards_per_page" => 50, "designlist_all_sortfield" => "$TBL_BOARDS.createstamp", "designlist_all_sortorder" => 'asc', "gamelist_select_options_my" => array("All", "Live", "Live not Eliminated", "Finished", "Flagged", "Games I Won", "My Turn", "Terminated"), "gamelist_select_options_open" => array("All", "Simultaneous", "Turn Based"), "gamelist_select_options_player" => array("All", "Live", "Finished"), "gamelist_select_options_host" => array("All", "Live", "Finished"), "gamelist_select_options_board" => array("All", "Live", "Open", "Finished"), "gamelist_select_options_watch" => array("All", "Live", "Finished"), "gamelist_select_options_head2head" => array("All", "Live", "Finished"), "gamelist_select_options_review" => array("All", "Open", "Live", "Finished"), "gamelist_select_options_all" => array("All", "Live", "Live not Eliminated", "Finished", "Games I Won", "My Turn"), "gamelist_games_per_page" => 15, "home_invite_games_per_page" => 15, "home_myturn_games_per_page" => 15, "home_open_games_per_page" => 15, "home_open_tournaments_per_page" => 15, "gamelist_all_viewselector" => 'All', "gamelist_all_sortfield" => "$TBL_GAMES.startstamp", "gamelist_all_sortorder" => 'desc', "gamelist_all_showdays" => 'all', "tournamentlist_my_sortfield" => "tournaments.createstamp", "tournamentlist_my_sortorder" => "DESC", "tournamentlist_open_sortfield" => "tournaments.createstamp", "tournamentlist_open_sortorder" => "DESC", "tournamentlist_tournaments_per_page_select_options_my" => array("All", "Open", "Live", "Live not Eliminated", "Finished", "Cancelled"), "tournamentlist_tournaments_per_page" => 15 ); // Filter these columns from view in specified views $VIEWFILTERS = array( "All" => array("Finished", "UnFlag"), "Live" => array("Finished", "UnFlag"), "Live not Eliminated" => array("Finished", "UnFlag"), "Flagged" => array("Finished"), "Finished" => array("Turn Timer", "Current Turn", "UnFlag"), "Games I Won" => array("Finished", "UnFlag"), "My Turn" => array("Finished", "UnFlag"), "My Turn Only" => array("Finished", "UnFlag"), "Bogus" => array("Finished", "UnFlag") ); // Standard date format strings $DFORMATS = array( "date" => "l jS M", // Wednesday 5th Jan "date_long" => "l jS F", // Wednesday 5th January "date_short" => "D jS M", // Wed 5th Jan "date_and_time" => "l jS M H:i", // Wednesday 5th Jan 21:12 "date_and_time_short" => "D jS M H:i", // Wed 5th Jan 21:12 "date_and_time_year" => "j M Y", // 5 Jan 2007 "export" => "Y-m-d" // 2005-11-28 ); // Session / cookie timing variables $EXPIRE_SECS = 2678400; // cookie expiry time in seconds for users (31 days) $EXPIRE_SECS_GUEST = 86400; // session expiry time in seconds for guests (24 hours) $ACTIVE_SECS = 120; // time during which user session is considered 'active' (i.e. currently logged in and using the site) $SERVER_PLATFORM = (stristr($_SERVER["SERVER_SOFTWARE"], "WIN32")) ? "Windows" : "Unix"; // input textarea defaults $MSGBOX_DEFAULTS = array ( "Rows" => 20, "Columns" => 80 ); $FORUM_MODERATORS = array("tom"); // swear words and their replacements $SWEAR_WORDS = array('asshole' => '[censored]', 'cunt' => '[censored]', 'fuck' => '[censored]', 'piss' => '[censored]', 'shit' => '[censored]'); // error codes used by calls to raise_error $ERR_FATAL = 1; $ERR_INFO = 2; // used for select boxes throughout $ACCOUNT_STATUS_OPTIONS = array('Inactive', 'Active', 'Disabled'); $ACCOUNT_TYPE_OPTIONS = array('Standard', 'Premium'); // site email addresses $EMAIL_ROOT = "wargear.net"; $EMAIL_PAYMENTS = "payments@wargear.net"; // Site name $SITE_NAME = "WarGear.net"; // how people found the site $REGISTRATION_SOURCES = array("Article on Web", "Bing", "DigitalTrends.com", "Existing Player", "Facebook", "Google", "Linked from another site", "PlayOnlineRisk.com", "PlayRiskOnlineReviews.com", "Reddit", "Warfish", "Wikipedia", "Other... (please tell us!)"); $THUMBS = array( "forum_thumb_width" => 150, "gamejoin_max_height" => 200, "gamejoin_max_width" => 200, "gamelist_max_height" => 50, "gamelist_max_width" => 50, "boardlist_max_height" => 100, "boardlist_max_width" => 130, "home_max_width" => 500, "profile_max_height" => 170, "profile_max_width" => 170, "profile_mini_max_width" => 50, "profile_mini_max_height" => 50, "trophy_side" => 50 ); $PLAYER_PROFILE_ITEMS = array( "Player Profile" => "profile", "Player Stats" => "stats", "Opponents" => "opponents", "Board Designs" => "designs", "Board Rankings" => "rankings", "Board Ratings" => "ratings", "Ranking History" => "history", "Games List" => "games" ); $BOARD_ITEMS = array( "About" => "about", "Board Explorer" => "board", /* "Starting Scenario" => "scenario", "Cards" => "cards", "Rules" => "rules", */ "Rankings" => "rankings", "Ranking History" => "history", "Ratings" => "ratings", "Charts" => "charts", "Games List" => "games" ); // mapping between ranking score threshold and championship points $RANK_POINTS = array(20, 15, 12, 10, 8, 6, 4, 3, 2, 1, 0); $RANK_THRESHOLDS = array(1500, 1450, 1400, 1350, 1300, 1250, 1200, 1150, 1100, 1050); // valid payment values ($10 => 3 months for example) $SUBSCRIPTION_COSTS = array(10 => 3, 30 => 12, 99 => 60); // player class used across multiple pages class Player { // inputs var $id; // can be either a uid or an email address var $color_name; var $color_code; var $text_code; var $seat; var $status; // Invited / Joined / Playing / Booted / Eliminated var $team; // status data var $cards; // array of cards this player owns var $card_earned; // set to 1 if player has earned a card (by successfully capturing a territory) var $num_reserves; // number of units in reserve var $num_attacks; // number of attacks remaining var $num_fortifies; // number of fortifies remaining var $phase; // current player phase (Place / Attack / Transfer / Fortify / End Turn) var $allowed_phases; // which phases this user can access (as above) var $fromid; // used for transfer phase to define from territory var $toid; // used for transfer phase to define to territory // constructor function function Player($id, $color_name, $color_code, $text_code, $seat, $status, $team) { $this->id = safe_escape_string($id); $this->color_name = $color_name; $this->color_code = $color_code; $this->text_code = $text_code; $this->seat = $seat; $this->status = $status; $this->team = $team; } } $VALID_IMAGE_FILETYPES = array("image/png", "image/x-png", "image/jpeg", "image/pjpeg", "image/gif"); $BOARD_STATUSES = array("Live", "Submitted", "Dev", "Retired"); // $HELP_SECTIONS = array("The Basics", "Tournaments", "Designing Boards", "About WarGear"); $HELP_SECTIONS = array("The Basics", "Tournaments", "Designing Boards", "About WarGear"); // minimum number of games played before you appear on the rankings table // $RANKING_GAME_MINIMUM = 10; $MIN_REVIEW_VOTES = 10; $RATING_NAMES = array("Abysmal", "Terrible", "Bad", "Poor", "Fair", "Average", "Good", "Great", "Superb", "Perfect"); // Growl class definition (used to show popup messages to player) class Growl { public $header; public $message; public $rails; // if rails is set then the user has to close the message otherwise it stays visible permanently public $sticky; // sticky messages have to be closed manually instead of timing out } // Bitwise board scenario locking flags $SCENARIO_FLAGS = array( "Territories" => 1, "Borders" => 2, "Continents" => 4, "Scenario" => 8, "Rules" => 16, "Cards" => 32, "Colors" => 64, "Images" => 128 ); // Pusher.com - codes $pusher_app_id = '17283'; $pusher_key = '544d19737114405893bf'; $pusher_secret = '4a87503525a2ac1c409e'; $pubnub_publish_key = 'pub-c-1b7fefc8-39bb-472c-afa6-c07ce40c5179'; $pubnub_subscribe_key = 'sub-c-c258e448-8df2-11ea-927a-2efbc014b69f'; // Ticker class definition class Ticker { public $type; public $gameid; public $gamename; public $boardname; public $boardid; public $image_extension; public $visibility; public $uid1; public $uid2; public $players; public $points; public $team; public $message_type; public $message; public $tournamentid; // constructor function function Ticker($type, $gameid, $gamename, $boardname, $visibility) { $this->type = $type; $this->gameid = $gameid; $this->gamename = $gamename; $this->boardname = $boardname; $this->visibility = $visibility; } } // START achievement variable defs $RANK_NAMES = array( "5 Star General" => "Top Ranked Player", "General" => "Player Ranked 2-5", "Lieutenant General" => "Player Ranked 6-10", "Major General" => "Player Ranked 11-25", "Brigadier General" => "Player Ranked 26-50", "Colonel" => "Player Ranked 51-100", "Major" => "Player Ranked 101-150", "Captain" => "Player Ranked 151-200", "Lieutenant" => "Player Ranked 201-300", "Sergeant" => "Player Ranked 301-500", "Private" => "Player Ranked 501-1000", ); $PLAYED_ACHIEVEMENT_NAMES = array( "Novice" => "Play One Public Game", "Battle Hardened" => "Play 10 Public Games", "Experienced" => "Play 50 Public Games", "Fighter" => "Play 100 Public Games", "Ranger" => "Play 500 Public Games", "Marine" => "Play 1000 Public Games", "Combateer" => "Play 2000 Public Games", "Combat Veteran" => "Play 3000 Public Games", "Special Forces" => "Play 5000 Public Games" ); $WON_ACHIEVEMENT_NAMES = array( "Harmless" => "Win One Public Game", "Mostly Harmless" => "Win 10 Public Games", "Average" => "Win 50 Public Games", "Above Average" => "Win 100 Public Games", "Competent" => "Win 500 Public Games", "Dangerous" => "Win 1000 Public Games", "Deadly" => "Win 2000 Public Games", "Elite" => "Win 3000 Public Games", "Supreme" => "Win 5000 Public Games" ); $PLAYED_TEAM_ACHIEVEMENT_NAMES = array( "Team Player" => "Play One Public Team Game", "Team Expert" => "Play 10 Public Team Games", "Team Specialist" => "Play 100 Public Team Games", "Team Extreme" => "Play 500 Public Team Games" ); $WON_TEAM_ACHIEVEMENT_NAMES = array( "Combat Buddy" => "Win One Public Team Game", "Got Your Back" => "Win 10 Public Team Games", "Wingman" => "Win 100 Public Team Games", "Wing Commander" => "Win 500 Public Team Games" ); $DESIGNER_ACHIEVEMENT_NAMES = array( "Tinkerer" => "Created a board", "Designer" => "Release one board", "Builder" => "Release 10 boards", "Master Designer" => "Release 25 boards" ); $FORUM_ACHIEVEMENT_NAMES = array( "Poster" => "Post one comment on the discussion board", "Contributor" => "Post 10 comments on the discussion board", "Socialite" => "Post 100 comments on the discussion board", "Wordsmith" => "Post 1000 comments on the discussion board" ); $BOARD_ACHIEVEMENT_NAMES = array( "Traveller" => "Play games on 10 different boards", "Adventurer" => "Play games on 25 different boards", "Explorer" => "Play games on 50 different boards" ); $ACCOUNT_ACHIEVEMENT_NAMES = array( "Veteran" => "Had an account for > 1 year", "Old Timer" => "Had an account for > 2 years", "Elder" => "Had an account for > 3 years", "Founder" => "First 1000 player numbers" ); $FRIEND_ACHIEVEMENT_NAMES = array( "Friendly" => "Friended by a Player", "Buddied Up" => "Friended by 10 Players", "Friend of the People" => "Friended by 25 Players", "Everybodys BFF" => "Friended by 50 Players" ); $ENEMY_ACHIEVEMENT_NAMES = array( "Not Feeling the Love" => "Enemy of a Player", "Antagonistic" => "Enemy of 10 Players", "Nemesis" => "Enemy of 25 Players", "Public Enemy" => "Enemy of 50 Players" ); $ELIMINATION_STREAK_ACHIEVEMENT_NAMES = array( "Killing Spree" => "Eliminate 5 players in succession", "Rampage" => "Eliminate 10 players in succession", "Dominating" => "Eliminate 15 players in succession", "Unstoppable" => "Eliminate 20 players in succession", "GODLIKE" => "Eliminate 25 players in succession" ); $WIN_STREAK_ACHIEVEMENT_NAMES = array( "Double Winstreak" => "Win 2 games in succession", "Multi Winstreak" => "Win 5 games in succession", "Mega Winstreak" => "Win 10 games in succession", "Ultra Winstreak" => "Win 15 games in succession", "Monster Winstreak" => "Win 20 games in succession", "Ludicrous Winstreak" => "Win 50 games in succession" ); $PLAYED_FOG_ACHIEVEMENT_NAMES = array( "The Fog" => "Played a game on a Foggy Map", "Fogged Up" => "Played a game on every Fog Type" ); $WON_FOG_ACHIEVEMENT_NAMES = array( "Detective" => "Won a game on a Foggy Map", "Lighthouse Keeper" => "Won a game on every Fog Type" ); $DISTINCT_ACHIEVEMENT_NAMES = array( "Tournament Knight" => "Joined Tournament", "Tournament Champion" => "Won Tournament", "Tournament Team Champion" => "Won Team Tournament", "Rater" => "Rate a board", "Critic" => "Rate 10 boards", "Toe Dipper" => "Trialled Premium Membership", "Investor" => "Become a Premium Member", "ICU" => "Upload profile picture", "Quick Thinker" => "Played a Realtime game", "Fischer Price" => "Played a Fischer Clock game", "In The Points" => "Scored a Championship Point" ); $ACHIEVEMENT_NAMES = array_merge($PLAYED_ACHIEVEMENT_NAMES, $WON_ACHIEVEMENT_NAMES, $PLAYED_TEAM_ACHIEVEMENT_NAMES, $WON_TEAM_ACHIEVEMENT_NAMES, $DESIGNER_ACHIEVEMENT_NAMES, $FORUM_ACHIEVEMENT_NAMES, $BOARD_ACHIEVEMENT_NAMES, $ACCOUNT_ACHIEVEMENT_NAMES, $FRIEND_ACHIEVEMENT_NAMES, $ENEMY_ACHIEVEMENT_NAMES, $ELIMINATION_STREAK_ACHIEVEMENT_NAMES, $WIN_STREAK_ACHIEVEMENT_NAMES, $PLAYED_FOG_ACHIEVEMENT_NAMES, $WON_FOG_ACHIEVEMENT_NAMES, $DISTINCT_ACHIEVEMENT_NAMES); $RANK_NAME_INDEX = array("Championship Points", "Global Ranking Score", "Teamplay", "Tournament", "Tournament Teamplay", "Overall Rank"); // END achievement variable defs $DEFAULT_CARD = array( "name_on_card" => "", "stripeToken" => "", "card_type" => "", "card_last_digits" => "", "card_exp_month" => "", "card_exp_year" => "" ); $STRIPE_API_LIVE_KEY_UK = "sk_live_6GxyiaN5RIrIM98x5aN3MTvC"; $STRIPE_API_LIVE_PUB_UK = "pk_live_orvGrZ8pQWqNoodmR8Fih2wf"; $STRIPE_API_TEST_KEY_UK = "sk_test_lazu94pMdxIjNCwEbHvcv1vc"; $STRIPE_API_TEST_PUB_UK = "pk_test_Kg1HwoGocSySbcHLCyhkndZE"; $STRIPE_PLANID_LIVE_UK = "price_1JqcYfHzm9SwTyfxiMAUcZA7"; $STRIPE_PLANID_TEST_UK = "price_1JqcZbHzm9SwTyfx4Q0OA2FD"; ?>