Exemple #1
0
        public override MatchResultList GetMatchResultListFromServer()
        {
            MatchResultList list2 = new MatchResultList();
            string str2 = "";
            try
            {
                string[] sportIds = { "1", "2", "3", "8", "9" };
                for (int i = 0; i < sportIds.Length; i++)
                {
                    string str3 = "today";
                    getMatchResult(list2, str3, sportIds[i]);

                    str3 = "yesterday";
                    getMatchResult(list2, str3, sportIds[i]);

                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetMatchResultListFromServer: " + exception.Message);
                list2 = new MatchResultList();
                ProjectData.ClearProjectError();
            }
            return list2;
        }
Exemple #2
0
 private void getMatchResult(MatchResultList list2, string selectDate, string sportId)
 {
     string str5 = null;
     string str4 = null;
     string str3 = "result-token=" + sportId + "%2C1%2C1&action=" + selectDate + "&leagueid=0&startdate=01%2F01%2F0001&names=";
     string str2 = base._objCore.PostRequestAutoCookie(this.GeneratePostRequest(base._strRootURL + "/webroot/restricted/Result/result-data.aspx", base._strRootURL + "/webroot/restricted/Result/Result.aspx", str3.Length, ""), str3, ref str5, ref str4);
     list2.get_SourceList().AddRange(this.GenerateMatchResultListFromText(str2, sportId));
     Thread.Sleep(20);
 }
        public void CheckNewMatchResult(MatchResultList matchResultList)
        {
            List<MatchResult> newMatchResult = new List<MatchResult>();

            List<MatchResult> currentMatchResult = matchResultList.get_SourceList();
            List<MatchResult> previousMatchResult = this._objMatchResultList.get_SourceList();

            foreach (var matchResult in currentMatchResult)
            {
                bool isEqual = false;

                foreach (var result in previousMatchResult)
                {
                      if (matchResult.get_MatchDate() == result.get_MatchDate() &
                        matchResult.get_HomeName() == result.get_HomeName() &
                        matchResult.get_AwayName() == result.get_AwayName())
                    {
                        isEqual = true;
                        break;
                    }
                }

                if (!isEqual)
                {
                    newMatchResult.Add(matchResult);
                }
            }

            if (newMatchResult.Count > 0)
            {
                MatchResultEventHandler matchResultEventHandler = this.matchResultEventHandler;
                if (null != matchResultEventHandler)
                {
                    matchResultEventHandler(this.get_Name(), newMatchResult);
                }
            }

            this._objMatchResultList = matchResultList;
        }
 public WebSiteAbstractClass()
 {
     this.set__objBetQueueMonitor(new BetQueueMonitorEx(2, 120));
     this._objGeneralProcessCallback = new TimerCallback(this.GeneralProcess);
     this._strAccountID = "";
     this._strAccountPassword = "";
     this._strLoginURL = "";
     this._strRootURL = "";
     this._objCookieList = new CookieList();
     this._strLatestFullOddsSource = "";
     this._strLatestPartOddsSource = "";
     this._strViewState = "";
     this._strEventValidation = "";
     this._intPingMS = 0x1869f;
     this._intDefaultBetAmount = 50;
     this._objBetAmountStyle = EnumCollection.eBetAmountStyle.Fixed;
     this._intBetQueueMaxAttempt = 2;
     this._dblOddsDifferentBad = 0.0;
     this._dblOddsDifferentBetter = 0.08;
     this._intMaxBetLimiter = 0x98967f;
     this._intGoodSpiderRequest = 0;
     this._intBadSpiderRequest = 0;
     this._decMinCreditLimit = 500M;
     this._objSportType = EnumCollection.eSportType.Soccer;
     this._objAccountStatus = EnumCollection.eAccountStatus.Normal;
     this._isPerMatchLimitEnabled = false;
     this._isIndonOddsRecalculation = false;
     this._isToCheckBetlist = false;
     this._isToGetMatchResultList = true;
     this._isAccountBlocked = false;
     this._isAutoBetting = false;
     this._isAutoReLogin = false;
     this._isAutoAdjustToMinBetAmount = true;
     this._isToCheckBetCredit = true;
     this._strSpiderURL = "";
     this._strSpiderFullPost = "";
     this._strSpiderPartPost = "";
     this._isProgramLoggerEnabled = true;
     this._isBetListLoggerEnabled = true;
     this._objSpiderMethod = EnumCollection.eSpiderMethod.Full;
     this._objBetOddsType = EnumCollection.eOddsType.Malay;
     this._isToGetRunningOdds = true;
     this._isToGetTodayOdds = true;
     this._isToGetEarlyOdds = false;
     this._isToGetSpecialOdds = true;
     this._isToGetOddEvenOdds = false;
     this._isToGetTotalGoalOdds = false;
     this._isToGetCorrectScoreOdds = false;
     this._isToGetOutRightOdds = false;
     this._isToIncludeFirstHalfOdds = true;
     this._isToInclude1X2Odds = false;
     this._isToGetOddsLite = false;
     this._isCanGetRunningOdds = false;
     this._isCanGetTodayOdds = false;
     this._isCanGetEarlyOdds = false;
     this._isCanGetSpecialOdds = false;
     this._isCanGetOddEvenOdds = false;
     this._isCanGetTotalGoalOdds = false;
     this._isCanGetCorrectScoreOdds = false;
     this._isCanGetOutRightOdds = false;
     this._intBetMinimumIntervalMS = 0x7d0;
     this._intSpiderMinimumIntervalMS = 0x3e8;
     this._intSpiderErrorCountLimit = 8;
     this._intSpiderErrorCountCurrent = 0;
     this._intTimeoutLimitPerSec = 15;
     this._intTimeoutCount = 0;
     this._intSpiderRunningIntervalSec = 50;
     this._intSpiderTodayIntervalSec = 30;
     this._intSpiderEarlyIntervalSec = 50;
     this._intSpiderSpecialIntervalSec = 130;
     this._intSpiderOddEvenIntervalSec = 30;
     this._intSpiderOutRightIntervalSec = 30;
     this._intSpiderTotalGoalIntervalSec = 30;
     this._intSpiderCorrectScoreIntervalSec = 30;
     this._intSpiderRunningCoolDownSec = 0;
     this._intSpiderTodayCoolDownSec = 0;
     this._intSpiderEarlyCoolDownSec = 0;
     this._intSpiderSpecialCoolDownSec = 0;
     this._intSpiderOddEvenCoolDownSec = 0;
     this._intSpiderOutRightCoolDownSec = 0;
     this._intSpiderTotalGoalCoolDownSec = 0;
     this._intSpiderCorrectScoreCoolDownSec = 0;
     this._strOddsRawFull = "";
     this._strOddsRawRunning = "";
     this._strOddsRawToday = "";
     this._strOddsRawEarly = "";
     this._strOddsRawSpecial = "";
     this._strOddsRawTotalGoal = "";
     this._strOddsRawOddEven = "";
     this._strOddsRawCorrectScore = "";
     this._strOddsRawOutRight = "";
     this._objOddsRawRunningList = new List<string>();
     this._objOddsRawTodayList = new List<string>();
     this._objOddsRawEarlyList = new List<string>();
     this._strAccountCurrency = "";
     this._isToTryManualMatching = true;
     this._isSearchUsingSingleName = false;
     this._isToTryFuzzy = false;
     this._isToTrySimilarHDP = true;
     this._strInProcessBetPairID = "";
     this._isBetPairCanGetTicket = true;
     this._isBetPairCanBet = false;
     this._strLoginStatus = "";
     this._strLoginError = "";
     this._isLoginSuccess = false;
     this._isLoggingIn = false;
     this._isBetting = false;
     this._isGettingFullOdds = false;
     this._isGettingPartOdds = false;
     this._isWaitingNextInternalSpiderStep = false;
     this._isWebPageOpened = false;
     this._isFirstGetOddsDone = false;
     this._datLatestSpiderStepStart = DateTime.Now;
     this._datLatestSpiderStart = DateTime.Now;
     this._intSpiderMS = 0;
     this._intSingleSpiderMS = 0;
     this._objSpiderMSRecordList = new List<int>();
     this._intAverageSpiderMS = 0;
     this._isToUpdateMatchListSelected = true;
     this._objOddsChangeHistory = new List<double>();
     this._intLoginFailCount = 0;
     this._intLoginFailCountLimit = 5;
     this._intServerBetlistRefreshRateSec = 3;
     this._objMatchLiteListFull = new List<MatchLite>();
     this._objMatchLiteListRunning = new List<MatchLite>();
     this._objMatchLiteListToday = new List<MatchLite>();
     this._objMatchLiteListEarly = new List<MatchLite>();
     this._objMatchLiteListSpecial = new List<MatchLite>();
     this._objMatchListFull = new List<MatchNew>();
     this._objMatchListSelected = new List<MatchNew>();
     this._objMatchListRunning = new List<MatchNew>();
     this._objMatchListToday = new List<MatchNew>();
     this._objMatchListEarly = new List<MatchNew>();
     this._objMatchListSpecial = new List<MatchNew>();
     this._objMatchListTotalGoal = new List<MatchTotalGoal>();
     this._objMatchListCorrectScore = new List<MatchCorrectScore>();
     this._objMatchListOddEven = new List<MatchOddEven>();
     this._objMatchListOutRight = new List<MatchOutRight>();
     this._objBetListLive = new List<MatchBetNew>();
     this._objBetListAll = new List<MatchBetNew>();
     this._objBetListFailed = new List<MatchBetNew>();
     this._objProgramBetListPermanent = new List<MatchBetNew>();
     this._objServerBetListPermanent = new List<MatchBetNew>();
     this._objServerBetListCurrent = new List<MatchBetNew>();
     this._objPostList = new List<DataDescription>();
     this._objMatchResultList = new MatchResultList();
     this._objRunningPageOptionList = new List<string>();
     this._objTodayPageOptionList = new List<string>();
     this._objEarlyPageOptionList = new List<string>();
     this._objErrorLogger = new Logger();
     this.lngTimeOut = 0x4e20L;
     this.isLastCallSuccess = true;
 }
Exemple #5
0
 public override MatchResultList GetMatchResultListFromServer()
 {
     MatchResultList list2 = new MatchResultList();
     string str2 = "";
     string s = "";
     try
     {
         string str4 = null;
         string str5 = null;
         str2 = base._objCore.GetRequestAutoCookie(this.GenerateGetRequest(base._strRootURL + "/Info/Result.aspx", base._strRootURL + "/MenuBet/TopMenu_SLV.aspx", ""), ref str4, ref str5);
         CommonFunction.Log("as1 ok");
         int num = 0;
         s = CommonFunction.substring(str2, 0, "changeDate(\"", "\"", ref num).Trim();
         if (s != string.Empty)
         {
             string str3 = "";
             DateTime time = DateTime.ParseExact(s, "yyyy/MM/dd", null);
             list2.get_SourceList().AddRange(this.GenerateMatchResultListFromText(str2));
             str3 = "i41sport=0&d01day=" + time.AddDays(-1.0).ToString("yyyy/MM/dd").Replace("/", "%2F") + "&s13league=&i20isor=0&i33year=" + time.Year.ToString();
             str5 = null;
             str4 = null;
             str2 = base._objCore.PostRequestAutoCookie(this.GeneratePostRequest(base._strRootURL + "/Info/Result.aspx", base._strRootURL + "/MenuBet/TopMenu_SLV.aspx", str3.Length, ""), str3, ref str5, ref str4);
             CommonFunction.Log("as2 ok");
             list2.get_SourceList().AddRange(this.GenerateMatchResultListFromText(str2));
         }
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetMatchResultListFromServer: " + exception.Message);
         list2 = new MatchResultList();
         ProjectData.ClearProjectError();
     }
     return list2;
 }
Exemple #6
0
 private void getMatchResult(MatchResultList list2,string selectDate,string sportId)
 {
     Thread.Sleep(100);
     string str5 = null;
     string str4 = null;
     // mode=sport&selectDate=2%2F28%2F2011&sportType=5&league=
     string str3 = "mode=sport&selectDate=" + selectDate.Replace("/", "%2F") + "&sportType=" + sportId + "&league=";
     string str2 = base._objCore.PostRequestAutoCookie(this.GeneratePostRequest(base._strRootURL + "/Result.aspx", base._strRootURL + "/Result.aspx", str3.Length, ""), str3, ref str5, ref str4);
     list2.get_SourceList().AddRange(this.GenerateMatchResultListFromText(str2, sportId));
 }
Exemple #7
0
 public override MatchResultList GetMatchResultListFromServer()
 {
     MatchResultList list2 = new MatchResultList();
     string str2 = "";
     string s = "";
     try
     {
         string str4 = null;
         string str5 = null;
         int num = 0;
         s = CommonFunction.substring(base._objCore.GetRequestAutoCookie(this.GenerateGetRequest(base._strRootURL + "/Result.aspx", base._strRootURL + "/Result.aspx", ""), ref str4, ref str5), 0, "id=\"selectDate", "value=\"", "\"", ref num).Trim();
         if (s != string.Empty)
         {
             string str3 = "";
             DateTime time = DateTime.ParseExact(s, "MM/dd/yyyy", CultureInfo.InvariantCulture);
             string[] sportIds = {"1","2","5"};
             for (int i = 0; i < sportIds.Length; i++)
             {
                 String result = time.AddDays(-1.0).ToString("M/d/yyyy");
                 result = result.Replace("-", "/");
                 getMatchResult(list2, result, sportIds[i]);
        ;
                 result = time.ToString("M/d/yyyy");
                 result = result.Replace("-", "/");
                 getMatchResult(list2, result, sportIds[i]);
             }
         }
     }
     catch (Exception exception1)
     {
         ProjectData.SetProjectError(exception1);
         Exception exception = exception1;
         base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetMatchResultListFromServer: " + exception.Message);
         list2 = new MatchResultList();
         ProjectData.ClearProjectError();
     }
     return list2;
 }