Ejemplo n.º 1
0
        private void loadStateInfo()
        {
            //Label
            Player player = Player.getPlayer();

            levelValue.Text           = player.getLevel();
            atkValue.Text             = player.getAttack();
            defValue.Text             = player.getDefense();
            staminaValue.Text         = player.getStamina();
            tokensValue.Text          = player.getTokens();
            goldValue.Text            = player.getGold();
            satoshiValue.Text         = player.getSatoshi();
            bitconAddressTextBox.Text = player.getBitCoinAddress();
            arenapointsValue.Text     = player.getArenaPoints();

            //Button
            stamina_btn.Enabled = player.canUpgradeStamina();
            stamina_btn.Text    = Player.UPGRADE + player.upgradeStaminaGold() + Player.GOLD_LABEL;
            tokens_btn.Enabled  = player.canUpgradeTokens();
            tokens_btn.Text     = Player.UPGRADE + player.upgradeTokensGold() + Player.GOLD_LABEL;
            atk_btn.Enabled     = player.canUpgradeAttack();
            atk_btn.Text        = Player.UPGRADE + player.upgradeAttackGold() + Player.GOLD_LABEL;
            def_btn.Enabled     = player.canUpgradeDefense();
            def_btn.Text        = Player.UPGRADE + player.upgradeDefenseGold() + Player.GOLD_LABEL;
        }
Ejemplo n.º 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Player player = Player.getPlayer();

            player.setBitCoinAddress(bitconAddressTextBox.Text);
            CookieAwareWebClient client = new CookieAwareWebClient(this.cookie);
            String postData             = String.Format("utf8={0}&_method={1}&authenticity_token={2}&user%5Bbitcoin_address%5D={3}&commit={4}",
                                                        CoinBrawl.UTF8, CoinBrawl.METHOD_PATCH, SourceParser.ParseCSRFToken(client.DownloadString(CoinBrawl.CHARACTER)), player.getBitCoinAddress(), CoinBrawl.COMMIT_SAVE);

            client.Method    = CookieAwareWebClient.POST;
            client.clickSave = true;
            try
            {
                client.UploadString(CoinBrawl.USER + player.getUserID(), postData);
                MessageBox.Show("You have successfully updated your bitcoin address");
            }
            catch (WebException ex)
            {
                //
                MessageBox.Show("Fail to updat your bitcoin address");
                //
            }
            updateMainForm();
            loadStateInfo();
        }