コード例 #1
0
ファイル: IBCBet.cs プロジェクト: yjtang/AutoBws
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                string str = "";
                string str3 = "";
                string str4 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/BetProcess_Data.aspx";
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str = new1.get_FTHDP_ID();
                        str3 = new1.get_FT_HomeOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str = new1.get_FTHDP_ID();
                        str3 = new1.get_FT_AwayOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str = new1.get_FTOU_ID();
                        str3 = new1.get_FT_OverOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str = new1.get_FTOU_ID();
                        str3 = new1.get_FT_UnderOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str = new1.get_HalfHDP_ID();
                        str3 = new1.get_Half_HomeOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str = new1.get_HalfHDP_ID();
                        str3 = new1.get_Half_AwayOddsString();
                        str4 = "a";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str = new1.get_HalfOU_ID();
                        str3 = new1.get_Half_OverOddsString();
                        str4 = "h";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str = new1.get_HalfOU_ID();
                        str3 = new1.get_Half_UnderOddsString();
                        str4 = "a";
                        break;
                    // add 1x2
                    case EnumCollection.eBetTarget.FT_1:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2HomeOddsString().ToString();
                        str4 = "1";
                        break;
                    case EnumCollection.eBetTarget.FT_X:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2AwayOddsString().ToString();
                        str4 = "X";
                        break;
                    case EnumCollection.eBetTarget.FT_2:
                        str = new1.get_FT1X2_ID();
                        str3 = new1.get_FT_1X2DrawOddsString().ToString();
                        str4 = "2";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2HomeOddsString().ToString();
                        str4 = "1";
                        break;
                    case EnumCollection.eBetTarget.Half_X:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2AwayOddsString().ToString(); ;
                        str4 = "X";
                        break;
                    case EnumCollection.eBetTarget.Half_2:
                        str = new1.get_Half1X2_ID();
                        str3 = new1.get_Half_1X2DrawOddsString().ToString(); ;
                        str4 = "2";
                        break;
                }
                str5 = "bp_Match=" + str + "_" + str4 + "_" + str3 + "&bp_ssport=&chk_BettingChange=4";
                // Add Andy 添加新值 2011.08.08
                StringBuilder sb = new StringBuilder(str5);
                sb.Append("&").Append(this.key);
                sb.Append("=").Append(this.value);
                str5 = sb.ToString();
                // End Andy

                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString);
                request.Timeout = 0x7530;
                request.Method = "POST";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/LeftAllInOne.aspx";
                request.ContentType = "application/x-www-form-urlencoded";
                request.ContentLength = str5.Length;

                base._objBetListLogger.write("POST: " + str5);
                this.WriteProgramLogger("TWESTESST2.0: " + request.Address.ToString());
                Stream stream = request.GetRequestStream();
                byte[] bytes = Encoding.UTF8.GetBytes(str5);
                stream.Write(bytes, 0, str5.Length);
                stream.Close();
                this.WriteProgramLogger("TWESTESST2.1: " + request.Address.ToString());

                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                base.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                ProjectData.ClearProjectError();
            }
        }
コード例 #2
0
ファイル: SBOBet.cs プロジェクト: yjtang/AutoBws
        public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string format = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                format = base._strRootURL + "/webroot/restricted/plain/ticket.aspx?{0}&loginname=" + this._strLoginName;
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_FT_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_FT_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_1:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_X:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.FT_2:
                        str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_Half_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_Half_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;
                    case EnumCollection.eBetTarget.Half_1:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_X:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                    case EnumCollection.eBetTarget.Half_2:
                        str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto=";
                        break;

                }
                string url = string.Format(format, str5);
                new3 = new4;
                new2 = new1.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Timeout = 0x7530;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.ContentType = "application/x-www-form-urlencoded";
                //request.KeepAlive = true;

                this.WriteProgramLogger("POST: " + url);
                base._objBetListLogger.write("POST: " + str5);
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true);
                this.allDone.WaitOne();
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null);
                this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4);
                ProjectData.ClearProjectError();
            }
        }
コード例 #3
0
ファイル: BW3388.cs プロジェクト: yjtang/AutoBws
        private void GetTicketAndBetFromAgent(MatchBetNew new1, MatchNew new4, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1)
        {
            MatchBetNew new3 = new MatchBetNew();
            MatchBetNew new2 = new MatchBetNew();
            try
            {
                string requestUriString = "";
                string str5 = "";
                base._isBetting = true;
                base._datTicketStart = DateTime.Now;
                requestUriString = base._strRootURL + "/english/index.php?p=bettingback&b=soccer|";
                if (new1.get_GameType() == EnumCollection.eGameType.Running)
                {
                    str5 = "r";
                }
                switch (target1)
                {
                    case EnumCollection.eBetTarget.FT_Home:
                        requestUriString = requestUriString + string.Format("{2}ah|{0}|a||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Away:
                        requestUriString = requestUriString + string.Format("{2}ah|{0}|b||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Over:
                        requestUriString = requestUriString + string.Format("{2}ou|{0}|over||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.FT_Under:
                        requestUriString = requestUriString + string.Format("{2}ou|{0}|under||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Home:
                        requestUriString = requestUriString + string.Format("{2}ahht|{0}|a||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Away:
                        requestUriString = requestUriString + string.Format("{2}ahht|{0}|b||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Over:
                        requestUriString = requestUriString + string.Format("{2}ouht|{0}|over||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5);
                        break;

                    case EnumCollection.eBetTarget.Half_Under:
                        requestUriString = requestUriString + string.Format("{2}ouht|{0}|under||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5);
                        break;
                }
                new3 = new1;
                new2 = new4.GenerateMatchBet(target1);
                HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString);
                request.Timeout = 0x2710;
                request.Method = "GET";
                request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16";
                request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
                request.Headers.Add("Accept-Language", "en-gb,en;q=0.5");
                request.Headers.Add("Accept-Encoding", "gzip, deflate");
                request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7");
                request.Headers["Cookie"] = base._objCookieList.ToString();
                request.Referer = base._strRootURL + "/english/index.php?p=user_main";
                request.ContentLength = 0L;
                request.KeepAlive = true;
                WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, "", num1, new3.get_BetType(), target1, new MatchNew(), new3, new4, new2, bet1);
                ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._isBetting = false;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message);
                this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new4, new2, null);
                ProjectData.ClearProjectError();
            }
        }