Ejemplo n.º 1
0
        void GetRollThread(object _BetID)
        {
            try
            {
                long           BetID      = (long)_BetID;
                HttpWebRequest betrequest = (HttpWebRequest)HttpWebRequest.Create("https://api.primedice.com/api/bets/" + BetID);
                if (Prox != null)
                {
                    betrequest.Proxy = Prox;
                }
                betrequest.Method = "GET";

                betrequest.ContentType = "application/x-www-form-urlencoded; charset=UTF-8";


                HttpWebResponse EmitResponse  = (HttpWebResponse)betrequest.GetResponse();
                string          sEmitResponse = new StreamReader(EmitResponse.GetResponseStream()).ReadToEnd();
                pdbet           tmp           = json.JsonDeserialize <pdbet>(sEmitResponse);
                if (tmp.bet.server != "")
                {
                    sqlite_helper.InsertSeed(tmp.bet.server, sqlite_helper.GetHashForBet(Name, long.Parse(tmp.bet.id)));
                }
            }
            catch
            {
            }
            GettingSeed = false;
        }
Ejemplo n.º 2
0
Archivo: PD.cs Proyecto: zsux/DiceBot
 void GetRollThread(object _BetID)
 {
     try
     {
         long   BetID         = (long)_BetID;
         string sEmitResponse = Client.GetStringAsync("bets/" + BetID).Result;
         pdbet  tmp           = json.JsonDeserialize <pdbet>(sEmitResponse);
         if (tmp.bet.server != "")
         {
             sqlite_helper.InsertSeed(tmp.bet.server, sqlite_helper.GetHashForBet(Name, long.Parse(tmp.bet.id)));
         }
     }
     catch
     {
     }
     GettingSeed = false;
 }