Exemple #1
0
        public override bool InternalSendTip(string User, decimal amount)
        {
            try
            {
                string     x = Client.GetStringAsync(string.Format("https://api.betking.io/api/stats/getuserstats?appId={0}&userName={1}", 0, User)).Result;
                BKGetStats y = json.JsonDeserialize <BKGetStats>(x);
                if (y == null)
                {
                    return(false);
                }


                string cont    = string.Format(System.Globalization.NumberFormatInfo.InvariantInfo, "{{receiverId:\"{0}\",amount:\"{1:0.00000000}\",currency:{2},code:null}}", y.account.id, amount, Curs[Currency]);
                var    content = new StringContent(cont, Encoding.UTF8, "application/json");

                HttpResponseMessage response = Client.PostAsync("https://betking.io/bet/api/account/send-tip", content).Result;
                ForceUpdateStats = (response.IsSuccessStatusCode);
                return(response.IsSuccessStatusCode);
            }
            catch (Exception e)
            {
                Parent.DumpLog(e.ToString(), -1);
            }
            return(false);
        }
Exemple #2
0
        void GetStats()
        {
            HttpResponseMessage Msg = Client.GetAsync(string.Format("https://api.betking.io/api/stats/getuserstats?appId={0}&userName={1}", 0, username)).Result;

            if (Msg.IsSuccessStatusCode)
            {
                string Response = Msg.Content.ReadAsStringAsync().Result;

                BKGetStats tmp = json.JsonDeserialize <BKGetStats>(Response);
                foreach (BKStat x in tmp.stats)
                {
                    if (x.currency == Curs[Currency])
                    {
                        this.profit  = x.profit;
                        this.bets    = x.numBets;
                        this.wagered = x.wagered;
                    }
                }
                Parent.updateProfit(profit);
                Parent.updateBets(bets);
                Parent.updateWagered(wagered);
                Parent.updateWins(wins);
                Parent.updateLosses(losses);
            }
        }