Skip to content
This repository has been archived by the owner on Jan 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #40 from DaoCasino/h_develop
Browse files Browse the repository at this point in the history
H develop
  • Loading branch information
alexstep committed Dec 4, 2017
2 parents 9dc6d4b + ac44471 commit 675bb2e
Show file tree
Hide file tree
Showing 15 changed files with 287 additions and 166 deletions.
1 change: 1 addition & 0 deletions DApps/FindTheEthereum
Submodule FindTheEthereum added at a944ed
2 changes: 1 addition & 1 deletion DApps/dicedapp_v2/dapp_logic.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ DCLib.defineDAppLogic('dicedapp_v2', function(){

var Roll = function(user_bet, user_num, random_hash){
// convert 1BET to 100000000
user_bet = DCLib.Utils.bet4dec(user_bet)
user_bet = DCLib.Utils.bet2dec(user_bet)

// generate random number
const random_num = DCLib.numFromHash(random_hash, 0, 65536)
Expand Down
13 changes: 7 additions & 6 deletions DApps/dicedapp_v2/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Create our DApp
DCLib.on('ready', function(){
window.MyDApp = new DCLib.DApp({code :'dicedapp_v2'})
window.MyDApp = new DCLib.DApp({code : 'dicedapp_v2'})
})


Expand All @@ -43,15 +43,16 @@

function startGame(deposit){
MyDApp.connect({
bankroller : 'auto',
paychannel : { deposit : deposit }
bankroller : '0x146c5e3b9395738eb67feceb5e37cd5a56d63342',
paychannel : { deposit : deposit } ,
gamedata : {type:'uint', value: [0, 0, 0]}
},
function(connected, info){
console.log('connect result:', connected)
console.log('connect info:', info)
if (!connected) return

let maxbet = DCLib.Utils.bet2dec( info.channel.player_deposit )
let maxbet = DCLib.Utils.dec2bet( info.channel.player_deposit )

$('#user_bet')[0].max = Math.ceil( maxbet )
$('#user_bet').val( (maxbet*0.1).toFixed(2) )
Expand Down Expand Up @@ -198,7 +199,7 @@ <h3>1. Open game-channel</h3>
<form>
<label>
Set game deposit:
<input id="user_deposit" type="number" value="1.1" min="0" max="4" step="0.1">
<input id="user_deposit" type="number" value="1.1" min="0" max="4" step="0.001">
</label>
<input type="submit" value="Set">
</form>
Expand All @@ -212,7 +213,7 @@ <h3>1. Open game-channel</h3>
<h3>2. Play</h3>
<label>
your bet:
<input id="user_bet" type="number" value="1" min="0" max="4" step="0.1">
<input id="user_bet" type="number" value="1" min="0" max="4" step="0.001">
</label>
<label>
your num:
Expand Down
2 changes: 1 addition & 1 deletion DApps/dicedapp_v2/lib/DC.js

Large diffs are not rendered by default.

Binary file modified DApps/example.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "BankRollerApp",
"version": "0.2.3",
"version": "0.2.5",
"description": "Dao.Casino app for bankroller",
"author": "Dao Casino <team@dao.casino>",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/systemjs/0.20.19/system-production.js" type="text/javascript"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<noscript>You need to enable JavaScript to run this app</noscript>

<app></app>

Expand Down
2 changes: 1 addition & 1 deletion public/server.electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const filetypes = {
*/

// Find DApps folder for current ENV
let dapps_path = __dirname+_config.dapps_path
let dapps_path = __dirname + _config.dapps_path
if (typeof app != 'undefined') {
dapps_path = (app.getPath('userData') + _config.dapps_path).split('//').join('/')

Expand Down
Loading

0 comments on commit 675bb2e

Please sign in to comment.