Пример #1
0
        public List<MatchLite> GenerateFullOddsLiteFromText1004(string text1, bool flag2, bool bb1, bool flag1, bool bb2, bool bb3)
        {
            List<MatchLite> list2 = new List<MatchLite>();
            int[] numArray = new int[] { -1, -1, -1, -1 };
            MatchLite lite = new MatchLite();
            string str7 = "";
            string str6 = "";
            string str2 = "";
            string str = "";
            string str4 = "";
            string str3 = "";
            int num3 = 0;
            EnumCollection.eRunningStatus deadBall = EnumCollection.eRunningStatus.DeadBall;
            int num2 = 0;
            int num = 0;
            DateTime time3 = new DateTime();
            DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now));
            text1 = text1.Replace("[,", "['',").Replace(",]", ",'']").Replace(", ,", ",'',").Replace(",,", ",'',").Replace(", ,", ",'',").Replace(",,", ",'',");
            TextReader reader2 = new StringReader(text1);
            JsonReader reader = new JsonTextReader(reader2);
            while (reader.Read())
            {
                if (reader.TokenType != JsonToken.StartArray)
                {
                    continue;
                }
                while (reader.Read())
                {
                    int num5;
                    if (reader.TokenType == JsonToken.StartArray)
                    {
                        num5 = 0;
                        numArray[num5]++;
                        List<string> list3 = new List<string>();
                        lite = new MatchLite();
                        while (reader.Read())
                        {
                            if (reader.TokenType != JsonToken.StartArray)
                            {
                                goto Label_0D66;
                            }
                            num5 = 1;
                            numArray[num5]++;
                            list3 = new List<string>();
                        Label_0D58:
                            while (reader.Read())
                            {
                                if (reader.TokenType == JsonToken.StartArray)
                                {
                                    num5 = 2;
                                    numArray[num5]++;
                                    list3 = new List<string>();
                                    while (reader.Read())
                                    {
                                        MatchLite lite2;
                                        string str9;
                                        if (reader.TokenType != JsonToken.EndArray)
                                        {
                                            goto Label_0CB5;
                                        }
                                        numArray[3] = -1;
                                        if (((numArray[1] == 1) & (numArray[2] == 0)) & (list3.Count >= 9))
                                        {
                                            DateTime time2;
                                            if (str2 != list3[1].Trim())
                                            {
                                                num2 = 0;
                                                num = 0;
                                                num3 = 0;
                                                deadBall = EnumCollection.eRunningStatus.DeadBall;
                                            }
                                            str2 = list3[1].Trim();
                                            str = list3[2].Trim();
                                            str7 = list3[5].Replace("</span>", "").Trim();
                                            if (str7.Contains("/"))
                                            {
                                                if (str7.Length >= 0x10)
                                                {
                                                    string str8 = str7.Substring(11, 5);
                                                    time2 = new DateTime((int)Math.Round(Conversion.Val(str7.Substring(6, 4))), (int)Math.Round(Conversion.Val(str7.Substring(0, 2))), (int)Math.Round(Conversion.Val(str7.Substring(3, 2))), (int)Math.Round(Conversion.Val(str8.Substring(0, 2))), (int)Math.Round(Conversion.Val(str8.Substring(3, 2))), 0);
                                                    time3 = time2;
                                                }
                                            }
                                            else
                                            {
                                                time2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, (int)Math.Round(Conversion.Val(str7.Substring(0, 2))), (int)Math.Round(Conversion.Val(str7.Substring(3, 2))), 0);
                                                int num4 = (int)Math.Round(time2.Subtract(DateTime.Now).TotalMinutes);
                                                if (((DateTime.Now.Hour >= 12) & (DateTime.Now.Hour <= 0x17)) && ((time2.Hour >= 0) & (time2.Hour <= 11)))
                                                {
                                                    time2 = time2.AddDays(1.0);
                                                }
                                                time3 = time2;
                                            }
                                            if (list3[6] == "1")
                                            {
                                                lite.set_GameType(EnumCollection.eGameType.Running);
                                            }
                                        }
                                        else if (((numArray[1] == 1) & (numArray[2] == 1)) & (list3.Count == 3))
                                        {
                                            num2 = (int)Math.Round(Conversion.Val(list3[1]));
                                            num = (int)Math.Round(Conversion.Val(list3[2]));
                                        }
                                        else if (((numArray[1] == 1) & (numArray[2] == 2)) & (list3.Count == 5))
                                        {
                                            if (list3[2] == "0")
                                            {
                                                num3 = 0x2d;
                                                deadBall = EnumCollection.eRunningStatus.HT;
                                            }
                                            else
                                            {
                                                num3 = (int)Math.Round((double)(((Conversion.Val(list3[2]) - 1.0) * Conversion.Val(list3[4])) + Conversion.Val(list3[3])));
                                                deadBall = EnumCollection.eRunningStatus.Running;
                                            }
                                        }
                                        else if (numArray[1] == 2)
                                        {
                                            lite2 = new MatchLite();
                                            lite2 = lite.CloneObject();
                                            lite2.set_GlobalLastUpdate(DateTime.Now);
                                            lite2.set_Type(EnumCollection.eMatchType.Match);
                                            lite2.set_MatchID(str6);
                                            lite2.set_MatchTime(time3);
                                            lite2.set_HomeName(str2);
                                            lite2.set_AwayName(str);
                                            lite2.get_HomeName().Replace("&nbsp;", "");
                                            lite2.get_AwayName().Replace("&nbsp;", "");
                                            lite2.set_League(str4);
                                            lite2.set_LeagueID(str3);
                                            lite2.set_HomeScore(num2);
                                            lite2.set_AwayScore(num);
                                            lite2.set_RunningMinutes(num3);
                                            lite2.set_RunningStatus(deadBall);
                                            lite2.set_Company("SBOBet");
                                            if ((lite2.get_RunningStatus() == EnumCollection.eRunningStatus.HT) | (lite2.get_RunningStatus() == EnumCollection.eRunningStatus.Running))
                                            {
                                                lite2.set_GameType(EnumCollection.eGameType.Running);
                                            }
                                            else if (SpiderFunction.IsEarlyMarket(time, lite2.get_MatchTime()))
                                            {
                                                lite2.set_GameType(EnumCollection.eGameType.Early);
                                            }
                                            switch (list3.Count)
                                            {
                                                case 3:
                                                    if (list3[0] != string.Empty)
                                                    {
                                                        str6 = list3[0];
                                                    }
                                                    goto Label_0D58;

                                                case 4:
                                                    goto Label_0D58;

                                                case 5:
                                                    if (list3[0] != "3")
                                                    {
                                                        goto Label_098A;
                                                    }
                                                    lite2.set_OddsType(EnumCollection.eOddsType.Malay);
                                                    lite2.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                                    lite2.set_BetType(EnumCollection.eBetType.OU);
                                                    lite2.set_HandicapID(list3[1]);
                                                    lite2.set_HomeOverOddsString(list3[2]);
                                                    lite2.set_AwayUnderOddsString(list3[3]);
                                                    lite2.set_Handicap(list3[4]);
                                                    lite2.set_UniqueID(lite2.get_HandicapID() + Conversion.Val(lite2.get_BetCoverage()).ToString() + Conversion.Val(lite2.get_BetType()).ToString());
                                                    lite2.UpdateCommission();
                                                    if (((base._isToGetEarlyOdds & (lite2.get_GameType() == EnumCollection.eGameType.Early)) | (base._isToGetRunningOdds & (lite2.get_GameType() == EnumCollection.eGameType.Running))) | (base._isToGetTodayOdds & (lite2.get_GameType() == EnumCollection.eGameType.Today)))
                                                    {
                                                        list2.Add(lite2);
                                                    }
                                                    goto Label_0D58;

                                                case 6:
                                                    if (list3[0] != "1")
                                                    {
                                                        goto Label_0708;
                                                    }
                                                    lite2.set_OddsType(EnumCollection.eOddsType.Malay);
                                                    lite2.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                                    lite2.set_BetType(EnumCollection.eBetType.HDP);
                                                    lite2.set_HandicapID(list3[1]);
                                                    lite2.set_HomeOverOddsString(list3[2]);
                                                    lite2.set_AwayUnderOddsString(list3[3]);
                                                    lite2.set_Handicap(list3[4]);
                                                    lite2.set_UniqueID(lite2.get_HandicapID() + Conversion.Val(lite2.get_BetCoverage()).ToString() + Conversion.Val(lite2.get_BetType()).ToString());
                                                    lite2.UpdateCommission();
                                                    str9 = list3[5];
                                                    if (str9 != "2")
                                                    {
                                                        goto Label_0687;
                                                    }
                                                    lite2.set_HomeColor(Color.Blue);
                                                    lite2.set_AwayColor(Color.Red);
                                                    goto Label_06C9;
                                            }
                                        }
                                        goto Label_0D58;
                                    Label_0687:
                                        if (str9 == "1")
                                        {
                                            lite2.set_HomeColor(Color.Red);
                                            lite2.set_AwayColor(Color.Blue);
                                        }
                                        else
                                        {
                                            lite2.set_HomeColor(Color.Blue);
                                            lite2.set_AwayColor(Color.Blue);
                                        }
                                    Label_06C9:
                                        if (((flag1 & (lite2.get_GameType() == EnumCollection.eGameType.Early)) | (flag2 & (lite2.get_GameType() == EnumCollection.eGameType.Running))) | (base._isToGetTodayOdds & (lite2.get_GameType() == EnumCollection.eGameType.Today)))
                                        {
                                            list2.Add(lite2);
                                        }
                                        goto Label_0D58;
                                    Label_0708:
                                        if ((list3[0] == "7") & base._isToIncludeFirstHalfOdds)
                                        {
                                            lite2.set_OddsType(EnumCollection.eOddsType.Malay);
                                            lite2.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                            lite2.set_BetType(EnumCollection.eBetType.HDP);
                                            lite2.set_HandicapID(list3[1]);
                                            lite2.set_HomeOverOddsString(list3[2]);
                                            lite2.set_AwayUnderOddsString(list3[3]);
                                            lite2.set_Handicap(list3[4]);
                                            lite2.set_UniqueID(lite2.get_HandicapID() + Conversion.Val(lite2.get_BetCoverage()).ToString() + Conversion.Val(lite2.get_BetType()).ToString());
                                            lite2.UpdateCommission();
                                            string str10 = list3[5];
                                            if (str10 == "2")
                                            {
                                                lite2.set_HomeColor(Color.Blue);
                                                lite2.set_AwayColor(Color.Red);
                                            }
                                            else if (str10 == "1")
                                            {
                                                lite2.set_HomeColor(Color.Red);
                                                lite2.set_AwayColor(Color.Blue);
                                            }
                                            else
                                            {
                                                lite2.set_HomeColor(Color.Blue);
                                                lite2.set_AwayColor(Color.Blue);
                                            }
                                            if (((base._isToGetEarlyOdds & (lite2.get_GameType() == EnumCollection.eGameType.Early)) | (base._isToGetRunningOdds & (lite2.get_GameType() == EnumCollection.eGameType.Running))) | (base._isToGetTodayOdds & (lite2.get_GameType() == EnumCollection.eGameType.Today)))
                                            {
                                                list2.Add(lite2);
                                            }
                                        }
                                        goto Label_0D58;
                                    Label_098A:
                                        if ((list3[0] == "9") & base._isToIncludeFirstHalfOdds)
                                        {
                                            lite2.set_OddsType(EnumCollection.eOddsType.Malay);
                                            lite2.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                            lite2.set_BetType(EnumCollection.eBetType.OU);
                                            lite2.set_HandicapID(list3[1]);
                                            lite2.set_HomeOverOddsString(list3[2]);
                                            lite2.set_AwayUnderOddsString(list3[3]);
                                            lite2.set_Handicap(list3[4]);
                                            lite2.set_UniqueID(lite2.get_HandicapID() + Conversion.Val(lite2.get_BetCoverage()).ToString() + Conversion.Val(lite2.get_BetType()).ToString());
                                            lite2.UpdateCommission();
                                            if (((base._isToGetEarlyOdds & (lite2.get_GameType() == EnumCollection.eGameType.Early)) | (base._isToGetRunningOdds & (lite2.get_GameType() == EnumCollection.eGameType.Running))) | (base._isToGetTodayOdds & (lite2.get_GameType() == EnumCollection.eGameType.Today)))
                                            {
                                                list2.Add(lite2);
                                            }
                                        }
                                        else if ((list3[0] == "5") & base._isToInclude1X2Odds)
                                        {
                                            lite2.set_OddsType(EnumCollection.eOddsType.Euro);
                                            lite2.set_BetCoverage(EnumCollection.eBetCoverage.FT);
                                            lite2.set_BetType(EnumCollection.eBetType.lX2);
                                            lite2.set_HandicapID(list3[1]);
                                            lite2.set_HomeOverOddsString(list3[2]);
                                            lite2.set_AwayUnderOddsString(list3[3]);
                                            lite2.set_DrawOddsString(list3[4]);
                                            lite2.set_Handicap("0.0");
                                            lite2.set_UniqueID(lite2.get_HandicapID() + Conversion.Val(lite2.get_BetCoverage()).ToString() + Conversion.Val(lite2.get_BetType()).ToString());
                                            if (((base._isToGetEarlyOdds & (lite2.get_GameType() == EnumCollection.eGameType.Early)) | (base._isToGetRunningOdds & (lite2.get_GameType() == EnumCollection.eGameType.Running))) | (base._isToGetTodayOdds & (lite2.get_GameType() == EnumCollection.eGameType.Today)))
                                            {
                                                list2.Add(lite2);
                                            }
                                        }
                                        else if ((list3[0] == "8") & base._isToInclude1X2Odds)
                                        {
                                            lite2.set_OddsType(EnumCollection.eOddsType.Euro);
                                            lite2.set_BetCoverage(EnumCollection.eBetCoverage.FirstHalf);
                                            lite2.set_BetType(EnumCollection.eBetType.lX2);
                                            lite2.set_HandicapID(list3[1]);
                                            lite2.set_HomeOverOddsString(list3[2]);
                                            lite2.set_AwayUnderOddsString(list3[3]);
                                            lite2.set_DrawOddsString(list3[4]);
                                            lite2.set_Handicap("0.0");
                                            lite2.set_UniqueID(lite2.get_HandicapID() + Conversion.Val(lite2.get_BetCoverage()).ToString() + Conversion.Val(lite2.get_BetType()).ToString());
                                            if (((base._isToGetEarlyOdds & (lite2.get_GameType() == EnumCollection.eGameType.Early)) | (base._isToGetRunningOdds & (lite2.get_GameType() == EnumCollection.eGameType.Running))) | (base._isToGetTodayOdds & (lite2.get_GameType() == EnumCollection.eGameType.Today)))
                                            {
                                                list2.Add(lite2);
                                            }
                                        }
                                        goto Label_0D58;
                                    Label_0CB5:
                                        num5 = 3;
                                        numArray[num5]++;
                                        if (reader.Value != null)
                                        {
                                            list3.Add(reader.Value.ToString());
                                        }
                                    }
                                }
                                else
                                {
                                    if (reader.TokenType == JsonToken.EndArray)
                                    {
                                        numArray[2] = -1;
                                        if ((numArray[1] == 0) & (list3.Count == 3))
                                        {
                                            str3 = list3[0];
                                            str4 = list3[1].Trim();
                                        }
                                        break;
                                    }
                                    num5 = 2;
                                    numArray[num5]++;
                                    if (reader.Value != null)
                                    {
                                        list3.Add(reader.Value.ToString());
                                    }
                                }
                            }
                            continue;
                        Label_0D66:
                            if (reader.TokenType == JsonToken.EndArray)
                            {
                                numArray[1] = -1;
                                break;
                            }
                            num5 = 1;
                            numArray[num5]++;
                        }
                        continue;
                    }
                    if (reader.TokenType == JsonToken.EndArray)
                    {
                        numArray[0] = -1;
                    }
                    else
                    {
                        num5 = 0;
                        numArray[num5]++;
                    }
                }
            }
            if (list2.Count > 0)
            {
                list2.RemoveAt(list2.Count - 1);
            }
            return list2;
        }