Skip to content

Commit

Permalink
Version 0.3.0-beta.1: includes numerous user interface updates and mi…
Browse files Browse the repository at this point in the history
…nor gameplay fixes for public beta
  • Loading branch information
monicanagent committed Dec 13, 2018
1 parent a7d3110 commit 82baa50
Show file tree
Hide file tree
Showing 241 changed files with 7,325 additions and 82,235 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The [CypherPoker.JS wiki](https://github.com/monicanagent/cypherpoker.js/wiki) i

The latest code documentation can be found here:

Browser (client): [https://monicanagent.github.io/cypherpoker.js/web/0.2.3/](https://monicanagent.github.io/cypherpoker.js/web/0.2.3/)<br/>
Node.js (server): [https://monicanagent.github.io/cypherpoker.js/server/0.2.3/](https://monicanagent.github.io/cypherpoker.js/server/0.2.3/)
Browser (client): [https://monicanagent.github.io/cypherpoker.js/web/0.3.0/](https://monicanagent.github.io/cypherpoker.js/web/0.3.0/)<br/>
Node.js (server): [https://monicanagent.github.io/cypherpoker.js/server/0.3.0/](https://monicanagent.github.io/cypherpoker.js/server/0.3.0/)
***
CypherPoker.JS uses [semantic versioning](https://semver.org/).
88 changes: 14 additions & 74 deletions docs/demo/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,95 +26,35 @@

<body>

<!--
Main / default dialog element controlled by the CypherPokerUI instance.
-->
<dialog id="mainDialog" class="dialog" open="true">
<p>Connecting to peer-to-peer network...</p>
</dialog>

<!--
CypherPoker.JS logo.
-->
<div class="logo"><span id="cypherpoker"><span id="text">CypherPoker</span></span><span id="JS"><span id="text">.JS</span></span></div>

<!--
Main account(s) management element.
Main / default dialog element.
-->
<div id="accounts" class="accountsContainer">
<div id="loginForm" class="loginFormContainer">
<select id="currentAccounts" class="currentAccountsList">
</select><button id="copyToClipboardButton" class="copyToClipboardButton">📋</button><br/>
Password: <input type="password" id="accountPassword" name="accountPassword" placeholder="Account password" /><br/>
<button id="useAccountButton" class="useAccountButton">USE ACCOUNT</button>
<button id="createAccountButton" class="createAccountButton">CREATE NEW ACCOUNT</button><br/>
</div>
<div id="manageForm" class="manageFormContainer">
Balance: <span id="accountBalance" class="accountBalanceContainer"></span>
<br/><button id="cashoutButton" class="cashoutButton">Cash out:</button>&nbsp;&nbsp;<input type="number" id="cashoutAmount" name="cashoutAmount" placeholder="Amount" /> to <input type="text" id="cashoutAddress" name="cashoutAddress" placeholder="Address" />
<br/><button id="transferButton" class="transferButton">Transfer:</button>&nbsp;&nbsp;<input type="number" id="transferAmount" name="transferAmount" placeholder="Amount" /> to <input type="text" id="transferAccount" name="transferAccount" placeholder="Account" />
</div>
<div id="createAccountForm" name="createAccountForm" class="createAccountFormContainer" hidden="true">
<input type="password" id="newAccountPassword" name="newAccountPassword" placeholder="New account password" /><br/>
<select id="newAccountType" class="newAccountList">
<option value="bitcoin/main">Bitcoin</option>
<option value="bitcoin/test3">Test Bitcoin</option>
</select><br/>
<button id="newAccountButton" class="accountButton">CREATE ACCOUNT</button>
</div>
</div>
<dialog id="mainDialog" class="dialog" open="true">
<!-- Generic dialog message container -->
<div id="message"><p>Loading game components...</p></div>
</dialog>

<!--
Main lobby element controlled by the CypherPokerUI instance.
Main account management element.
-->
<div id="lobby" class="lobbyContainer" hidden="true">

Create Table:
<div id="createGameForm" name="createGameForm" class="createGameFormContainer">
<input type="text" id="playerAlias" name="playerAlias" placeholder="Player alias for table" /><br/>
<input type="text" id="tableName" name="tableName" placeholder="Table name" /><br/>
<input type="number" id="numPlayers" name="numPlayers" placeholder="Number of players" step="1" min="2" /><br/>
<!-- use text fields instead of numbers in order to support cryptocurrency (large) values -->
<input type="text" id="buyInAmount" name="buyInAmount" placeholder="Buy-in amount" step="100" min="2" /><br/>
<input type="text" id="bigBlindAmount" name="bigBlindAmount" placeholder="Big blind amount" step="100" min="2" /><br/>
<input type="text" id="smallBlindAmount" name="smallBlindAmount" placeholder="Small blind amount" step="100" min="1" /><br/>
<!-- input type="text" id="inactivityTimeoutAmount" name="inactivityTimeoutAmount" placeholder="Inactivity timeout (seconds)" step="1" min="1" value="30"/><br/ -->
<br/>
<button id="createGameButton" class="lobbyButton">CREATE TABLE</button>
</div>
<br/>
<div id="accounts" class="accountsContainer"></div>

Join Table:
<div id="tableList" name="tableList" class="tableListContainer">
<!-- New table buttons are created here by the CypherPokerUI.onNewTableAnnouncement function -->
</div>
</div>
<!--
Main lobby element.
-->
<div id="lobby" class="lobbyContainer"></div>

<!--
Prototype game element cloned for each new game. A reference to this parent element is passed
to the CypherPokerUI constructor. It should start and remain hidden / invisible unless you're editing
the base design.
Game(s) container element.
-->
<div id="game" class="gameContainer" hidden="true">
<div id="publicCards" class="publicCardsContainer"></div>
<div id="privateCards" class="privateCardsContainer"></div>
<span id="totalBetLabel" class="gameLabel">Total bet for this hand: </span><span id="totalBet" name="totalBet" class="gameAmount">0</span><br/>
<span id="potLabel" class="gameLabel">Pot: </span><span id="potAmount" name="potAmount" class="gameAmount">0</span><br/>
<span id="timeoutLabel" class="timeoutLabel">⏱&nbsp;</span><span id="timeoutAmount" name="timeoutAmount" class="gameAmount"><span id="timeout">0</span></span><br/>
<br/>
<input type="number" id="betAmount" name="betAmount" class="betAmountInput" placeholder="Bet Amount" step="1" />
<button id="betButton" class="gameButton" disabled="true">BET</button>
<button id="foldButton" class="gameButton" disabled="true">FOLD</button>
<button id="newHandButton" class="newHandButton" disabled="true">NEW HAND</button>
<!--
Hand history element.
-->
<div id="handHistory" name="handHistory" class="handHistoryContainer">
<span class="header">Hand History</span>
</div>
</div>
<div id="games" class="gamesContainer"></div>

<!-- Proxy data container for global copy-to-clipboard commands. This element should almost always remain off-screen (but not hidden!). -->
<input id="clipboardData" name="clipboardData" type="text" style="width:1px;height:1px;position:absolute;left:-9999px;top:-9999px;opacity:0;" value=""></input>
<input id="clipboardData" name="clipboardData" type="text" style="width:1px;height:1px;position:absolute;left:-9999px;top:-9999px;opacity:0;" value="" />
</body>
</html>
40 changes: 20 additions & 20 deletions docs/demo/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CypherPoker.JS_client",
"version": "0.2.0",
"version": "0.3.0",
"description": "CypherPoker.JS client API interface.",
"engines": {
"node": ">=8.0.0"
Expand All @@ -20,28 +20,28 @@
"start": "node_modules/.bin/http-server -c-1"
},
"keywords": [
"CypherPoker",
"poker",
"client",
"crypto",
"cryptosystem",
"SRA",
"game",
"p2p",
"peer-to-peer",
"websocket",
"session",
"sessions",
"wss",
"json-rpc",
"jsonrpc",
"2.0",
"http",
"ws"
"CypherPoker",
"poker",
"client",
"crypto",
"cryptosystem",
"SRA",
"game",
"p2p",
"peer-to-peer",
"websocket",
"session",
"sessions",
"wss",
"json-rpc",
"jsonrpc",
"2.0",
"http",
"ws"
],
"author": {
"name": "Patrick Bay (Monican Agent)",
"url" : "https://github.com/monicanagent"
"url": "https://github.com/monicanagent"
},
"license": "MIT",
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions docs/demo/web/scripts/CypherPoker.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* manages accounts and tables, launches games, and provides accesss to other shared
* functionality.
*
* @version 0.2.2
* @version 0.3.0
* @author Patrick Bay
* @copyright MIT License
*/
Expand Down Expand Up @@ -222,7 +222,7 @@ class CypherPoker extends EventDispatcher {
* @property {Object} p2p Reference to a peer-to-peer networking interface
* supporting the property <code>privateID</code> and functions <code>connect(serverURL)</code>,
* <code>broadcast(message)</code>, and <code>direct(message, [recipient,recipient...])</code>.
* For example, {@link WSS.js}
* For example, {@link WSS}
* @readonly
*/
get p2p() {
Expand Down Expand Up @@ -490,7 +490,7 @@ class CypherPoker extends EventDispatcher {
}
newTableObj.tableInfo = tableInfo;
newTableObj.toString = function () {
return ("[object CypherPoker#TableObject]");
return ("[object TableObject]");
}
this._joinedTables.push(newTableObj);
this._openTables = true;
Expand Down
11 changes: 2 additions & 9 deletions docs/demo/web/scripts/CypherPokerAccount.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @file Contains information and functionality associated with a single managed account.
*
* @version 0.2.0
* @version 0.2.3
* @author Patrick Bay
* @copyright MIT License
*/
Expand Down Expand Up @@ -91,13 +91,6 @@ class CypherPokerAccount extends EventDispatcher {
return (this._network);
}

get network() {
if (this._network == undefined) {
this._network = null;
}
return (this._network);
}

/**
* @property {BigInteger} balance="0" The current total account balance. Note that
* this is different than the {@link CypherPokerPlayer#balance} property
Expand Down Expand Up @@ -200,7 +193,7 @@ class CypherPokerAccount extends EventDispatcher {
this.balance = 0;
throw(new Error(JSONObj.error.message));
}
//balance confirmed? JSONObj.result.confirmed
//balance confirmed = JSONObj.result.confirmed
this.balance = JSONObj.result.balance;
return (true);
}
Expand Down

0 comments on commit 82baa50

Please sign in to comment.