Exemplo n.º 1
0
        public List<MatchNew> GenerateFullOddsFromText(string text1, bool flag4, bool flag2, bool flag3, bool flag1)
        {
            List<MatchNew> list2 = new List<MatchNew>();
            DateTime time2 = new DateTime();
            Dictionary<string, JsonMatch> dictionary = new Dictionary<string, JsonMatch>();
            DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now));
            Color blue = Color.Blue;
            Color red = Color.Blue;
            try
            {
                int num4 = 0;
                text1 = CommonFunction.substring(text1, 0, "var odds =", ";", ref num4).Trim();
                text1 = text1.Replace("\"1x2", "\"lx2").Replace("\"1sthf1x2rb", "\"lsthf1x2rb");
                dictionary = JsonConvert.DeserializeObject<Dictionary<string, JsonMatch>>(text1);
                if (dictionary == null)
                {
                    return list2;
                }
                Dictionary<string, JsonMatch>.Enumerator enumerator = dictionary.GetEnumerator();
                try
                {
                    //enumerator;
                    while (enumerator.MoveNext())
                    {
                        ArrayList list3;
                        DateTime now;
                        DateTime time4;
                        KeyValuePair<string, JsonMatch> current = enumerator.Current;
                        MatchNew item = new MatchNew();
                        JsonMatch match = current.Value;
                        item.set_FT_ID(current.Key.ToString());
                        item.set_FT_ID(item.get_FT_ID().Replace("m", ""));
                        item.set_Half_ID(item.get_FT_ID());
                        item.set_UniqueID(item.get_FT_ID());
                        item.set_Type(EnumCollection.eMatchType.Match);
                        item.set_Website("SB188");
                        item.set_GlobalLastUpdate(DateTime.Now);
                        if (match.info.Count == 15)
                        {
                            item.set_League(match.info[5].ToString().Trim());
                            item.set_HomeName(match.info[8].ToString().Trim());
                            item.set_AwayName(match.info[10].ToString().Trim());
                            list3 = CommonFunction.SeperateStringBySymbol(match.info[6].ToString().Trim(), " ");
                            if ((list3.Count == 2) && (match.info[7].ToString().Trim().Length == 5))
                            {
                                now = DateTime.Now;
                                time4 = new DateTime(now.Year, CommonFunction.ConvertMonthName3CharToNumber(list3[1].ToString().Trim()), (int) Math.Round(Conversion.Val(list3[0].ToString().Trim())), Conversions.ToInteger(match.info[7].ToString().Substring(0, 2)), Conversions.ToInteger(match.info[7].ToString().Substring(3, 2)), 0);
                                item.set_MatchTime(time4);
                            }
                            if (match.ah[1].ToString() != string.Empty)
                            {
                                item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_HomeOddsString(match.ah[3].ToString().Trim());
                                item.set_FT_AwayOddsString(match.ah[5].ToString().Trim());
                            }
                            if (match.ou[1].ToString() != string.Empty)
                            {
                                item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_OverOddsString(match.ou[3].ToString().Trim());
                                item.set_FT_UnderOddsString(match.ou[5].ToString().Trim());
                            }
                            if (flag1)
                            {
                                if (match.ah1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_HomeOddsString(match.ah1st[3].ToString().Trim());
                                    item.set_Half_AwayOddsString(match.ah1st[5].ToString().Trim());
                                }
                                if (match.ou1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_OverOddsString(match.ou1st[3].ToString().Trim());
                                    item.set_Half_UnderOddsString(match.ou1st[5].ToString().Trim());
                                }
                            }
                            if (match.info[11].ToString() == "1")
                            {
                                blue = Color.Red;
                                red = Color.Blue;
                            }
                            else
                            {
                                blue = Color.Blue;
                                red = Color.Red;
                            }
                            if (item.get_FTHDP() == "0.0")
                            {
                                item.set_FTHomeColor(Color.Blue);
                                item.set_FTAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_FTHomeColor(blue);
                                item.set_FTAwayColor(red);
                            }
                            if (item.get_HalfHDP() == "0.0")
                            {
                                item.set_HalfHomeColor(Color.Blue);
                                item.set_HalfAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_HalfHomeColor(blue);
                                item.set_HalfAwayColor(red);
                            }
                            if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime()))
                            {
                                item.set_GameType(EnumCollection.eGameType.Early);
                            }
                            else
                            {
                                item.set_GameType(EnumCollection.eGameType.Today);
                            }
                            if (((item.get_GameType() == EnumCollection.eGameType.Today) & flag2) | ((item.get_GameType() == EnumCollection.eGameType.Early) & flag3))
                            {
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        item.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_AwayOdds()));
                                        item.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_HomeOdds()));
                                        item.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_OverOdds()));
                                        item.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_UnderOdds()));
                                        item.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_AwayOdds()));
                                        item.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_HomeOdds()));
                                        item.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_OverOdds()));
                                        item.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        item.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_AwayOdds()));
                                        item.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_HomeOdds()));
                                        item.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_OverOdds()));
                                        item.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_UnderOdds()));
                                        item.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_AwayOdds()));
                                        item.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_HomeOdds()));
                                        item.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_OverOdds()));
                                        item.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        item.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_AwayOdds()));
                                        item.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_HomeOdds()));
                                        item.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_OverOdds()));
                                        item.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_UnderOdds()));
                                        item.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_AwayOdds()));
                                        item.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_HomeOdds()));
                                        item.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_OverOdds()));
                                        item.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_UnderOdds()));
                                        break;
                                }
                                list2.Add(item);
                            }
                            if (match.child == null)
                            {
                                continue;
                            }
                            MatchNew new3 = new MatchNew();
                            JsonMatch child = match.child;
                            new3.set_Website(item.get_Website());
                            new3.set_Type(item.get_Type());
                            new3.set_SportType(item.get_SportType());
                            new3.set_League(item.get_League());
                            new3.set_HomeName(item.get_HomeName());
                            new3.set_AwayName(item.get_AwayName());
                            new3.set_HomeScore(item.get_HomeScore());
                            new3.set_AwayScore(item.get_AwayScore());
                            new3.set_GameType(item.get_GameType());
                            new3.set_RunningStatus(item.get_RunningStatus());
                            new3.set_FTHomeColor(item.get_FTHomeColor());
                            new3.set_FTAwayColor(item.get_FTAwayColor());
                            new3.set_HalfHomeColor(item.get_HalfHomeColor());
                            new3.set_HalfAwayColor(item.get_HalfAwayColor());
                            new3.set_RunningMinutes(item.get_RunningMinutes());
                            new3.set_MatchTime(item.get_MatchTime());
                            new3.set_FT_ID(Conversions.ToString(child.info[0]));
                            new3.set_Half_ID(new3.get_FT_ID());
                            new3.set_UniqueID(new3.get_FT_ID());
                            if (child.ah[1].ToString() != string.Empty)
                            {
                                new3.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ah[1].ToString().Replace("/", "-").Trim()));
                                new3.set_FT_HomeOddsString(child.ah[3].ToString().Trim());
                                new3.set_FT_AwayOddsString(child.ah[5].ToString().Trim());
                            }
                            if (child.ou[1].ToString() != string.Empty)
                            {
                                new3.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ou[1].ToString().Replace("/", "-").Trim()));
                                new3.set_FT_OverOddsString(child.ou[3].ToString().Trim());
                                new3.set_FT_UnderOddsString(child.ou[5].ToString().Trim());
                            }
                            if (flag1)
                            {
                                if (child.ah1st[1].ToString() != string.Empty)
                                {
                                    new3.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ah1st[1].ToString().Replace("/", "-").Trim()));
                                    new3.set_Half_HomeOddsString(child.ah1st[3].ToString().Trim());
                                    new3.set_Half_AwayOddsString(child.ah1st[5].ToString().Trim());
                                }
                                if (child.ou1st[1].ToString() != string.Empty)
                                {
                                    new3.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(child.ou1st[1].ToString().Replace("/", "-").Trim()));
                                    new3.set_Half_OverOddsString(child.ou1st[3].ToString().Trim());
                                    new3.set_Half_UnderOddsString(child.ou1st[5].ToString().Trim());
                                }
                                if (new3.get_FTHDP() == "0.0")
                                {
                                    new3.set_FTHomeColor(Color.Blue);
                                    new3.set_FTAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new3.set_FTHomeColor(blue);
                                    new3.set_FTAwayColor(red);
                                }
                                if (new3.get_HalfHDP() == "0.0")
                                {
                                    new3.set_HalfHomeColor(Color.Blue);
                                    new3.set_HalfAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new3.set_HalfHomeColor(blue);
                                    new3.set_HalfAwayColor(red);
                                }
                            }
                            if (!(((new3.get_GameType() == EnumCollection.eGameType.Today) & flag2) | ((new3.get_GameType() == EnumCollection.eGameType.Early) & flag3)))
                            {
                                continue;
                            }
                            switch (base._objBetOddsType)
                            {
                                case EnumCollection.eOddsType.HK:
                                    new3.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_AwayOdds()));
                                    new3.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_HomeOdds()));
                                    new3.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_OverOdds()));
                                    new3.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_UnderOdds()));
                                    new3.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_AwayOdds()));
                                    new3.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_HomeOdds()));
                                    new3.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_OverOdds()));
                                    new3.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new3.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Euro:
                                    new3.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_AwayOdds()));
                                    new3.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_HomeOdds()));
                                    new3.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_OverOdds()));
                                    new3.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_UnderOdds()));
                                    new3.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_AwayOdds()));
                                    new3.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_HomeOdds()));
                                    new3.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_OverOdds()));
                                    new3.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new3.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Indo:
                                    new3.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_AwayOdds()));
                                    new3.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_HomeOdds()));
                                    new3.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_OverOdds()));
                                    new3.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_UnderOdds()));
                                    new3.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_AwayOdds()));
                                    new3.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_HomeOdds()));
                                    new3.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_OverOdds()));
                                    new3.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new3.get_Half_UnderOdds()));
                                    break;
                            }
                            list2.Add(new3);
                            continue;
                        }
                        if ((match.info.Count == 0x13) & flag4)
                        {
                            item.set_League(match.info[5].ToString().Trim());
                            item.set_HomeName(match.info[9].ToString().Trim());
                            item.set_AwayName(match.info[11].ToString().Trim());
                            item.set_GameType(EnumCollection.eGameType.Running);
                            item.set_HomeScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(match.info[13]))));
                            item.set_AwayScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(match.info[14]))));
                            if (match.info[1].ToString() == "ht")
                            {
                                item.set_RunningMinutes(0x2d);
                                item.set_RunningStatus(EnumCollection.eRunningStatus.HT);
                            }
                            else
                            {
                                if (match.info[1].ToString().Length == 1)
                                {
                                    item.set_RunningMinutes((int) Math.Round(Conversion.Val("0" + match.info[1].ToString())));
                                }
                                else
                                {
                                    item.set_RunningMinutes((int) Math.Round(Conversion.Val(match.info[1].ToString())));
                                }
                                item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                            }
                            list3 = CommonFunction.SeperateStringBySymbol(match.info[7].ToString().Trim(), " ");
                            if ((list3.Count == 2) && (match.info[8].ToString().Trim().Length == 5))
                            {
                                time4 = DateTime.Now;
                                now = new DateTime(time4.Year, CommonFunction.ConvertMonthName3CharToNumber(list3[1].ToString().Trim()), (int) Math.Round(Conversion.Val(list3[0].ToString().Trim())), (int) Math.Round(Conversion.Val(match.info[8].ToString().Substring(0, 2))), (int) Math.Round(Conversion.Val(match.info[8].ToString().Substring(3, 2))), 0);
                                item.set_MatchTime(now);
                            }
                            if (match.rb[1].ToString() != string.Empty)
                            {
                                item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rb[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_HomeOddsString(match.rb[3].ToString().Trim());
                                item.set_FT_AwayOddsString(match.rb[5].ToString().Trim());
                            }
                            if (match.rbou[1].ToString() != string.Empty)
                            {
                                item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rbou[1].ToString().Replace("/", "-").Trim()));
                                item.set_FT_OverOddsString(match.rbou[3].ToString().Trim());
                                item.set_FT_UnderOddsString(match.rbou[5].ToString().Trim());
                            }
                            if (flag1)
                            {
                                if (match.rb1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rb1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_HomeOddsString(match.rb1st[3].ToString().Trim());
                                    item.set_Half_AwayOddsString(match.rb1st[5].ToString().Trim());
                                }
                                if (match.rbou1st[1].ToString() != string.Empty)
                                {
                                    item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.rbou1st[1].ToString().Replace("/", "-").Trim()));
                                    item.set_Half_OverOddsString(match.rbou1st[3].ToString().Trim());
                                    item.set_Half_UnderOddsString(match.rbou1st[5].ToString().Trim());
                                }
                            }
                            if (match.info[12].ToString() == "1")
                            {
                                blue = Color.Red;
                                red = Color.Blue;
                            }
                            else
                            {
                                blue = Color.Blue;
                                red = Color.Red;
                            }
                            if (item.get_FTHDP() == "0.0")
                            {
                                item.set_FTHomeColor(Color.Blue);
                                item.set_FTAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_FTHomeColor(blue);
                                item.set_FTAwayColor(red);
                            }
                            if (item.get_HalfHDP() == "0.0")
                            {
                                item.set_HalfHomeColor(Color.Blue);
                                item.set_HalfAwayColor(Color.Blue);
                            }
                            else
                            {
                                item.set_HalfHomeColor(blue);
                                item.set_HalfAwayColor(red);
                            }
                            switch (base._objBetOddsType)
                            {
                                case EnumCollection.eOddsType.HK:
                                    item.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_AwayOdds()));
                                    item.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_HomeOdds()));
                                    item.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_OverOdds()));
                                    item.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_UnderOdds()));
                                    item.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_AwayOdds()));
                                    item.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_HomeOdds()));
                                    item.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_OverOdds()));
                                    item.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Euro:
                                    item.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_AwayOdds()));
                                    item.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_HomeOdds()));
                                    item.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_OverOdds()));
                                    item.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_UnderOdds()));
                                    item.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_AwayOdds()));
                                    item.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_HomeOdds()));
                                    item.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_OverOdds()));
                                    item.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_UnderOdds()));
                                    break;

                                case EnumCollection.eOddsType.Indo:
                                    item.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_AwayOdds()));
                                    item.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_HomeOdds()));
                                    item.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_OverOdds()));
                                    item.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_UnderOdds()));
                                    item.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_AwayOdds()));
                                    item.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_HomeOdds()));
                                    item.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_OverOdds()));
                                    item.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_UnderOdds()));
                                    break;
                            }
                            list2.Add(item);
                            if (match.child != null)
                            {
                                MatchNew new4 = new MatchNew();
                                JsonMatch match3 = match.child;
                                new4.set_Website(item.get_Website());
                                new4.set_Type(item.get_Type());
                                new4.set_SportType(item.get_SportType());
                                new4.set_League(item.get_League());
                                new4.set_HomeName(item.get_HomeName());
                                new4.set_AwayName(item.get_AwayName());
                                new4.set_HomeScore(item.get_HomeScore());
                                new4.set_AwayScore(item.get_AwayScore());
                                new4.set_GameType(item.get_GameType());
                                new4.set_RunningStatus(item.get_RunningStatus());
                                new4.set_FTHomeColor(item.get_FTHomeColor());
                                new4.set_FTAwayColor(item.get_FTAwayColor());
                                new4.set_HalfHomeColor(item.get_HalfHomeColor());
                                new4.set_HalfAwayColor(item.get_HalfAwayColor());
                                new4.set_RunningMinutes(item.get_RunningMinutes());
                                new4.set_MatchTime(item.get_MatchTime());
                                new4.set_FT_ID(Conversions.ToString(match3.info[0]));
                                new4.set_Half_ID(new4.get_FT_ID());
                                new4.set_UniqueID(new4.get_FT_ID());
                                if (match3.rb[1].ToString() != string.Empty)
                                {
                                    new4.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rb[1].ToString().Replace("/", "-").Trim()));
                                    new4.set_FT_HomeOddsString(match3.rb[3].ToString().Trim());
                                    new4.set_FT_AwayOddsString(match3.rb[5].ToString().Trim());
                                }
                                if (match3.rbou[1].ToString() != string.Empty)
                                {
                                    new4.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rbou[1].ToString().Replace("/", "-").Trim()));
                                    new4.set_FT_OverOddsString(match3.rbou[3].ToString().Trim());
                                    new4.set_FT_UnderOddsString(match3.rbou[5].ToString().Trim());
                                }
                                if (flag1)
                                {
                                    if (match3.rb1st[1].ToString() != string.Empty)
                                    {
                                        new4.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rb1st[1].ToString().Replace("/", "-").Trim()));
                                        new4.set_Half_HomeOddsString(match3.rb1st[3].ToString().Trim());
                                        new4.set_Half_AwayOddsString(match3.rb1st[5].ToString().Trim());
                                    }
                                    if (match3.rbou1st[1].ToString() != string.Empty)
                                    {
                                        new4.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match3.rbou1st[1].ToString().Replace("/", "-").Trim()));
                                        new4.set_Half_OverOddsString(match3.rbou1st[3].ToString().Trim());
                                        new4.set_Half_UnderOddsString(match3.rbou1st[5].ToString().Trim());
                                    }
                                }
                                if (new4.get_FTHDP() == "0.0")
                                {
                                    new4.set_FTHomeColor(Color.Blue);
                                    new4.set_FTAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new4.set_FTHomeColor(blue);
                                    new4.set_FTAwayColor(red);
                                }
                                if (new4.get_HalfHDP() == "0.0")
                                {
                                    new4.set_HalfHomeColor(Color.Blue);
                                    new4.set_HalfAwayColor(Color.Blue);
                                }
                                else
                                {
                                    new4.set_HalfHomeColor(blue);
                                    new4.set_HalfAwayColor(red);
                                }
                                switch (base._objBetOddsType)
                                {
                                    case EnumCollection.eOddsType.HK:
                                        new4.set_FT_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_AwayOdds()));
                                        new4.set_FT_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_HomeOdds()));
                                        new4.set_FT_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_OverOdds()));
                                        new4.set_FT_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_UnderOdds()));
                                        new4.set_Half_AwayOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_AwayOdds()));
                                        new4.set_Half_HomeOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_HomeOdds()));
                                        new4.set_Half_OverOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_OverOdds()));
                                        new4.set_Half_UnderOdds(SportBookFunction.ConvertHKToMalayOdds(new4.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Euro:
                                        new4.set_FT_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_AwayOdds()));
                                        new4.set_FT_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_HomeOdds()));
                                        new4.set_FT_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_OverOdds()));
                                        new4.set_FT_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_UnderOdds()));
                                        new4.set_Half_AwayOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_AwayOdds()));
                                        new4.set_Half_HomeOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_HomeOdds()));
                                        new4.set_Half_OverOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_OverOdds()));
                                        new4.set_Half_UnderOdds(SportBookFunction.ConvertEuroToMalayOdds(new4.get_Half_UnderOdds()));
                                        break;

                                    case EnumCollection.eOddsType.Indo:
                                        new4.set_FT_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_AwayOdds()));
                                        new4.set_FT_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_HomeOdds()));
                                        new4.set_FT_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_OverOdds()));
                                        new4.set_FT_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_UnderOdds()));
                                        new4.set_Half_AwayOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_AwayOdds()));
                                        new4.set_Half_HomeOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_HomeOdds()));
                                        new4.set_Half_OverOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_OverOdds()));
                                        new4.set_Half_UnderOdds(SportBookFunction.ConvertIndoToMalayOdds(new4.get_Half_UnderOdds()));
                                        break;
                                }
                                list2.Add(new4);
                            }
                        }
                    }
                }
                finally
                {
                    enumerator.Dispose();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list2;
        }
Exemplo n.º 2
0
 public List<MatchNew> GenerateFullOddsFromText(string text1, bool flag1, bool flag2, bool flag3, bool flag4)
 {
     ArrayList list2 = new ArrayList();
     string str2 = "";
     int num2 = 0;
     List<MatchNew> list3 = new List<MatchNew>();
     int hour = 0;
     DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now));
     while (num2 > -1)
     {
         str2 = CommonFunction.substring(text1, num2, "Array('", "');", ref num2);
         if (str2 != string.Empty)
         {
             list2 = CommonFunction.SeperateStringBySymbol(str2, "','");
             if (list2.Count >= 0x1c)
             {
                 MatchNew item = new MatchNew();
                 item.set_FT_ID(Conversions.ToString(list2[0]));
                 item.set_UniqueID(item.get_FT_ID());
                 if (list2[1].ToString().ToLower().Contains("h/t"))
                 {
                     item.set_RunningMinutes(0x2d);
                     item.set_RunningStatus(EnumCollection.eRunningStatus.HT);
                     item.set_GameType(EnumCollection.eGameType.Running);
                     item.set_MatchTime(DateTime.Now);
                 }
                 else if (list2[1].ToString().Length <= 2)
                 {
                     item.set_RunningMinutes((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list2[1]))));
                     item.set_RunningStatus(EnumCollection.eRunningStatus.Running);
                     item.set_GameType(EnumCollection.eGameType.Running);
                     item.set_MatchTime(DateTime.Now);
                 }
                 else if (list2[1].ToString().Length >= 15)
                 {
                     hour = (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(9, 2)));
                     if ((list2[1].ToString().Substring(14, 1).ToLower() == "p") && ((hour >= 1) & (hour <= 11)))
                     {
                         hour += 12;
                     }
                     DateTime time3 = new DateTime(DateTime.Now.Year, (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(0, 2))), (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(3, 2))), hour, (int) Math.Round(Conversion.Val(list2[1].ToString().Substring(12, 2))), 0);
                     item.set_MatchTime(time3);
                     item.set_RunningStatus(EnumCollection.eRunningStatus.DeadBall);
                     item.set_GameType(EnumCollection.eGameType.Today);
                 }
                 if (item.get_GameType() != EnumCollection.eGameType.Running)
                 {
                     if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime()))
                     {
                         item.set_GameType(EnumCollection.eGameType.Early);
                     }
                 }
                 else
                 {
                     item.set_HomeScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list2[0x12]))));
                     item.set_AwayScore((int) Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list2[0x13]))));
                 }
                 if (((item.get_GameType() == EnumCollection.eGameType.Running) & flag1) | ((item.get_GameType() != EnumCollection.eGameType.Running) & (flag2 | flag3)))
                 {
                     item.set_League(Conversions.ToString(list2[2]));
                     if (base._objLeagueListSelected.get_IsSelectAll() | this.IsLeagueExistedInSelectedList(item.get_League()))
                     {
                         int num3;
                         item.set_FTHDP_ID(Conversions.ToString(list2[3]));
                         item.set_FTOU_ID(Conversions.ToString(list2[4]));
                         item.set_HomeName(Conversions.ToString(list2[5]));
                         if (item.get_HomeName().Contains("/font"))
                         {
                             num3 = 0;
                             item.set_HomeName(CommonFunction.substring(item.get_HomeName(), 0, ">", "<", ref num3));
                         }
                         item.set_AwayName(Conversions.ToString(list2[6]));
                         if (item.get_AwayName().Contains("/font"))
                         {
                             num3 = 0;
                             item.set_AwayName(CommonFunction.substring(item.get_AwayName(), 0, ">", "<", ref num3));
                         }
                         item.set_FTHDP(Conversions.ToString(list2[8]));
                         if (item.get_FTHDP() != string.Empty)
                         {
                             item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_FTHDP().Replace(" ", "").Replace("/", "-")));
                         }
                         if (item.get_FTHDP() == "0.0")
                         {
                             item.set_FTAwayColor(Color.Blue);
                             item.set_FTHomeColor(Color.Blue);
                         }
                         else if (Operators.ConditionalCompareObjectEqual(list2[7], "H", false))
                         {
                             item.set_FTAwayColor(Color.Blue);
                             item.set_FTHomeColor(Color.Red);
                         }
                         else
                         {
                             item.set_FTAwayColor(Color.Red);
                             item.set_FTHomeColor(Color.Blue);
                         }
                         item.set_HalfAwayColor(item.get_FTAwayColor());
                         item.set_HalfHomeColor(item.get_FTHomeColor());
                         object[] arguments = new object[1];
                         ArrayList list4 = list2;
                         num3 = 9;
                         arguments[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         object[] objArray2 = arguments;
                         bool[] copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(objArray2[0]);
                         }
                         item.set_FT_HomeOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", objArray2, null, null, copyBack)));
                         objArray2 = new object[1];
                         list4 = list2;
                         num3 = 10;
                         objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         arguments = objArray2;
                         copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                         }
                         item.set_FT_AwayOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                         if (item.get_GameType() == EnumCollection.eGameType.Running)
                         {
                             item.set_FT_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_re.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                             item.set_FT_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_re.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                         }
                         else
                         {
                             item.set_FT_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_r.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                             item.set_FT_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_r.php?gid=" + item.get_FT_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[7]), "&odd_f_type="), this._strOddFType)));
                         }
                         item.set_FTOU(Conversions.ToString(list2[11]));
                         if (item.get_FTOU() != string.Empty)
                         {
                             item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_FTOU().Substring(1, item.get_FTOU().Length - 1).Replace(" ", "").Replace("/", "-")));
                         }
                         objArray2 = new object[1];
                         list4 = list2;
                         num3 = 13;
                         objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         arguments = objArray2;
                         copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                         }
                         item.set_FT_UnderOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                         objArray2 = new object[1];
                         list4 = list2;
                         num3 = 14;
                         objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                         arguments = objArray2;
                         copyBack = new bool[] { true };
                         if (copyBack[0])
                         {
                             list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                         }
                         item.set_FT_OverOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                         if (item.get_GameType() == EnumCollection.eGameType.Running)
                         {
                             item.set_FT_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_rou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                             item.set_FT_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_rou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                         }
                         else
                         {
                             item.set_FT_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_ou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                             item.set_FT_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_ou.php?gid=" + item.get_FT_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                         }
                         if (flag4)
                         {
                             if ((item.get_GameType() == EnumCollection.eGameType.Running) | (list2.Count == 0x2b))
                             {
                                 item.set_GameType(EnumCollection.eGameType.Running);
                                 item.set_Half_ID(Conversions.ToString(list2[20]));
                                 item.set_HalfHDP(Conversions.ToString(list2[0x16]));
                                 if (item.get_HalfHDP() != string.Empty)
                                 {
                                     item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfHDP().Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x17;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_HomeOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x18;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_AwayOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hre.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[0x15]), "&odd_f_type="), this._strOddFType)));
                                 item.set_Half_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hre.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[0x15]), "&odd_f_type="), this._strOddFType)));
                                 item.set_HalfOU(Conversions.ToString(list2[0x19]));
                                 if (item.get_HalfOU() != string.Empty)
                                 {
                                     item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfOU().Substring(1, item.get_HalfOU().Length - 1).Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1b;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_UnderOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1c;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_OverOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hrou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                                 item.set_Half_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hrou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                             }
                             else
                             {
                                 item.set_Half_ID(Conversions.ToString(list2[0x16]));
                                 item.set_HalfHDP(Conversions.ToString(list2[0x18]));
                                 if (item.get_HalfHDP() != string.Empty)
                                 {
                                     item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfHDP().Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x19;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_HomeOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1a;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_AwayOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_HomeBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hr.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=H" + "&gnum=") + item.get_FTHDP_ID() + "&strong=", list2[0x17]), "&odd_f_type="), this._strOddFType)));
                                 item.set_Half_AwayBetLink(Conversions.ToString(Operators.ConcatenateObject(Operators.ConcatenateObject(Operators.ConcatenateObject((((base._strRootURL + "/app/member/FT_order/FT_order_hr.php?gid=" + item.get_Half_ID()) + "&uid=" + this._strUID) + "&type=C" + "&gnum=") + item.get_FTOU_ID() + "&strong=", list2[0x17]), "&odd_f_type="), this._strOddFType)));
                                 item.set_HalfOU(Conversions.ToString(list2[0x1b]));
                                 if (item.get_HalfOU() != string.Empty)
                                 {
                                     item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(item.get_HalfOU().Substring(1, item.get_HalfOU().Length - 1).Replace(" ", "").Replace("/", "-")));
                                 }
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 0x1d;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_UnderOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 objArray2 = new object[1];
                                 list4 = list2;
                                 num3 = 30;
                                 objArray2[0] = RuntimeHelpers.GetObjectValue(list4[num3]);
                                 arguments = objArray2;
                                 copyBack = new bool[] { true };
                                 if (copyBack[0])
                                 {
                                     list4[num3] = RuntimeHelpers.GetObjectValue(arguments[0]);
                                 }
                                 item.set_Half_OverOddsString(Conversions.ToString(NewLateBinding.LateGet(null, typeof(SportBookFunction), "ConvertHKToMalayOdds", arguments, null, null, copyBack)));
                                 item.set_Half_UnderBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=H&gnum=" + item.get_FTHDP_ID() + "&odd_f_type=" + this._strOddFType);
                                 item.set_Half_OverBetLink(base._strRootURL + "/app/member/FT_order/FT_order_hou.php?gid=" + item.get_Half_ID() + "&uid=" + this._strUID + "&type=C&gnum=" + item.get_FTOU_ID() + "&odd_f_type=" + this._strOddFType);
                             }
                         }
                         item.set_Website("SingBet");
                         item.set_Type(EnumCollection.eMatchType.Match);
                         item.set_GlobalLastUpdate(DateTime.Now);
                         list3.Add(item);
                     }
                 }
             }
         }
     }
     return list3;
 }
Exemplo n.º 3
0
        public List<MatchNew> GenerateFullOddsFromText(string text1, bool bb2, bool bb3, bool bb4, bool flag1)
        {
            List<MatchNew> list2 = new List<MatchNew>();
            EnumCollection.eOddsType malay = EnumCollection.eOddsType.Malay;
            string str2 = "";
            DateTime time2 = new DateTime();
            JsonPageList list3 = new JsonPageList();
            JsonPage current = new JsonPage();
            DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now));
            try
            {
                text1 = text1.Replace("\"1x2", "\"lx2");
                list3 = JsonConvert.DeserializeObject<JsonPageList>(text1);
                if ((list3 == null) || (list3.pages == null))
                {
                    return list2;
                }
                List<JsonPage>.Enumerator enumerator = list3.pages.GetEnumerator();
                try
                {
                    //enumerator;
                    while (enumerator.MoveNext())
                    {
                        current = enumerator.Current;
                        switch (current.otu.ToLower())
                        {
                            case "hk":
                                malay = EnumCollection.eOddsType.HK;
                                break;

                            case "malay":
                                malay = EnumCollection.eOddsType.Malay;
                                break;

                            case "indo":
                                malay = EnumCollection.eOddsType.Indo;
                                break;

                            case "euro":
                                malay = EnumCollection.eOddsType.Euro;
                                break;
                        }
                        if (current.events != null)
                        {
                            List<JsonMatch>.Enumerator enumerator2 = current.events.GetEnumerator();
                            try
                            {
                                //enumerator2;
                                while (enumerator2.MoveNext())
                                {
                                    JsonMatch match = enumerator2.Current;
                                    MatchNew item = new MatchNew();
                                    if (match.info.Count >= 0x13)
                                    {
                                        item.set_Type(EnumCollection.eMatchType.Match);
                                        item.set_Website("BW3388");
                                        if (match.info[5] != string.Empty)
                                        {
                                            str2 = match.info[5];
                                        }
                                        item.set_FT_ID(match.info[1]);
                                        item.set_Half_ID(match.info[1]);
                                        item.set_UniqueID(item.get_FT_ID() + "a");
                                        item.set_League(str2);
                                        item.set_HomeName(match.info[6]);
                                        item.set_AwayName(match.info[7]);
                                        if ((match.info[2].Length >= 5) & (match.info[3].Length >= 7))
                                        {
                                            bool flag;
                                            int year = DateTime.Now.Year;
                                            int num4 = (int) Math.Round(Conversion.Val(match.info[2].Substring(3, 2)));
                                            int num = (int) Math.Round(Conversion.Val(match.info[2].Substring(0, 2)));
                                            int num2 = (int) Math.Round(Conversion.Val(match.info[3].Substring(0, 2)));
                                            int num3 = (int) Math.Round(Conversion.Val(match.info[3].Substring(3, 2)));
                                            if (match.info[3].Substring(5, 2).ToLower() == "am")
                                            {
                                                flag = false;
                                            }
                                            else
                                            {
                                                flag = true;
                                            }
                                            time2 = CommonFunction.ConvertTimeToInternationalTime(year, num4, num, num2, num3, flag);
                                            if (match.info.Count >= 0x16)
                                            {
                                                item.set_GameType(EnumCollection.eGameType.Running);
                                                item.set_HomeScore((int) Math.Round(Conversion.Val(match.info[0x13])));
                                                item.set_AwayScore((int) Math.Round(Conversion.Val(match.info[20])));
                                                if (match.info[0x15].Length >= 4)
                                                {
                                                    item.set_RunningMinutes((int) Math.Round((double) (Conversion.Val(match.info[0x15].Substring(0, 1)) * Conversion.Val(match.info[0x15].Substring(3)))));
                                                }
                                            }
                                        }
                                    }
                                    item.set_MatchTime(time2);
                                    if (item.get_GameType() != EnumCollection.eGameType.Running)
                                    {
                                        if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime()))
                                        {
                                            item.set_GameType(EnumCollection.eGameType.Early);
                                        }
                                        else
                                        {
                                            item.set_GameType(EnumCollection.eGameType.Today);
                                        }
                                    }
                                    if (match.ah1.Count >= 8)
                                    {
                                        item.set_FTHDP_ID(match.ah1[7]);
                                        item.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah1[1].Replace("/", "-")));
                                        item.set_FT_HomeOddsString(match.ah1[2]);
                                        item.set_FT_AwayOddsString(match.ah1[3]);
                                        if (item.get_FTHDP() == "0.0")
                                        {
                                            item.set_FTHomeColor(Color.Blue);
                                            item.set_FTAwayColor(Color.Blue);
                                        }
                                        else if (match.ah1[4] == "b")
                                        {
                                            item.set_FTHomeColor(Color.Blue);
                                            item.set_FTAwayColor(Color.Red);
                                        }
                                        else
                                        {
                                            item.set_FTHomeColor(Color.Red);
                                            item.set_FTAwayColor(Color.Blue);
                                        }
                                        switch (malay)
                                        {
                                            case EnumCollection.eOddsType.HK:
                                                item.set_FT_HomeOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_HomeOddsString()));
                                                item.set_FT_AwayOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_AwayOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Euro:
                                                item.set_FT_HomeOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_HomeOddsString()));
                                                item.set_FT_AwayOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_AwayOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Indo:
                                                item.set_FT_HomeOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_HomeOddsString()));
                                                item.set_FT_AwayOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_AwayOddsString()));
                                                break;
                                        }
                                    }
                                    if (match.ou1.Count >= 7)
                                    {
                                        item.set_FTOU_ID(match.ou1[6]);
                                        item.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou1[1].Replace("/", "-")));
                                        item.set_FT_OverOddsString(match.ou1[2]);
                                        item.set_FT_UnderOddsString(match.ou1[3]);
                                        switch (malay)
                                        {
                                            case EnumCollection.eOddsType.HK:
                                                item.set_FT_OverOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_OverOddsString()));
                                                item.set_FT_UnderOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_FT_UnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Euro:
                                                item.set_FT_OverOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_OverOddsString()));
                                                item.set_FT_UnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_FT_UnderOddsString()));
                                                break;

                                            case EnumCollection.eOddsType.Indo:
                                                item.set_FT_OverOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_OverOddsString()));
                                                item.set_FT_UnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_FT_UnderOddsString()));
                                                break;
                                        }
                                    }
                                    if (flag1)
                                    {
                                        if (match.ahht1.Count >= 8)
                                        {
                                            item.set_HalfHDP_ID(match.ahht1[7]);
                                            item.set_HalfHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ahht1[1].Replace("/", "-")));
                                            item.set_Half_HomeOddsString(match.ahht1[2]);
                                            item.set_Half_AwayOddsString(match.ahht1[3]);
                                            if (item.get_HalfHDP() == "0.0")
                                            {
                                                item.set_HalfHomeColor(Color.Blue);
                                                item.set_HalfAwayColor(Color.Blue);
                                            }
                                            else if (match.ahht1[4] == "b")
                                            {
                                                item.set_HalfHomeColor(Color.Blue);
                                                item.set_HalfAwayColor(Color.Red);
                                            }
                                            else
                                            {
                                                item.set_HalfHomeColor(Color.Red);
                                                item.set_HalfAwayColor(Color.Blue);
                                            }
                                            switch (malay)
                                            {
                                                case EnumCollection.eOddsType.HK:
                                                    item.set_Half_HomeOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_HomeOddsString()));
                                                    item.set_Half_AwayOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_AwayOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Euro:
                                                    item.set_Half_HomeOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_HomeOddsString()));
                                                    item.set_Half_AwayOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_AwayOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Indo:
                                                    item.set_Half_HomeOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_HomeOddsString()));
                                                    item.set_Half_AwayOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_AwayOddsString()));
                                                    break;
                                            }
                                        }
                                        if (match.ouht1.Count >= 7)
                                        {
                                            item.set_HalfOU_ID(match.ouht1[6]);
                                            item.set_HalfOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ouht1[1].Replace("/", "-")));
                                            item.set_Half_OverOddsString(match.ouht1[2]);
                                            item.set_Half_UnderOddsString(match.ouht1[3]);
                                            switch (malay)
                                            {
                                                case EnumCollection.eOddsType.HK:
                                                    item.set_Half_OverOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_OverOddsString()));
                                                    item.set_Half_UnderOddsString(SportBookFunction.ConvertHKToMalayOdds(item.get_Half_UnderOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Euro:
                                                    item.set_Half_OverOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_OverOddsString()));
                                                    item.set_Half_UnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(item.get_Half_UnderOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Indo:
                                                    item.set_Half_OverOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_OverOddsString()));
                                                    item.set_Half_UnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(item.get_Half_UnderOddsString()));
                                                    break;
                                            }
                                        }
                                    }
                                    item.set_GlobalLastUpdate(DateTime.Now);
                                    list2.Add(item);
                                    if ((match.ah2.Count > 0) | (match.ou2.Count > 0))
                                    {
                                        MatchNew new3 = new MatchNew();
                                        new3.set_Type(EnumCollection.eMatchType.Match);
                                        new3.set_Website("BW3388");
                                        new3.set_FT_ID(item.get_FT_ID());
                                        new3.set_Half_ID(item.get_Half_ID());
                                        new3.set_UniqueID(item.get_FT_ID() + "b");
                                        new3.set_League(item.get_League());
                                        new3.set_HomeName(item.get_HomeName());
                                        new3.set_AwayName(item.get_AwayName());
                                        new3.set_AwayScore(item.get_AwayScore());
                                        new3.set_GameType(item.get_GameType());
                                        new3.set_MatchTime(item.get_MatchTime());
                                        new3.set_RunningMinutes(item.get_RunningMinutes());
                                        new3.set_RunningStatus(item.get_RunningStatus());
                                        if (match.ah2.Count >= 8)
                                        {
                                            new3.set_FTHDP_ID(match.ah2[7]);
                                            new3.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah2[1].Replace("/", "-")));
                                            new3.set_FT_HomeOddsString(match.ah2[2]);
                                            new3.set_FT_AwayOddsString(match.ah2[3]);
                                            if (new3.get_FTHDP() == "0.0")
                                            {
                                                new3.set_FTHomeColor(Color.Blue);
                                                new3.set_FTAwayColor(Color.Blue);
                                            }
                                            else if (match.ah2[4] == "b")
                                            {
                                                new3.set_FTHomeColor(Color.Blue);
                                                new3.set_FTAwayColor(Color.Red);
                                            }
                                            else
                                            {
                                                new3.set_FTHomeColor(Color.Red);
                                                new3.set_FTAwayColor(Color.Blue);
                                            }
                                            switch (malay)
                                            {
                                                case EnumCollection.eOddsType.HK:
                                                    new3.set_FT_HomeOddsString(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_HomeOddsString()));
                                                    new3.set_FT_AwayOddsString(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_AwayOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Euro:
                                                    new3.set_FT_HomeOddsString(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_HomeOddsString()));
                                                    new3.set_FT_AwayOddsString(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_AwayOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Indo:
                                                    new3.set_FT_HomeOddsString(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_HomeOddsString()));
                                                    new3.set_FT_AwayOddsString(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_AwayOddsString()));
                                                    break;
                                            }
                                        }
                                        if (match.ou2.Count >= 7)
                                        {
                                            new3.set_FTOU_ID(match.ou2[6]);
                                            new3.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou2[1].Replace("/", "-")));
                                            new3.set_FT_OverOddsString(match.ou2[2]);
                                            new3.set_FT_UnderOddsString(match.ou2[3]);
                                            switch (malay)
                                            {
                                                case EnumCollection.eOddsType.HK:
                                                    new3.set_FT_OverOddsString(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_OverOddsString()));
                                                    new3.set_FT_UnderOddsString(SportBookFunction.ConvertHKToMalayOdds(new3.get_FT_UnderOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Euro:
                                                    new3.set_FT_OverOddsString(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_OverOddsString()));
                                                    new3.set_FT_UnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(new3.get_FT_UnderOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Indo:
                                                    new3.set_FT_OverOddsString(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_OverOddsString()));
                                                    new3.set_FT_UnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(new3.get_FT_UnderOddsString()));
                                                    break;
                                            }
                                        }
                                        new3.set_GlobalLastUpdate(DateTime.Now);
                                        list2.Add(new3);
                                    }
                                    if ((match.ah3.Count > 0) | (match.ou3.Count > 0))
                                    {
                                        MatchNew new4 = new MatchNew();
                                        new4.set_Type(EnumCollection.eMatchType.Match);
                                        new4.set_Website("BW3388");
                                        new4.set_FT_ID(item.get_FT_ID());
                                        new4.set_Half_ID(item.get_Half_ID());
                                        new4.set_UniqueID(item.get_FT_ID() + "c");
                                        new4.set_League(item.get_League());
                                        new4.set_HomeName(item.get_HomeName());
                                        new4.set_AwayName(item.get_AwayName());
                                        new4.set_AwayScore(item.get_AwayScore());
                                        new4.set_GameType(item.get_GameType());
                                        new4.set_MatchTime(item.get_MatchTime());
                                        new4.set_RunningMinutes(item.get_RunningMinutes());
                                        new4.set_RunningStatus(item.get_RunningStatus());
                                        if (match.ah3.Count >= 8)
                                        {
                                            new4.set_FTHDP_ID(match.ah3[7]);
                                            new4.set_FTHDP(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ah3[1].Replace("/", "-")));
                                            new4.set_FT_HomeOddsString(match.ah3[2]);
                                            new4.set_FT_AwayOddsString(match.ah3[3]);
                                            if (new4.get_FTHDP() == "0.0")
                                            {
                                                new4.set_FTHomeColor(Color.Blue);
                                                new4.set_FTAwayColor(Color.Blue);
                                            }
                                            else if (match.ah3[4] == "b")
                                            {
                                                new4.set_FTHomeColor(Color.Blue);
                                                new4.set_FTAwayColor(Color.Red);
                                            }
                                            else
                                            {
                                                new4.set_FTHomeColor(Color.Red);
                                                new4.set_FTAwayColor(Color.Blue);
                                            }
                                            switch (malay)
                                            {
                                                case EnumCollection.eOddsType.HK:
                                                    new4.set_FT_HomeOddsString(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_HomeOddsString()));
                                                    new4.set_FT_AwayOddsString(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_AwayOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Euro:
                                                    new4.set_FT_HomeOddsString(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_HomeOddsString()));
                                                    new4.set_FT_AwayOddsString(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_AwayOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Indo:
                                                    new4.set_FT_HomeOddsString(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_HomeOddsString()));
                                                    new4.set_FT_AwayOddsString(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_AwayOddsString()));
                                                    break;
                                            }
                                        }
                                        if (match.ou3.Count >= 7)
                                        {
                                            new4.set_FTOU_ID(match.ou3[6]);
                                            new4.set_FTOU(SportBookFunction.ConvertHDPDashedTypeWithZero(match.ou3[1].Replace("/", "-")));
                                            new4.set_FT_OverOddsString(match.ou3[2]);
                                            new4.set_FT_UnderOddsString(match.ou3[3]);
                                            switch (malay)
                                            {
                                                case EnumCollection.eOddsType.HK:
                                                    new4.set_FT_OverOddsString(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_OverOddsString()));
                                                    new4.set_FT_UnderOddsString(SportBookFunction.ConvertHKToMalayOdds(new4.get_FT_UnderOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Euro:
                                                    new4.set_FT_OverOddsString(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_OverOddsString()));
                                                    new4.set_FT_UnderOddsString(SportBookFunction.ConvertEuroToMalayOdds(new4.get_FT_UnderOddsString()));
                                                    break;

                                                case EnumCollection.eOddsType.Indo:
                                                    new4.set_FT_OverOddsString(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_OverOddsString()));
                                                    new4.set_FT_UnderOddsString(SportBookFunction.ConvertIndoToMalayOdds(new4.get_FT_UnderOddsString()));
                                                    break;
                                            }
                                        }
                                        new4.set_GlobalLastUpdate(DateTime.Now);
                                        list2.Add(new4);
                                    }
                                }
                                continue;
                            }
                            finally
                            {
                                enumerator2.Dispose();
                            }
                        }
                    }
                }
                finally
                {
                    enumerator.Dispose();
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception.Message);
                this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception.Message);
                ProjectData.ClearProjectError();
            }
            return list2;
        }