public AgentToClientBet(MatchBetNew new1, MatchNew new2, EnumCollection.eBetAmountStyle style1, int num1, int num2, string text1, FollowOddsOption option1) { this._intMaxBettingAttempt = 5; this._objBetAmountStyle = EnumCollection.eBetAmountStyle.Fixed; this._intBetAmountValue = 0; this._objMatchBet = new MatchBetNew(); this._objMatchClient = new MatchNew(); this._intBettingAttempt = 0; this._intBetSuccessCount = 0; this._intTargetAmount = 0; this._intBettedAmount = 0; this._intLastBetSuccessAmount = 0; this._isRemoved = false; this._strMeaningfulStatus = ""; this._strActionStatus = ""; this._isWaitingReset = false; this._objFollowOddsOption = new FollowOddsOption(); this._objMatchBet = new1; this._objMatchClient = new2; this._objBetAmountStyle = style1; this._intBetAmountValue = num1; this._intMaxBettingAttempt = num2; this._strActionStatus = text1; this._objFollowOddsOption = option1; this.UpdateTargetAmount(); }
public void Bet(string text1, MatchBetNew new2, MatchNew new1, EnumCollection.eBetTarget target1) { try { string requestUriString = ""; base._isBetting = true; base._datBetStart = DateTime.Now; requestUriString = base._strRootURL + text1; CommonFunction.Log(requestUriString); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x4e20; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/english/index.php?p=betting_entry"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = 0L; WebRequestStateEx2 state = new WebRequestStateEx2("Bet", request, "", EnumCollection.eBetType.HDP, target1, new1, null, null, new2); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteBet), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN Bet: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN Bet: " + exception.Message); this.RaiseEventBetComplete(base._strName, false, new1, new2); ProjectData.ClearProjectError(); } }
public void Bet(string text2, string text3, string text1, MatchBetNew new2, MatchNew new1, EnumCollection.eBetTarget target1) { try { string requestUriString = ""; requestUriString = base._strRootURL + text1; this.WriteProgramLogger(requestUriString); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x4e20; request.Method = "POST"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Headers.Add("Accept-Language", "en-us"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.ContentType = "application/x-www-form-urlencoded"; request.KeepAlive = true; request.Referer = text2; request.ContentLength = text3.Length; request.AllowAutoRedirect = true; request.Headers["Cookie"] = base._objCookieList.ToString(); WebRequestStateEx2 state = new WebRequestStateEx2("Bet", request, text3, EnumCollection.eBetType.HDP, target1, new1, null, null, new2); ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.ReadCallBackBet), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x4e20, true); base.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN Bet: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN Bet: " + exception.Message); this.RaiseEventBetComplete(base._strName, false, new1, new2); ProjectData.ClearProjectError(); } }
public void Bet(string text1, MatchBetNew new2, MatchNew new1, EnumCollection.eBetTarget target1) { try { base._isBetting = true; base._datBetStart = DateTime.Now; HttpWebRequest request = (HttpWebRequest)WebRequest.Create(base._strRootURL + "/underover/confirm_bet_data.aspx"); request.Timeout = 0x7530; request.Method = "POST"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/LeftAllInOne.aspx"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = text1.Length; this.WriteProgramLogger("TWESTESST3.0: " + request.Address.ToString()); // Aorta Stream stream = request.GetRequestStream(); byte[] bytes = Encoding.UTF8.GetBytes(text1); stream.Write(bytes, 0, text1.Length); stream.Close(); this.WriteProgramLogger("TWESTESST3.1: " + request.Address.ToString()); WebRequestStateEx2 state = new WebRequestStateEx2("Bet", request, text1, EnumCollection.eBetType.HDP, target1, new1, new2, new1, new2); ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteBet), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true); base.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN Bet: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN Bet: " + exception.Message); this.RaiseEventBetComplete(base._strName, false, new1, new2); this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new2); ProjectData.ClearProjectError(); } }
public WebRequestStateEx2(string text2, WebRequest request1, string text1, EnumCollection.eBetType type1, EnumCollection.eBetTarget target1, MatchNew new4, MatchBetNew new2, MatchNew new3, MatchBetNew new1) { this._strTitle = ""; this._strPost = ""; this._intBetAmount = 0; this._objBetType = EnumCollection.eBetType.HDP; this._objBetTarget = EnumCollection.eBetTarget.FT_Home; this._objMatchParentSite = new MatchNew(); this._objMatchBetParentSite = new MatchBetNew(); this._objMatchChildSite = new MatchNew(); this._objMatchBetChildSite = new MatchBetNew(); this._objMatchBetChildSite = new1; this._objMatchBetParentSite = new2; this._objMatchChildSite = new3; this._objMatchParentSite = new4; this._objRequest = request1; this._strPost = text1; this._strTitle = text2; this._objBetType = type1; this._objBetTarget = target1; this._intBetAmount = Conversions.ToInteger(new1.get_BetAmount()); }
public WebRequestStateEx2(string text2, WebRequest request1, string text1, int num1, EnumCollection.eBetType type1, EnumCollection.eBetTarget target1, MatchNew new4, MatchBetNew new2, MatchNew new3, MatchBetNew new1, AgentToClientBet bet1) { this._strTitle = ""; this._strPost = ""; this._intBetAmount = 0; this._objBetType = EnumCollection.eBetType.HDP; this._objBetTarget = EnumCollection.eBetTarget.FT_Home; this._objMatchParentSite = new MatchNew(); this._objMatchBetParentSite = new MatchBetNew(); this._objMatchChildSite = new MatchNew(); this._objMatchBetChildSite = new MatchBetNew(); this._objMatchBetChildSite = new1; this._objMatchBetParentSite = new2; this._objMatchChildSite = new3; this._objMatchParentSite = new4; this._objRequest = request1; this._strPost = text1; this._strTitle = text2; this._objBetType = type1; this._objBetTarget = target1; this._intBetAmount = num1; this._objAgentToClientBet = bet1; }
public List<MatchNew> GenerateFullOddsFromText1004(string text, bool flag3, bool flag4, bool flag2, bool flag1, EnumCollection.eGameType type1) { List<MatchNew> list2 = new List<MatchNew>(); int[] numArray = new int[] { -1, -1, -1, -1 }; MatchNew item = new MatchNew(); string str8 = ""; string str7 = ""; string str2 = ""; string str3 = ""; string str = ""; string str5 = ""; string str4 = ""; int num3 = 0; EnumCollection.eRunningStatus deadBall = EnumCollection.eRunningStatus.DeadBall; int num2 = 0; int num = 0; DateTime time2 = new DateTime(); string text1 = string.Empty; try { if (string.IsNullOrEmpty(text)) { return list2; } text1 = text.Replace("[,", "['',").Replace("[.","['',").Replace(",]", ",'']").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>(); item = new MatchNew(); while (reader.Read()) { if (reader.TokenType != JsonToken.StartArray) { goto Label_089E; } num5 = 1; numArray[num5]++; list3 = new List<string>(); Label_0890: while (reader.Read()) { if (reader.TokenType == JsonToken.StartArray) { num5 = 2; numArray[num5]++; list3 = new List<string>(); while (reader.Read()) { string str10; if (reader.TokenType != JsonToken.EndArray) { goto Label_07ED; } numArray[3] = -1; if (((numArray[1] == 1) & (numArray[2] == 0)) & (list3.Count >= 9)) { str2 = list3[0].Trim(); str3 = list3[1].Trim(); str = list3[2].Trim(); if (list3[6].Trim() == "0") { deadBall = EnumCollection.eRunningStatus.DeadBall; } else { deadBall = EnumCollection.eRunningStatus.Running; } str8 = list3[5].Replace("</span>", "").Trim(); if (str8 != string.Empty) { DateTime time; if (str8.Contains("/")) { if (str8.Length >= 0x10) { string str9 = str8.Substring(11, 5); time = new DateTime((int)Math.Round(Conversion.Val(str8.Substring(6, 4))), (int)Math.Round(Conversion.Val(str8.Substring(0, 2))), (int)Math.Round(Conversion.Val(str8.Substring(3, 2))), (int)Math.Round(Conversion.Val(str9.Substring(0, 2))), (int)Math.Round(Conversion.Val(str9.Substring(3, 2))), 0); time2 = time; } } else { time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, (int)Math.Round(Conversion.Val(str8.Substring(0, 2))), (int)Math.Round(Conversion.Val(str8.Substring(3, 2))), 0); int num4 = (int)Math.Round(time.Subtract(DateTime.Now).TotalMinutes); if (((DateTime.Now.Hour >= 12) & (DateTime.Now.Hour <= 0x17)) && ((time.Hour >= 0) & (time.Hour <= 11))) { time = time.AddDays(1.0); } time2 = time; } } } 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) { switch (list3.Count) { case 3: if (list3[0] != string.Empty) { str7 = list3[0]; } goto Label_0890; case 4: goto Label_0890; case 5: if (list3[0] != "3") { goto Label_06CE; } item.set_FTOU_ID(list3[1]); item.set_FT_OverOddsString(list3[2]); item.set_FT_UnderOddsString(list3[3]); item.set_FTOU(list3[4]); goto Label_0890; case 6: if (list3[0] != "1") { goto Label_05A2; } item.set_FTHDP_ID(list3[1]); item.set_FT_HomeOddsString(list3[2]); item.set_FT_AwayOddsString(list3[3]); item.set_FTHDP(list3[4]); str10 = list3[5]; if (str10 != "2") { goto Label_0558; } item.set_FTHomeColor(Color.Blue); item.set_FTAwayColor(Color.Red); goto Label_0890; } } goto Label_0890; Label_0558: if (str10 == "1") { item.set_FTHomeColor(Color.Red); item.set_FTAwayColor(Color.Blue); } else { item.set_FTHomeColor(Color.Blue); item.set_FTAwayColor(Color.Blue); } goto Label_0890; Label_05A2: if ((list3[0] == "7") & flag1) { item.set_HalfHDP_ID(list3[1]); item.set_Half_HomeOddsString(list3[2]); item.set_Half_AwayOddsString(list3[3]); item.set_HalfHDP(list3[4]); string str11 = list3[5]; if (str11 == "2") { item.set_HalfHomeColor(Color.Blue); item.set_HalfAwayColor(Color.Red); } else if (str11 == "1") { item.set_HalfHomeColor(Color.Red); item.set_HalfAwayColor(Color.Blue); } else { item.set_HalfHomeColor(Color.Blue); item.set_HalfAwayColor(Color.Blue); } } goto Label_0890; Label_06CE: if ((list3[0] == "9") & flag1) { item.set_HalfOU_ID(list3[1]); item.set_Half_OverOddsString(list3[2]); item.set_Half_UnderOddsString(list3[3]); item.set_HalfOU(list3[4]); } else if (list3[0] == "5") { item.set_FT1X2_ID(list3[1]); item.set_FT_1X2HomeOddsString(list3[2]); item.set_FT_1X2DrawOddsString(list3[3]); item.set_FT_1X2AwayOddsString(list3[4]); item.set_FT1X2("0.0"); } else if (list3[0] == "8") { item.set_Half1X2_ID(list3[1]); item.set_Half_1X2HomeOddsString(list3[2]); item.set_Half_1X2DrawOddsString(list3[3]); item.set_Half_1X2AwayOddsString(list3[4]); item.set_Half1X2("0.0"); } goto Label_0890; Label_07ED: 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)) { str4 = list3[0]; str5 = list3[1].Trim(); } break; } num5 = 2; numArray[num5]++; if (reader.Value != null) { list3.Add(reader.Value.ToString()); } } } continue; Label_089E: if (reader.TokenType == JsonToken.EndArray) { numArray[1] = -1; break; } num5 = 1; numArray[num5]++; } continue; } if (reader.TokenType == JsonToken.EndArray) { numArray[0] = -1; item.set_GlobalLastUpdate(DateTime.Now); item.set_Type(EnumCollection.eMatchType.Match); item.set_MatchTime(time2); item.set_CompetitionID(str2); item.set_FT_ID(str7); item.set_UniqueID(str7); item.set_Half_ID(str7); item.set_HomeName(str3); item.set_AwayName(str); item.set_League(str5); item.set_LeagueID(str4); item.set_HomeScore(num2); item.set_AwayScore(num); item.set_RunningMinutes(num3); item.set_RunningStatus(deadBall); item.set_Website("SBOBet"); item.get_HomeName().Replace(" ", ""); item.get_AwayName().Replace(" ", ""); if ((item.get_RunningStatus() == EnumCollection.eRunningStatus.HT) | (item.get_RunningStatus() == EnumCollection.eRunningStatus.Running)) { item.set_GameType(EnumCollection.eGameType.Running); } else { item.set_GameType(type1); } list2.Add(item); } else { num5 = 0; numArray[num5]++; } } } if (list2.Count > 0) { list2.RemoveAt(list2.Count - 1); } } catch (Exception ex) { base._objErrorLogger.write(ex.Message + "\r\n" + text + "\r\n"); base._objErrorLogger.write(ex.Message + "\r\n" + text1 + "\r\n"); } return list2; }
public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string format = ""; string str5 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; format = base._strRootURL + "/webroot/restricted/plain/ticket.aspx?{0}&loginname=" + this._strLoginName; switch (target1) { case EnumCollection.eBetTarget.FT_Home: str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_FT_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_Away: str5 = "id=" + new1.get_FTHDP_ID() + "&odds=" + new1.get_FT_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_FT_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_Over: str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_Under: str5 = "id=" + new1.get_FTOU_ID() + "&odds=" + new1.get_FT_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_1: str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_X: str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.FT_2: str5 = "id=" + new1.get_FT1X2_ID() + "&odds=" + new1.get_FT_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Home: str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_HomeOdds().ToString() + "&op=h&hdpType=" + new1.get_Half_HomeBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Away: str5 = "id=" + new1.get_HalfHDP_ID() + "&odds=" + new1.get_Half_AwayOdds().ToString() + "&op=a&hdpType=" + new1.get_Half_AwayBetLink() + "&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Over: str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_OverOdds().ToString() + "&op=h&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_Under: str5 = "id=" + new1.get_HalfOU_ID() + "&odds=" + new1.get_Half_UnderOdds().ToString() + "&op=a&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_1: str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2HomeOddsString() + "&op=1&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_X: str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2DrawOddsString() + "&op=x&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; case EnumCollection.eBetTarget.Half_2: str5 = "id=" + new1.get_Half1X2_ID() + "&odds=" + new1.get_Half_1X2AwayOddsString() + "&op=2&hdpType=0&isor=0&hidRefreshOdds=&hidAuto="; break; } string url = string.Format(format, str5); new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Timeout = 0x7530; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Headers["Cookie"] = base._objCookieList.ToString(); request.ContentType = "application/x-www-form-urlencoded"; //request.KeepAlive = true; this.WriteProgramLogger("POST: " + url); base._objBetListLogger.write("POST: " + str5); WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true); this.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4); ProjectData.ClearProjectError(); } }
public List<MatchNew> GenerateMatchListFromArrayList(ArrayList list1, EnumCollection.eSportType type1) { List<MatchNew> list3 = new List<MatchNew>(); string str2 = ""; string str = ""; string str4 = ""; string str3 = ""; int num3 = 0; EnumCollection.eRunningStatus deadBall = EnumCollection.eRunningStatus.DeadBall; EnumCollection.eGameType today = EnumCollection.eGameType.Today; int num2 = 0; int num = 0; bool flag = false; try { IEnumerator enumerator = null; try { enumerator = list1.GetEnumerator(); while (enumerator.MoveNext()) { ArrayList current = (ArrayList)enumerator.Current; if (current.Count == 3) { ArrayList list4; MatchNew item = new MatchNew(); flag = false; if ((current[2] is ArrayList) && (((ArrayList)current[2]).Count >= 1)) { list4 = (ArrayList)current[2]; if (list4[0].ToString() == "0") { flag = true; } } if (flag) { DateTime time = new DateTime(); if (current[0] is ArrayList) { list4 = (ArrayList)current[0]; if (list4.Count == 3) { str3 = list4[0].ToString(); str4 = list4[1].ToString(); } } if (current[1] is ArrayList) { if (((ArrayList)current[1]).Count > 0) { list4 = (ArrayList)((ArrayList)current[1])[0]; if (list4.Count >= 6) { str2 = list4[1].ToString(); str = list4[2].ToString(); if (list4[5].ToString() != string.Empty) { DateTime time2; string str5 = Conversions.ToString(NewLateBinding.LateGet(NewLateBinding.LateGet(list4[5], null, "Replace", new object[] { "</span>", "" }, null, null, null), null, "Trim", new object[0], null, null, null)); if (str5.Contains("/")) { if (str5.Length >= 11) { string str6 = str5.Substring(6, 5); time = new DateTime(DateTime.Now.Year, (int)Math.Round(Conversion.Val(str5.Substring(0, 2))), (int)Math.Round(Conversion.Val(str5.Substring(3, 2))), (int)Math.Round(Conversion.Val(str6.Substring(0, 2))), (int)Math.Round(Conversion.Val(str6.Substring(3, 2))), 0); time2 = time; } } else { time = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, (int)Math.Round(Conversion.Val(str5.Substring(0, 2))), (int)Math.Round(Conversion.Val(str5.Substring(3, 2))), 0); int num4 = (int)Math.Round(time.Subtract(DateTime.Now).TotalMinutes); if (((DateTime.Now.Hour >= 12) & (DateTime.Now.Hour <= 0x17)) && ((time.Hour >= 0) & (time.Hour <= 11))) { time = time.AddDays(1.0); } time2 = time; } if (list4[6].ToString() == "1") { today = EnumCollection.eGameType.Running; deadBall = EnumCollection.eRunningStatus.Running; } else { today = EnumCollection.eGameType.Today; deadBall = EnumCollection.eRunningStatus.DeadBall; } } } } if (((ArrayList)current[1]).Count == 3) { list4 = (ArrayList)((ArrayList)current[1])[1]; if (list4.Count >= 3) { num2 = (int)Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list4[1]))); num = (int)Math.Round(Conversion.Val(RuntimeHelpers.GetObjectValue(list4[2]))); } list4 = (ArrayList)((ArrayList)current[1])[2]; if (list4.Count >= 5) { if (list4[2].ToString() == "0") { num3 = 0x2d; deadBall = EnumCollection.eRunningStatus.HT; } else { num3 = (int)Math.Round((double)(((Conversion.Val(RuntimeHelpers.GetObjectValue(list4[2])) - 1.0) * Conversion.Val(RuntimeHelpers.GetObjectValue(list4[4]))) + Conversion.Val(RuntimeHelpers.GetObjectValue(list4[3])))); deadBall = EnumCollection.eRunningStatus.Running; } } } } item.set_LeagueID(str3); item.set_League(str4); item.set_HomeName(str2); item.set_AwayName(str); item.set_HomeScore(num2); item.set_AwayScore(num); item.set_RunningMinutes(num3); item.set_MatchTime(time); item.set_GameType(today); item.set_RunningStatus(deadBall); if (((ArrayList)current[2]).Count >= 2) { int num6 = ((ArrayList)((ArrayList)current[2])[1]).Count - 1; for (int i = 0; i <= num6; i++) { list4 = (ArrayList)((ArrayList)((ArrayList)current[2])[1])[i]; if (list4.Count >= 5) { switch (list4[0].ToString()) { case "1": { item.set_FTHDP(list4[4].ToString()); item.set_FTHDP_ID(list4[1].ToString()); item.set_FT_HomeOddsString(list4[2].ToString()); item.set_FT_AwayOddsString(list4[3].ToString()); string str8 = list4[5].ToString(); if (str8 == "2") { item.set_FTHomeColor(Color.Blue); item.set_FTAwayColor(Color.Red); } else if (str8 == "1") { item.set_FTHomeColor(Color.Red); item.set_FTAwayColor(Color.Blue); } else { item.set_FTHomeColor(Color.Blue); item.set_FTAwayColor(Color.Blue); } goto Label_0827; } case "3": item.set_FTOU(list4[4].ToString()); item.set_FTOU_ID(list4[1].ToString()); item.set_FT_OverOddsString(list4[2].ToString()); item.set_FT_UnderOddsString(list4[3].ToString()); goto Label_0827; case "7": { item.set_HalfHDP(list4[4].ToString()); item.set_HalfHDP_ID(list4[1].ToString()); item.set_Half_HomeOddsString(list4[2].ToString()); item.set_Half_AwayOddsString(list4[3].ToString()); string str9 = list4[5].ToString(); if (str9 == "2") { item.set_HalfHomeColor(Color.Blue); item.set_HalfAwayColor(Color.Red); } else if (str9 == "1") { item.set_HalfHomeColor(Color.Red); item.set_HalfAwayColor(Color.Blue); } else { item.set_HalfHomeColor(Color.Blue); item.set_HalfAwayColor(Color.Blue); } goto Label_0827; } case "9": item.set_HalfOU(list4[4].ToString()); item.set_HalfOU_ID(list4[1].ToString()); item.set_Half_OverOddsString(list4[2].ToString()); item.set_Half_UnderOddsString(list4[3].ToString()); break; } Label_0827: ; } else if ((list4.Count == 3) && (list4[0].ToString() != string.Empty)) { item.set_FT_ID(Conversions.ToString(list4[0])); } } item.set_SportType(type1); item.set_Website("SBOBet"); item.set_Type(EnumCollection.eMatchType.Match); item.set_GlobalLastUpdate(DateTime.Now); list3.Add(item); } } } } return list3; } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateMatchListFromArrayList: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateMatchListFromArrayList: " + exception.Message); ProjectData.ClearProjectError(); } return list3; }
public List<MatchNew> GenerateFullSpecialOddsFromText(string text1, bool flag1) { List<MatchNew> list3 = new List<MatchNew>(); ArrayList list2 = new ArrayList(); int num3 = 0; string str4 = ""; int num = 0; string str2 = ""; string str3 = ""; string str = ""; string str6 = ""; string str5 = ""; DateTime time = new DateTime(); try { num3 = 0; while (num3 > -1) { str4 = CommonFunction.substring(text1, num3, "]=[", "];", ref num3); if (str4 != string.Empty) { list2.Add(str4); } } int num5 = list2.Count - 1; for (num = 0; num <= num5; num++) { ArrayList list4 = new ArrayList(); list4 = CommonFunction.SeperateStringBySymbol(Conversions.ToString(list2[num]), ","); if (list4.Count >= 0x27) { MatchNew item = new MatchNew(); if (Operators.ConditionalCompareObjectNotEqual(list4[0], "", false)) { str5 = CommonFunction.TrimSymbol(Conversions.ToString(list4[0]), "'"); } list4[1] = CommonFunction.TrimSymbol(Conversions.ToString(list4[1]), "'").Trim(); if (Operators.ConditionalCompareObjectNotEqual(list4[1], "", false)) { str6 = Conversions.ToString(list4[1]); } list4[2] = CommonFunction.TrimSymbol(Conversions.ToString(list4[2]), "'").Trim(); if (Operators.ConditionalCompareObjectNotEqual(list4[2], "", false)) { str2 = Conversions.ToString(list4[2]); } if (Operators.ConditionalCompareObjectNotEqual(list4[3], "", false)) { str3 = CommonFunction.TrimSymbol(Conversions.ToString(list4[3]), "'").Trim(); } if (Operators.ConditionalCompareObjectNotEqual(list4[4], "", false)) { str = CommonFunction.TrimSymbol(Conversions.ToString(list4[4]), "'").Trim(); } item.set_LeagueID(str5); item.set_League(str6); item.set_CompetitionID(str2); item.set_HomeName(str3.Replace(" ", "")); item.set_AwayName(str.Replace(" ", "")); item.set_FT_ID(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x27]), "'")); item.set_UniqueID(item.get_FT_ID()); item.set_GameType(EnumCollection.eGameType.Special); if (Operators.ConditionalCompareObjectGreater(NewLateBinding.LateGet(list4[6], null, "length", new object[0], null, null, null), 5, false)) { DateTime time2; string str8 = list4[6].ToString().Substring(0, 5); if (str8.Contains("/")) { if (Operators.ConditionalCompareObjectGreaterEqual(NewLateBinding.LateGet(list4[6], null, "length", new object[0], null, null, null), 11, false)) { string str9 = Conversions.ToString(NewLateBinding.LateGet(list4[6], null, "substring", new object[] { 6, 5 }, null, null, null)); time2 = new DateTime(DateTime.Now.Year, (int)Math.Round(Conversion.Val(str8.Substring(0, 2))), (int)Math.Round(Conversion.Val(str8.Substring(3, 2))), (int)Math.Round(Conversion.Val(str9.Substring(0, 2))), (int)Math.Round(Conversion.Val(str9.Substring(3, 2))), 0); time = time2; } } else { time2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, (int)Math.Round(Conversion.Val(str8.Substring(0, 2))), (int)Math.Round(Conversion.Val(str8.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); } time = time2; } } item.set_MatchTime(time); item.set_Half_ID(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x27]), "'")); item.set_FTHDP_ID(CommonFunction.TrimSymbol(Conversions.ToString(list4[13]), "'")); item.set_FT_HomeOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[14]), "'")); item.set_FT_AwayOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[15]), "'")); item.set_FTHDP(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x10]), "'")); item.set_FTOU_ID(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x12]), "'")); item.set_FT_OverOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x13]), "'")); item.set_FT_UnderOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[20]), "'")); item.set_FTOU(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x15]), "'")); object left = list4[0x11]; if (Operators.ConditionalCompareObjectEqual(left, "1", false)) { item.set_FTHomeColor(Color.Red); item.set_FTAwayColor(Color.Blue); } else if (Operators.ConditionalCompareObjectEqual(left, "2", false)) { item.set_FTHomeColor(Color.Blue); item.set_FTAwayColor(Color.Red); } else { item.set_FTHomeColor(Color.Blue); item.set_FTAwayColor(Color.Blue); } if (flag1) { item.set_HalfHDP_ID(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x1d]), "'")); item.set_Half_HomeOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[30]), "'")); item.set_Half_AwayOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x1f]), "'")); item.set_HalfHDP(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x20]), "'")); item.set_HalfOU_ID(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x22]), "'")); item.set_Half_OverOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x23]), "'")); item.set_Half_UnderOddsString(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x24]), "'")); item.set_HalfOU(CommonFunction.TrimSymbol(Conversions.ToString(list4[0x25]), "'")); object obj3 = list4[0x21]; if (Operators.ConditionalCompareObjectEqual(obj3, "1", false)) { item.set_HalfHomeColor(Color.Red); item.set_HalfAwayColor(Color.Blue); } else if (Operators.ConditionalCompareObjectEqual(obj3, "2", false)) { item.set_HalfHomeColor(Color.Blue); item.set_HalfAwayColor(Color.Red); } else { item.set_HalfHomeColor(Color.Blue); item.set_HalfAwayColor(Color.Blue); } } item.set_Type(EnumCollection.eMatchType.Match); list3.Add(item); } } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateFullSpecialOddsFromText: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateFullSpecialOddsFromText: " + exception.Message); ProjectData.ClearProjectError(); } return list3; }
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; }
private void ResetCoolDownColorByMatch(MatchNew new1, bool flag1, bool flag2, bool flag3, bool flag4) { int num = -1; num = SpiderFunction.FindMatchIndexFromListByUniqueID(new1.get_UniqueID(), ref this._objMatchNewList); if (num > -1) { if (flag1) { this.get_dgvMatchList().Rows[num * this._intRowPerBlock].Cells[4].Style.BackColor = this._clrBackgroundGlobal; this.get_dgvMatchList().Rows[(num * this._intRowPerBlock) + 1].Cells[4].Style.BackColor = this._clrBackgroundGlobal; } if (flag2) { this.get_dgvMatchList().Rows[num * this._intRowPerBlock].Cells[6].Style.BackColor = this._clrBackgroundGlobal; this.get_dgvMatchList().Rows[(num * this._intRowPerBlock) + 1].Cells[6].Style.BackColor = this._clrBackgroundGlobal; } if (flag3) { this.get_dgvMatchList().Rows[num * this._intRowPerBlock].Cells[8].Style.BackColor = this._clrBackgroundGlobal; this.get_dgvMatchList().Rows[(num * this._intRowPerBlock) + 1].Cells[8].Style.BackColor = this._clrBackgroundGlobal; } if (flag4) { this.get_dgvMatchList().Rows[num * this._intRowPerBlock].Cells[10].Style.BackColor = this._clrBackgroundGlobal; this.get_dgvMatchList().Rows[(num * this._intRowPerBlock) + 1].Cells[10].Style.BackColor = this._clrBackgroundGlobal; } } }
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; }
private void GetTicketAndBetFromAgent(MatchBetNew new1, MatchNew new4, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str5 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; requestUriString = base._strRootURL + "/english/index.php?p=bettingback&b=soccer|"; if (new1.get_GameType() == EnumCollection.eGameType.Running) { str5 = "r"; } switch (target1) { case EnumCollection.eBetTarget.FT_Home: requestUriString = requestUriString + string.Format("{2}ah|{0}|a||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.FT_Away: requestUriString = requestUriString + string.Format("{2}ah|{0}|b||||{1}", new4.get_FTHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.FT_Over: requestUriString = requestUriString + string.Format("{2}ou|{0}|over||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.FT_Under: requestUriString = requestUriString + string.Format("{2}ou|{0}|under||||{1}", new4.get_FTOU_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Home: requestUriString = requestUriString + string.Format("{2}ahht|{0}|a||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Away: requestUriString = requestUriString + string.Format("{2}ahht|{0}|b||||{1}", new4.get_HalfHDP_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Over: requestUriString = requestUriString + string.Format("{2}ouht|{0}|over||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5); break; case EnumCollection.eBetTarget.Half_Under: requestUriString = requestUriString + string.Format("{2}ouht|{0}|under||||{1}", new4.get_HalfOU_ID(), this._strOddsText, str5); break; } new3 = new1; new2 = new4.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x2710; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/english/index.php?p=user_main"; request.ContentLength = 0L; request.KeepAlive = true; WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, "", num1, new3.get_BetType(), target1, new MatchNew(), new3, new4, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new4, new2, null); ProjectData.ClearProjectError(); } }
public List<MatchNew> GenerateMatchList(ArrayList list1) { IEnumerator enumerator = null; List<MatchNew> list2 = new List<MatchNew>(); string str5 = ""; string str3 = ""; string str6 = ""; string str4 = ""; string str7 = ""; DateTime time2 = new DateTime(); DateTime time3 = new DateTime(); Color blue = Color.Blue; Color red = Color.Blue; int num2 = 0; int num = 0; EnumCollection.eRunningStatus deadBall = EnumCollection.eRunningStatus.DeadBall; int num4 = 0; int hour = 0; DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now)); try { enumerator = list1.GetEnumerator(); while (enumerator.MoveNext()) { List<string> current = (List<string>)enumerator.Current; if (current.Count >= 0x31) { int num9; MatchNew item = new MatchNew(); if (current[0] != "''") { str4 = CommonFunction.TrimSymbol(CommonFunction.TrimSymbol(current[0].ToString(), "'"), "*"); } if (current[5] != "''") { str6 = CommonFunction.TrimSymbol(current[5].ToString(), "'").Trim(); } if (current[6] != "''") { str5 = CommonFunction.TrimSymbol(current[6].ToString(), "'").Trim(); num2 = (int)Math.Round(Conversion.Val(current[0x13])); num = (int)Math.Round(Conversion.Val(CommonFunction.TrimSymbol(current[20], "'"))); } if (current[7] != "''") { str3 = CommonFunction.TrimSymbol(current[7].ToString(), "'").Trim(); } item.set_Type(EnumCollection.eMatchType.Match); item.set_GlobalLastUpdate(DateTime.Now); item.set_FT_ID(str4); item.set_FTHDP_ID2(str4 + CommonFunction.TrimSymbol(current[3], "'")); item.set_UniqueID(str4 + current[3].ToString()); item.set_HomeName(str5); item.set_AwayName(str3); item.set_League(str6); str7 = current[12]; if (str7.Contains("/font>")) { num9 = 0; str7 = CommonFunction.substring(str7, 0, "/font>", "'", ref num9).Trim(); } else { str7 = CommonFunction.TrimSymbol(str7, "'"); } if (str7.Length > 5) { if (str7.Contains(@"\'")) { int num6 = 0; int num7 = 0; deadBall = EnumCollection.eRunningStatus.Running; num6 = (int)Math.Round(Conversion.Val(str7.Substring(0, 1))); num9 = 0; num7 = Conversions.ToInteger(CommonFunction.substring(str7, Conversions.ToInteger("0"), "H", @"\", ref num9)); if (num6 > 0) { num4 = ((num6 - 1) * 0x2d) + num7; } else { num4 = 0; } } else if (str7.ToLower() == "h.time") { num4 = 0x2d; deadBall = EnumCollection.eRunningStatus.HT; } else if (str7.Length == 7) { hour = (int)Math.Round(Conversion.Val(str7.Substring(0, 2))); if ((str7.Substring(5, 2).ToLower() == "pm") && ((hour >= 1) & (hour <= 11))) { hour += 12; } time2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, (int)Math.Round(Conversion.Val(str7.Substring(3, 2))), 0); int num8 = (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); } deadBall = EnumCollection.eRunningStatus.DeadBall; time3 = time2; } else if (str7.Length == 13) { hour = (int)Math.Round(Conversion.Val(str7.Substring(7, 2))); if ((str7.Substring(11, 2).ToLower() == "pm") && ((hour >= 1) & (hour <= 11))) { hour += 12; } try { time2 = new DateTime(DateTime.Now.Year, (int)Math.Round(Conversion.Val(str7.Substring(0, 2))), (int)Math.Round(Conversion.Val(str7.Substring(3, 2))), hour, (int)Math.Round(Conversion.Val(str7.Substring(9, 2))), 0); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; ProjectData.ClearProjectError(); } deadBall = EnumCollection.eRunningStatus.DeadBall; time3 = time2; } } item.set_RunningStatus(deadBall); if (item.get_RunningStatus() == EnumCollection.eRunningStatus.DeadBall) { item.set_MatchTime(time2); if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime())) { item.set_GameType(EnumCollection.eGameType.Early); } else { item.set_GameType(EnumCollection.eGameType.Today); } } else { item.set_GameType(EnumCollection.eGameType.Running); item.set_MatchTime(DateTime.Now.Date); item.set_RunningMinutes(num4); item.set_HomeScore(num2); item.set_AwayScore(num); } item.set_Half_ID(item.get_FT_ID()); item.set_FTHDP_ID(CommonFunction.TrimSymbol(current[0x18], "'")); item.set_FTHDP(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(current[0x19], "'"))); item.set_FT_HomeOddsString(CommonFunction.TrimSymbol(current[0x1a], "'")); item.set_FT_AwayOddsString(CommonFunction.TrimSymbol(current[0x1b], "'")); if (current[0x1c] == "'h'") { blue = Color.Red; red = Color.Blue; } else if (current[0x1c] == "'a'") { 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); } item.set_FTOU_ID(CommonFunction.TrimSymbol(current[0x1d], "'")); item.set_FTOU(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(current[30], "'"))); item.set_FT_OverOddsString(CommonFunction.TrimSymbol(current[0x1f], "'")); item.set_FT_UnderOddsString(CommonFunction.TrimSymbol(current[0x20], "'")); if (base._isToIncludeFirstHalfOdds) { item.set_HalfHDP_ID(CommonFunction.TrimSymbol(current[0x25], "'")); item.set_HalfHDP(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(current[0x26], "'"))); item.set_Half_HomeOddsString(CommonFunction.TrimSymbol(current[0x27], "'")); item.set_Half_AwayOddsString(CommonFunction.TrimSymbol(current[40], "'")); item.set_HalfOU_ID(CommonFunction.TrimSymbol(current[0x2a], "'")); item.set_HalfOU(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(current[0x2b], "'"))); item.set_Half_OverOddsString(CommonFunction.TrimSymbol(current[0x2c], "'")); item.set_Half_UnderOddsString(CommonFunction.TrimSymbol(current[0x2d], "'")); 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); } } item.set_Website("IBCBet"); list2.Add(item); } } } finally { if (enumerator is IDisposable) { (enumerator as IDisposable).Dispose(); } } return list2; }
public List<MatchNew> GenerateFullOddsFromText(string text1, bool bb1, bool bb2, bool bb3) { List<string> list2 = new List<string>(); string str2 = ""; int num5 = 0; List<MatchNew> list3 = new List<MatchNew>(); string str5 = ""; string str3 = ""; string str6 = ""; string str4 = ""; string str7 = ""; DateTime time2 = new DateTime(); DateTime time3 = new DateTime(); Color blue = Color.Blue; Color red = Color.Blue; int num2 = 0; int num = 0; EnumCollection.eRunningStatus deadBall = EnumCollection.eRunningStatus.DeadBall; int num4 = 0; int hour = 0; DateTime time = Conversions.ToDate(SpiderFunction.GetEarlyMarketStartTime(DateTime.Now)); try { while (num5 > -1) { str2 = CommonFunction.substring(text1, num5, "]=[", "];", ref num5).Trim(); if (str2 != string.Empty) { list2 = CommonFunction.SeperateStringBySymbol2(str2, ","); if (list2.Count >= 0) { int num9; MatchNew item = new MatchNew(); if (list2[0] != "''") { str4 = CommonFunction.TrimSymbol(CommonFunction.TrimSymbol(list2[0].ToString(), "'"), "*"); } if (list2[5] != "''") { str6 = CommonFunction.TrimSymbol(list2[5].ToString(), "'").Trim(); } if (list2[6] != "''") { str5 = CommonFunction.TrimSymbol(list2[6].ToString(), "'").Trim(); num2 = (int)Math.Round(Conversion.Val(list2[0x13])); num = (int)Math.Round(Conversion.Val(CommonFunction.TrimSymbol(list2[20], "'"))); num4 = 0; deadBall = EnumCollection.eRunningStatus.DeadBall; } if (list2[7] != "''") { str3 = CommonFunction.TrimSymbol(list2[7].ToString(), "'").Trim(); } item.set_Type(EnumCollection.eMatchType.Match); item.set_GlobalLastUpdate(DateTime.Now); item.set_FT_ID(str4); item.set_FTHDP_ID2(str4 + CommonFunction.TrimSymbol(list2[3], "'")); item.set_UniqueID(str4 + list2[3].ToString()); item.set_HomeName(str5.Replace(" ", "")); item.set_AwayName(str3.Replace(" ", "")); item.set_League(str6); str7 = list2[12]; if (str7.Contains("/font>")) { num9 = 0; str7 = CommonFunction.substring(str7, 0, "/font>", "'", ref num9).Trim(); } else { str7 = CommonFunction.TrimSymbol(str7, "'"); } if (str7.Length > 5) { if (str7.Contains(@"\'")) { int num6 = 0; int num7 = 0; deadBall = EnumCollection.eRunningStatus.Running; num6 = (int)Math.Round(Conversion.Val(str7.Substring(0, 1))); num9 = 0; num7 = (int)Math.Round(Conversion.Val(CommonFunction.substring(str7, Conversions.ToInteger("0"), "H", @"\", ref num9))); if (num6 > 0) { num4 = ((num6 - 1) * 0x2d) + num7; } else { num4 = 0; } } else if (str7.ToLower() == "h.time") { num4 = 0x2d; deadBall = EnumCollection.eRunningStatus.HT; } else if (str7.Length == 7) { hour = (int)Math.Round(Conversion.Val(str7.Substring(0, 2))); if ((str7.Substring(5, 2).ToLower() == "pm") && ((hour >= 1) & (hour <= 11))) { hour += 12; } time2 = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, hour, (int)Math.Round(Conversion.Val(str7.Substring(3, 2))), 0); int num8 = (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); } num4 = 0; deadBall = EnumCollection.eRunningStatus.DeadBall; time3 = time2; } else if (str7.Length == 13) { hour = (int)Math.Round(Conversion.Val(str7.Substring(7, 2))); if ((str7.Substring(11, 2).ToLower() == "pm") && ((hour >= 1) & (hour <= 11))) { hour += 12; } try { time2 = new DateTime(DateTime.Now.Year, (int)Math.Round(Conversion.Val(str7.Substring(0, 2))), (int)Math.Round(Conversion.Val(str7.Substring(3, 2))), hour, (int)Math.Round(Conversion.Val(str7.Substring(9, 2))), 0); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; ProjectData.ClearProjectError(); } deadBall = EnumCollection.eRunningStatus.DeadBall; time3 = time2; } } item.set_RunningStatus(deadBall); if (item.get_RunningStatus() == EnumCollection.eRunningStatus.DeadBall) { item.set_MatchTime(time2); if (SpiderFunction.IsEarlyMarket(time, item.get_MatchTime())) { item.set_GameType(EnumCollection.eGameType.Early); } else { item.set_GameType(EnumCollection.eGameType.Today); } } else { item.set_GameType(EnumCollection.eGameType.Running); item.set_MatchTime(DateTime.Now.Date); item.set_RunningMinutes(num4); item.set_HomeScore(num2); item.set_AwayScore(num); } // FT.HDP item.set_Half_ID(item.get_FT_ID()); // soccer count 50 if (list2.Count == 0x31 || list2.Count == 50) { item.set_FTHDP_ID(CommonFunction.TrimSymbol(list2[0x18], "'")); item.set_FTHDP(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[0x19], "'"))); item.set_FT_HomeOddsString(CommonFunction.TrimSymbol(list2[0x1a], "'")); item.set_FT_AwayOddsString(CommonFunction.TrimSymbol(list2[0x1b], "'")); if (list2[0x1c] == "'h'") { blue = Color.Red; red = Color.Blue; } else if (list2[0x1c] == "'a'") { 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); } // FT.over/under item.set_FTOU_ID(CommonFunction.TrimSymbol(list2[0x1d], "'")); item.set_FTOU(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[30], "'"))); item.set_FT_OverOddsString(CommonFunction.TrimSymbol(list2[0x1f], "'")); item.set_FT_UnderOddsString(CommonFunction.TrimSymbol(list2[0x20], "'")); // FT.1 X 2 item.set_FT1X2_ID(CommonFunction.TrimSymbol(list2[33], "'")); item.set_FT1X2("0.0"); item.set_FT_1X2HomeOddsString(CommonFunction.TrimSymbol(list2[34], "'")); item.set_FT_1X2AwayOddsString(CommonFunction.TrimSymbol(list2[35], "'")); item.set_FT_1X2DrawOddsString(CommonFunction.TrimSymbol(list2[36], "'")); if (base._isToIncludeFirstHalfOdds) { // HT.HDP item.set_HalfHDP_ID(CommonFunction.TrimSymbol(list2[0x25], "'")); item.set_HalfHDP(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[0x26], "'"))); item.set_Half_HomeOddsString(CommonFunction.TrimSymbol(list2[0x27], "'")); item.set_Half_AwayOddsString(CommonFunction.TrimSymbol(list2[40], "'")); // HT.over/under item.set_HalfOU_ID(CommonFunction.TrimSymbol(list2[0x2a], "'")); item.set_HalfOU(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[0x2b], "'"))); item.set_Half_OverOddsString(CommonFunction.TrimSymbol(list2[0x2c], "'")); item.set_Half_UnderOddsString(CommonFunction.TrimSymbol(list2[0x2d], "'")); // HT.1 X 2 item.set_Half1X2_ID(CommonFunction.TrimSymbol(list2[46], "'")); item.set_Half1X2("0.0"); item.set_Half_1X2HomeOddsString(CommonFunction.TrimSymbol(list2[47], "'")); item.set_Half_1X2AwayOddsString(CommonFunction.TrimSymbol(list2[48], "'")); item.set_Half_1X2DrawOddsString(CommonFunction.TrimSymbol(list2[49], "'")); 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); } } } // basketball count 45/56 // tenis count 36 else if ((list2.Count == 45) || (list2.Count == 56) || ((list2.Count == 36))) { item.set_FTHDP_ID(CommonFunction.TrimSymbol(list2[21], "'")); item.set_FTHDP(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[22], "'"))); item.set_FT_HomeOddsString(CommonFunction.TrimSymbol(list2[23], "'")); item.set_FT_AwayOddsString(CommonFunction.TrimSymbol(list2[24], "'")); if (list2[25] == "'h'") { blue = Color.Red; red = Color.Blue; } else if (list2[25] == "'a'") { 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); } // FT.over/under item.set_FTOU_ID(CommonFunction.TrimSymbol(list2[29], "'")); item.set_FTOU(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[30], "'"))); item.set_FT_OverOddsString(CommonFunction.TrimSymbol(list2[0x1f], "'")); item.set_FT_UnderOddsString(CommonFunction.TrimSymbol(list2[0x20], "'")); // FT.1 X 2 /***item.set_FT1X2_ID(CommonFunction.TrimSymbol(list2[33], "'")); item.set_FT1X2("0.0"); item.set_FT_1X2HomeOddsString(CommonFunction.TrimSymbol(list2[34], "'")); item.set_FT_1X2AwayOddsString(CommonFunction.TrimSymbol(list2[35], "'")); item.set_FT_1X2DrawOddsString(CommonFunction.TrimSymbol(list2[36], "'"));***/ if (base._isToIncludeFirstHalfOdds & list2.Count != 36) { // HT.HDP item.set_HalfHDP_ID(CommonFunction.TrimSymbol(list2[33], "'")); item.set_HalfHDP(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[34], "'"))); item.set_Half_HomeOddsString(CommonFunction.TrimSymbol(list2[35], "'")); item.set_Half_AwayOddsString(CommonFunction.TrimSymbol(list2[36], "'")); // HT.over/under item.set_HalfOU_ID(CommonFunction.TrimSymbol(list2[38], "'")); item.set_HalfOU(SportBookFunction.ConvertIBCToSBOOdds(CommonFunction.TrimSymbol(list2[39], "'"))); item.set_Half_OverOddsString(CommonFunction.TrimSymbol(list2[40], "'")); item.set_Half_UnderOddsString(CommonFunction.TrimSymbol(list2[41], "'")); // HT.1 X 2 /***item.set_Half1X2_ID(CommonFunction.TrimSymbol(list2[46], "'")); item.set_Half1X2("0.0"); item.set_Half_1X2HomeOddsString(CommonFunction.TrimSymbol(list2[47], "'")); item.set_Half_1X2AwayOddsString(CommonFunction.TrimSymbol(list2[48], "'")); item.set_Half_1X2DrawOddsString(CommonFunction.TrimSymbol(list2[49], "'"));***/ 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); } } } item.set_Website("IBCBet"); list3.Add(item); } } } } catch (Exception exception3) { ProjectData.SetProjectError(exception3); Exception exception2 = exception3; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception2.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateFullOddsFromText: " + exception2.Message); ProjectData.ClearProjectError(); } return list3; }
private MatchNew ConvertMatchLiteToMatchNew(MatchLite lite) { MatchNew matchNew = new MatchNew(); return matchNew; }
public void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str5 = ""; string str = ""; string str3 = ""; string str4 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; requestUriString = base._strRootURL + "/BetProcess_Data.aspx"; switch (target1) { case EnumCollection.eBetTarget.FT_Home: str = new1.get_FTHDP_ID(); str3 = new1.get_FT_HomeOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.FT_Away: str = new1.get_FTHDP_ID(); str3 = new1.get_FT_AwayOddsString(); str4 = "a"; break; case EnumCollection.eBetTarget.FT_Over: str = new1.get_FTOU_ID(); str3 = new1.get_FT_OverOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.FT_Under: str = new1.get_FTOU_ID(); str3 = new1.get_FT_UnderOddsString(); str4 = "a"; break; case EnumCollection.eBetTarget.Half_Home: str = new1.get_HalfHDP_ID(); str3 = new1.get_Half_HomeOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.Half_Away: str = new1.get_HalfHDP_ID(); str3 = new1.get_Half_AwayOddsString(); str4 = "a"; break; case EnumCollection.eBetTarget.Half_Over: str = new1.get_HalfOU_ID(); str3 = new1.get_Half_OverOddsString(); str4 = "h"; break; case EnumCollection.eBetTarget.Half_Under: str = new1.get_HalfOU_ID(); str3 = new1.get_Half_UnderOddsString(); str4 = "a"; break; // add 1x2 case EnumCollection.eBetTarget.FT_1: str = new1.get_FT1X2_ID(); str3 = new1.get_FT_1X2HomeOddsString().ToString(); str4 = "1"; break; case EnumCollection.eBetTarget.FT_X: str = new1.get_FT1X2_ID(); str3 = new1.get_FT_1X2AwayOddsString().ToString(); str4 = "X"; break; case EnumCollection.eBetTarget.FT_2: str = new1.get_FT1X2_ID(); str3 = new1.get_FT_1X2DrawOddsString().ToString(); str4 = "2"; break; case EnumCollection.eBetTarget.Half_1: str = new1.get_Half1X2_ID(); str3 = new1.get_Half_1X2HomeOddsString().ToString(); str4 = "1"; break; case EnumCollection.eBetTarget.Half_X: str = new1.get_Half1X2_ID(); str3 = new1.get_Half_1X2AwayOddsString().ToString(); ; str4 = "X"; break; case EnumCollection.eBetTarget.Half_2: str = new1.get_Half1X2_ID(); str3 = new1.get_Half_1X2DrawOddsString().ToString(); ; str4 = "2"; break; } str5 = "bp_Match=" + str + "_" + str4 + "_" + str3 + "&bp_ssport=&chk_BettingChange=4"; // Add Andy 添加新值 2011.08.08 StringBuilder sb = new StringBuilder(str5); sb.Append("&").Append(this.key); sb.Append("=").Append(this.value); str5 = sb.ToString(); // End Andy new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(requestUriString); request.Timeout = 0x7530; request.Method = "POST"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/LeftAllInOne.aspx"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = str5.Length; base._objBetListLogger.write("POST: " + str5); this.WriteProgramLogger("TWESTESST2.0: " + request.Address.ToString()); Stream stream = request.GetRequestStream(); byte[] bytes = Encoding.UTF8.GetBytes(str5); stream.Write(bytes, 0, str5.Length); stream.Close(); this.WriteProgramLogger("TWESTESST2.1: " + request.Address.ToString()); WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x7530, true); base.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.get__objBetQueueMonitor().SaveBetInfo(exception.Message, new4); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); ProjectData.ClearProjectError(); } }
private void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str5 = ""; base._isBetting = true; base._datTicketStart = DateTime.Now; switch (target1) { case EnumCollection.eBetTarget.FT_Home: requestUriString = new1.get_FT_HomeBetLink(); break; case EnumCollection.eBetTarget.FT_Away: requestUriString = new1.get_FT_AwayBetLink(); break; case EnumCollection.eBetTarget.FT_Over: requestUriString = new1.get_FT_OverBetLink(); break; case EnumCollection.eBetTarget.FT_Under: requestUriString = new1.get_FT_UnderBetLink(); break; case EnumCollection.eBetTarget.Half_Home: requestUriString = new1.get_Half_HomeBetLink(); break; case EnumCollection.eBetTarget.Half_Away: requestUriString = new1.get_Half_AwayBetLink(); break; case EnumCollection.eBetTarget.Half_Over: requestUriString = new1.get_Half_OverBetLink(); break; case EnumCollection.eBetTarget.Half_Under: requestUriString = new1.get_Half_UnderBetLink(); break; } new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x2710; request.Method = "GET"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.KeepAlive = true; request.Referer = base._strRootURL + "/app/member/FT_browse/body_browse.php?uid=" + this._strUID + "&rtype=re&langx=en-us&mtype=3&delay="; request.AllowAutoRedirect = true; request.Headers["Cookie"] = base._objCookieList.ToString(); WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str5, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetResponse(new AsyncCallback(this.RequestCompleteTicketFromAgent), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); ProjectData.ClearProjectError(); } }
public static MatchNew FindMatchByMatchBetFuzzyIgnoreColor(MatchBetNew new1, List<MatchNew> list1) { MatchNew new3 = new MatchNew(); MatchNew new4 = new MatchNew(); new1.GenerateUpperCaseInfo(); if (new1.get_BetCoverage() == EnumCollection.eBetCoverage.FT) { if (new1.get_BetType() == EnumCollection.eBetType.HDP) { foreach (MatchNew neww3 in list1) { if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_FTHDP()))) { return neww3; } } return new4; } foreach (MatchNew neww3 in list1) { if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_FTOU()))) { return neww3; } } return new4; } if (new1.get_BetType() == EnumCollection.eBetType.HDP) { foreach (MatchNew neww3 in list1) { if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_HalfHDP()))) { return neww3; } } return new4; } foreach (MatchNew neww3 in list1) { if ((neww3.get_Type() == EnumCollection.eMatchType.Match) && ((CommonFunction.isFuzzyEqual(new1.get_HomeNameUpper(), neww3.get_HomeName().ToUpper()) & CommonFunction.isFuzzyEqual(new1.get_AwayNameUpper(), neww3.get_AwayName().ToUpper())) & (new1.get_HDP() == neww3.get_HalfOU()))) { return neww3; } } return new4; }
public object GenerateBetQueueFromMatchBetList(List<AgentToClientBet> list1, bool flag1, bool flag2, bool flag3, bool flag4) { List<AgentToClientBet> list = new List<AgentToClientBet>(); MatchNew new3 = new MatchNew(); string str = ""; try { List<AgentToClientBet>.Enumerator enumerator = list1.GetEnumerator(); try { while (enumerator.MoveNext()) { AgentToClientBet current = enumerator.Current; MatchBetNew new4 = current.get_SourceAgentMemberBet().Clone(); Color color2 = new4.get_HomeColor(); Color color = new4.get_AwayColor(); new3 = SpiderFunction.FindMatchByMatchBet(new4, base._objMatchListFull); if ((new3.get_HomeName() == string.Empty) & flag1) { new3 = SpiderFunction.FindMatchByMatchBetViaMatchingID(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag2) { new3 = SpiderFunction.FindMatchByMatchBetSingleName(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag3) { new3 = SpiderFunction.FindMatchByMatchBetFuzzy(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag4) { double num = 0.0; str = new4.get_HDP(); if (new3.get_HomeName() == string.Empty) { num = SportBookFunction.ConvertSBOBetHDPStyleToDouble(str) - 0.25; if (num >= 0.0) { new4.set_HDP(SportBookFunction.ConvertHDPType(num)); if (num == 0.0) { new4.set_HomeColor(Color.Blue); new4.set_AwayColor(Color.Blue); } new3 = SpiderFunction.FindMatchByMatchBet(new4, base._objMatchListFull); if ((new3.get_HomeName() == string.Empty) & flag1) { new3 = SpiderFunction.FindMatchByMatchBetViaMatchingID(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag2) { new3 = SpiderFunction.FindMatchByMatchBetSingleName(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag3) { new3 = SpiderFunction.FindMatchByMatchBetFuzzy(new4, base._objMatchListFull); } } } new4.set_HomeColor(color2); new4.set_AwayColor(color); if (new3.get_HomeName() == string.Empty) { num = SportBookFunction.ConvertSBOBetHDPStyleToDouble(str) + 0.25; if (num >= 0.0) { new4.set_HDP(SportBookFunction.ConvertHDPType(num)); if ((new4.get_HomeColor() == Color.Blue) & (new4.get_AwayColor() == Color.Blue)) { new3 = SpiderFunction.FindMatchByMatchBetIgnoreColor(new4, base._objMatchListFull); if ((new3.get_HomeName() == string.Empty) & flag1) { new3 = SpiderFunction.FindMatchByMatchBetViaMatchingIDIgnoreColor(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag2) { new3 = SpiderFunction.FindMatchByMatchBetSingleNameIgnoreColor(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag3) { new3 = SpiderFunction.FindMatchByMatchBetFuzzyIgnoreColor(new4, base._objMatchListFull); } } else { new3 = SpiderFunction.FindMatchByMatchBet(new4, base._objMatchListFull); if ((new3.get_HomeName() == string.Empty) & flag1) { new3 = SpiderFunction.FindMatchByMatchBetViaMatchingID(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag2) { new3 = SpiderFunction.FindMatchByMatchBetSingleName(new4, base._objMatchListFull); } if ((new3.get_HomeName() == string.Empty) & flag3) { new3 = SpiderFunction.FindMatchByMatchBetFuzzy(new4, base._objMatchListFull); } } } } } if (new3.get_HomeName() != string.Empty) { if (new4.get_BetType() == EnumCollection.eBetType.HDP) { if (new4.get_SelectedMatch() == new4.get_HomeName()) { new4.set_SelectedMatch(new3.get_HomeName()); } else { new4.set_SelectedMatch(new3.get_AwayName()); } } new4.set_HomeName(new3.get_HomeName()); new4.set_AwayName(new3.get_AwayName()); list.Add(new AgentToClientBet(new4, new3, current.get_BetAmountStyle(), current.get_BetAmountValue(), base._intBetQueueMaxAttempt, "Finding Match...")); } } return list; } finally { enumerator.Dispose(); } } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GenerateBetQueueFromMatchBetList: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GenerateBetQueueFromMatchBetList: " + exception.Message); ProjectData.ClearProjectError(); } return list; }
public static MatchNew FindMatchByMatchBetViaMatchingIDIgnoreColor(MatchBetNew new1, List<MatchNew> list1) { MatchNew newww3 = new MatchNew(); MatchNew new4 = new MatchNew(); if ((new1.get_HomeMatchingID() > 0) & (new1.get_AwayMatchingID() > 0)) { new1.GenerateUpperCaseInfo(); if (new1.get_BetCoverage() == EnumCollection.eBetCoverage.FT) { if (new1.get_BetType() == EnumCollection.eBetType.HDP) { foreach (MatchNew new3 in list1) { if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_FTHDP()))) { return new3; } } return new4; } foreach (MatchNew new3 in list1) { if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_FTOU()))) { return new3; } } return new4; } if (new1.get_BetType() == EnumCollection.eBetType.HDP) { foreach (MatchNew new3 in list1) { if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_HalfHDP()))) { return new3; } } return new4; } foreach (MatchNew new3 in list1) { if ((((new3.get_Type() == EnumCollection.eMatchType.Match) & (new3.get_HomeMatchingID() > 0)) & (new3.get_AwayMatchingID() > 0)) && (((new1.get_HomeMatchingID() == new3.get_HomeMatchingID()) & (new1.get_AwayMatchingID() == new3.get_AwayMatchingID())) & (new1.get_HDP() == new3.get_HalfOU()))) { return new3; } } } return new4; }
private void GetTicketAndBetFromAgent(MatchBetNew new4, MatchNew new1, EnumCollection.eBetTarget target1, int num1, AgentToClientBet bet1) { MatchBetNew new3 = new MatchBetNew(); MatchBetNew new2 = new MatchBetNew(); try { string requestUriString = ""; string str7 = ""; string str5 = "1"; string str6 = "1"; base._isBetting = true; base._datTicketStart = DateTime.Now; requestUriString = base._strRootURL + "/MenuBet/BetSlipProc.aspx"; switch (target1) { case EnumCollection.eBetTarget.FT_Home: case EnumCollection.eBetTarget.FT_Away: case EnumCollection.eBetTarget.FT_Over: case EnumCollection.eBetTarget.FT_Under: if ((new1.get_FTHomeColor() == Color.Blue) & (new1.get_FTAwayColor() == Color.Red)) { str5 = "0"; } break; case EnumCollection.eBetTarget.Half_Home: case EnumCollection.eBetTarget.Half_Away: case EnumCollection.eBetTarget.Half_Over: case EnumCollection.eBetTarget.Half_Under: if ((new1.get_HalfHomeColor() == Color.Blue) & (new1.get_HalfAwayColor() == Color.Red)) { str5 = "0"; } break; } if (new1.get_GameType() == EnumCollection.eGameType.Early) { str6 = "2"; } if (new1.get_GameType() == EnumCollection.eGameType.Running) { switch (target1) { case EnumCollection.eBetTarget.FT_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RB", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RB", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RBOU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "RBOU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=1&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "30", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=2&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "30", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=4&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "31", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=5&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "31", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; } } else { switch (target1) { case EnumCollection.eBetTarget.FT_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "AH", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "AH", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTHDP()).ToString(), new1.get_FT_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=H&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "OU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.FT_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=A&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "OU", new1.get_FT_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_FTOU()).ToString(), new1.get_FT_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Home: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=1&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "7", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_HomeOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Away: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=2&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "7", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfHDP()).ToString(), new1.get_Half_AwayOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Over: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=4&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "8", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_OverOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; case EnumCollection.eBetTarget.Half_Under: str7 = string.Format("s11Mode=SINGLE&i31SportID=0&s12StakeType={0}&s11Period=" + str6 + "&s13EventNo={1}&s21Home=" + str5 + "&s13Selection=5&s13Handicap={2}&s11OddsType=&s13Odds={3}&m00Stake=&m00MaxBet=&s11HoldMemberRB=&i13ScoreHome={4}&i13ScoreAway={5}&s11Action=GETBET", new object[] { "8", new1.get_Half_ID(), SportBookFunction.ConvertSBOBetHDPStyleToDouble(new1.get_HalfOU()).ToString(), new1.get_Half_UnderOddsString(), new1.get_HomeScore(), new1.get_AwayScore() }); goto Label_0B3C; } } Label_0B3C: new3 = new4; new2 = new1.GenerateMatchBet(target1); HttpWebRequest request = (HttpWebRequest) WebRequest.Create(requestUriString); request.Timeout = 0x2710; request.Method = "POST"; request.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.16) Gecko/2009120208 Firefox/3.0.16"; request.Accept = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"; request.Headers.Add("Accept-Language", "en-gb,en;q=0.5"); request.Headers.Add("Accept-Encoding", "gzip, deflate"); request.Headers.Add("Accept-Charset", "ISO-8859-1,utf-8;q=0.7,*;q=0.7"); request.Headers["Cookie"] = base._objCookieList.ToString(); request.Referer = base._strRootURL + "/MenuBet/LeftMenu.aspx"; request.ContentType = "application/x-www-form-urlencoded"; request.ContentLength = str7.Length; request.KeepAlive = true; WebRequestStateEx2 state = new WebRequestStateEx2("GetTicketAndBetFromAgent", request, str7, num1, new3.get_BetType(), target1, new MatchNew(), new3, new1, new2, bet1); ThreadPool.RegisterWaitForSingleObject(request.BeginGetRequestStream(new AsyncCallback(this.ReadCallBackTicket), state).AsyncWaitHandle, new WaitOrTimerCallback(this.TimeoutCallBackEx2), state, 0x2710, true); base.allDone.WaitOne(); } catch (Exception exception1) { ProjectData.SetProjectError(exception1); Exception exception = exception1; base._isBetting = false; base._objErrorLogger.write(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.WriteProgramLogger(base._strName + ": EXCEPTION IN GetTicketAndBetFromAgent: " + exception.Message); this.RaiseEventGetTicketComplete(base._strName, false, target1, new MatchNew(), new3, new1, new2, null); ProjectData.ClearProjectError(); } }
public void set_TargetClientMatch(MatchNew new1) { this._objMatchClient = new1; }
private List<MatchNew> GenerateMatchNameListFromText(string text1, EnumCollection.eGameType type1) { List<MatchNew> list3 = new List<MatchNew>(); List<string> list2 = new List<string>(); List<string> list4 = new List<string>(); string item = ""; int num = 0; while (num > -1) { item = CommonFunction.substring(text1, num, "Array(", ");", ref num).Trim(); if (item != string.Empty) { list2.Add(item); } } foreach (string str in list2) { list4 = CommonFunction.SeperateStringBySymbol2(str, ","); if (list4.Count >= 7) { MatchNew new2 = new MatchNew(); switch (type1) { case EnumCollection.eGameType.Today: case EnumCollection.eGameType.Running: new2.set_League(CommonFunction.TrimSymbol(list4[3], "'").Trim()); new2.set_HomeName(CommonFunction.TrimSymbol(list4[5], "'").Trim()); new2.set_AwayName(CommonFunction.TrimSymbol(list4[6], "'").Trim()); break; case EnumCollection.eGameType.Early: new2.set_League(CommonFunction.TrimSymbol(list4[3], "'").Trim()); new2.set_HomeName(CommonFunction.TrimSymbol(list4[6], "'").Trim()); new2.set_AwayName(CommonFunction.TrimSymbol(list4[7], "'").Trim()); break; } list3.Add(new2); } } return list3; }
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; }
public static MatchNew FindMatchByMatchBetSingleName(MatchBetNew new1, List<MatchNew> list1) { MatchNew neww3 = new MatchNew(); MatchNew new4 = new MatchNew(); new1.GenerateUpperCaseInfo(); if (new1.get_BetCoverage() == EnumCollection.eBetCoverage.FT) { if (new1.get_BetType() == EnumCollection.eBetType.HDP) { foreach (MatchNew new3 in list1) { if ((new3.get_Type() == EnumCollection.eMatchType.Match) && (((((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_FTHDP())) & (new1.get_HomeColor() == new3.get_FTHomeColor())) & (new1.get_AwayColor() == new3.get_FTAwayColor()))) { return new3; } } return new4; } foreach (MatchNew new3 in list1) { if ((new3.get_Type() == EnumCollection.eMatchType.Match) && (((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_FTOU()))) { return new3; } } return new4; } if (new1.get_BetType() == EnumCollection.eBetType.HDP) { foreach (MatchNew new3 in list1) { if ((new3.get_Type() == EnumCollection.eMatchType.Match) && ((((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_HalfHDP())) & ((((new1.get_HomeColor() == new3.get_HalfHomeColor()) & (new1.get_AwayColor() == new3.get_HalfAwayColor())) & (new1.get_HDP() != "0.0")) | (new1.get_HDP() == "0.0")))) { return new3; } } return new4; } foreach (MatchNew new3 in list1) { if ((new3.get_Type() == EnumCollection.eMatchType.Match) && (((new1.get_HomeNameUpper() == new3.get_HomeName().ToUpper()) | (new1.get_AwayNameUpper() == new3.get_AwayName().ToUpper())) & (new1.get_HDP() == new3.get_HalfOU()))) { return new3; } } return new4; }
public void RaiseEventBetComplete(string text1, bool flag1, MatchNew new1, MatchBetNew new2) { BetCompleteEventHandler betCompleteEvent = this.BetCompleteEvent; if (betCompleteEvent != null) { betCompleteEvent(text1, flag1, new1, new2); } }
public static string GenerateDetailedMatchInfo(MatchNew new1, MatchBetNew new3, MatchBetNew new2, EnumCollection.eBetTarget target1, string text1, string text2) { string str4 = ""; string str3 = ""; double num = 0.0; switch (target1) { case EnumCollection.eBetTarget.FT_Home: str3 = new1.get_FTHDP(); str4 = new1.get_FT_AwayOddsString(); num = new1.get_FTHDP_Commission(); break; case EnumCollection.eBetTarget.FT_Away: str3 = new1.get_FTHDP(); str4 = new1.get_FT_HomeOddsString(); num = new1.get_FTHDP_Commission(); break; case EnumCollection.eBetTarget.FT_Over: str3 = new1.get_FTOU(); str4 = new1.get_FT_UnderOddsString(); num = new1.get_FTOU_Commission(); break; case EnumCollection.eBetTarget.FT_Under: str3 = new1.get_FTOU(); str4 = new1.get_FT_OverOddsString(); num = new1.get_FTOU_Commission(); break; case EnumCollection.eBetTarget.Half_Home: str3 = new1.get_HalfHDP(); str4 = new1.get_Half_AwayOddsString(); num = new1.get_HalfHDP_Commission(); break; case EnumCollection.eBetTarget.Half_Away: str3 = new1.get_HalfHDP(); str4 = new1.get_Half_HomeOddsString(); num = new1.get_HalfHDP_Commission(); break; case EnumCollection.eBetTarget.Half_Over: str3 = new1.get_HalfOU(); str4 = new1.get_Half_UnderOddsString(); num = new1.get_HalfOU_Commission(); break; case EnumCollection.eBetTarget.Half_Under: str3 = new1.get_HalfOU(); str4 = new1.get_Half_OverOddsString(); num = new1.get_HalfOU_Commission(); num = new1.get_HalfOU_Commission(); break; } return ("\r\n============================================================\r\n" + text1 + "\r\n============================================================\r\nLeague: " + new2.get_League() + "\r\nHome: " + new3.get_HomeName() + "\r\nAway: " + new3.get_AwayName() + "\r\nBet: " + new3.get_SelectedMatch() + "\r\nHDP: " + new3.get_HDP() + "\r\nOdd: " + new3.get_OddsString() + "\r\nNew HDP: " + new2.get_HDP() + "\r\nNew Odd: " + new2.get_OddsString() + "\r\n" + text2 + " HDP: " + str3 + "\r\n" + text2 + " Opponent Odd: " + str4 + "\r\n" + text2 + " Commission: " + num.ToString() + "\r\nAmount: " + new2.get_BetAmount() + "\r\n============================================================"); }
protected void RaiseEventGetTicketComplete(string text1, bool flag1, EnumCollection.eBetTarget target1, MatchNew new1, MatchBetNew new2, MatchNew new3, MatchBetNew new4, MatchBetNew new5) { GetTicketCompleteEventHandler getTicketCompleteEvent = this.GetTicketCompleteEvent; if (getTicketCompleteEvent != null) { getTicketCompleteEvent(text1, flag1, target1, new1, new2, new3, new4, new5); } }