[V0.0.3] - SteemCasino - Coinflip is now fully functional!

in #utopian-io7 years ago (edited)

Hi! We're back with another update to the SteemCasino! This update brings new features and a security problem fix. Let's start with the bug fixes!

You can see our github here.
And the pull request here.

Bug & Security Problem Fix

  • We've fixed a big security problem in which you could basically by modifying the redirect from SteemConnect to enter in somebody's else account.

  • You can no longer enter your coinflip games!
    We weren't checking before if the user that requests to enter in a coinflip game isn't the same which started the coinflip game. This had a simple fix, add a simple if condition.

if($player1 == $_COOKIE['username']) 
                        die("You can't play in your own games!");
if($player2 == $_COOKIE['username'])
                        die("You can't play in your own games!");

New Features

  • A new feature in profile that says how much you lost/won, and the total profit on SteemCasino!
  • A new footer in every page. (Coming next version: Provability fair)

image.png

  • A new Coinflip games layout

image.png

  • A new Coinflip History

image.png

When you press on "See Games That Ended", we search for games in our database that have finished earlier by their timestamp.

  • Games that ended 60 seconds or earlier still show!

We are looking at their timestamp and if their timestamp is lower than the current timestamp by maximum 60 seconds we display it.

$timestamp = $row['timestamp'];
if($timestamper <= 60) {
                $gameid = $row['ID'];
                $player1 = $row['player1'];
                $player2 = $row['player2'];
                $bet = $row['bet'];
                $reward = $row['reward'];
                $hash = $row['hash'];
                $secret = $row['secret'];
                
                $win = $row['win'];
                
                if($win == 1)
                    $winner = $player1;
                else
                    $winner = $player2;
                
                    $players = $player1."<br>".$player2."<br><a href=\"#\">View game</a>";
                
                $body .= "
                <div style=\"display:inline;float:left;padding-left:10px;\"><center>
                    <h3>Game #".$gameid."</h3>
                    <h4>Players<br>".$players."<br>
                    Jackpot: ".$reward." SBD
                    <br>Winner: ".$winner."<br><a href=\"#\" onClick=\"MyWindow=window.open('hash.php?hash=".$hash."&secret=".$secret."','MyWindow',width=600,height=300); return false;\">
                    See hash and secret
                    </a></center>
                </div>
                ";
        }
  • Last but not least we now have animations and a working view game button.

image.png

And the animations (they are gonna be changed)

animation1.gif

animation2.gif

animation3.gif

animation4.gif



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

You can contact us on Discord.
[utopian-moderator]

Hey @andreistalker I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Coin Marketplace

STEEM 0.20
TRX 0.26
JST 0.039
BTC 100331.97
ETH 3646.26
USDT 1.00
SBD 3.05