public void UpdateiGold(int ID, string UsName, long iGold, string AcText) { //更新用户虚拟币 dal.UpdateiGold(ID, iGold); //更新消费记录 BCW.Model.Goldlog model = new BCW.Model.Goldlog(); model.BbTag = 0; model.Types = 0; model.PUrl = Utils.getPageUrl();//操作的文件名 model.UsId = ID; model.UsName = UsName; model.AcGold = iGold; model.AfterGold = GetGold(ID);//更新后的币数 model.AcText = AcText; model.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(model); #region 点值抽奖接口 16/08/15 try { new BCW.Draw.draw().AddjfbyiGold(ID, UsName, iGold, AcText); } catch { } #endregion }
public void UpdateiMoney(int ID, string UsName, long iMoney, string AcText) { //更新用户虚拟币 dal.UpdateiMoney(ID, iMoney); //更新消费记录 BCW.Model.Goldlog model = new BCW.Model.Goldlog(); model.BbTag = 0; model.Types = 1; model.PUrl = Utils.getPageUrl();//操作的文件名 model.UsId = ID; model.UsName = UsName; model.AcGold = iMoney; model.AfterGold = GetMoney(ID);//更新后的元数 model.AcText = AcText; model.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(model); }
//机器人购买 private void PlayXK3_Robot() { //得到随机的UsID int meid = GetUsID(); if (meid == 0) { Response.Write("随机机器人ID出错.error1<br/>"); Response.End(); } if (!new BCW.BLL.User().ExistsID(meid)) { Response.Write("随机机器人ID不存在.error1<br/>"); Response.End(); } //得到随机的类型 int num1 = GetPtype(); //得到随机投注的酷币 long Price = GetPayCent(); //xml限定每个机器人购买次数 int buycou = Convert.ToInt32(ub.GetSub("XK3ROBOTBUY", xmlPath)); int dnu = 0; string dsb = DateTime.Now.ToString("yyMMdd"); dnu = int.Parse(dsb + "001"); string where1 = string.Empty; where1 = "ORDER BY Lottery_issue DESC"; BCW.XinKuai3.Model.XK3_Internet_Data model = new BCW.XinKuai3.BLL.XK3_Internet_Data().Getxk3listLast(where1);//最后一期 //string issue2 = (Int64.Parse(model.Lottery_issue) + 1).ToString();//下一个开奖期号 string issue3 = Utils.Right(model.Lottery_issue.ToString(), 3);//本期开奖期号的后3位 string issue33 = model.Lottery_issue; BCW.XinKuai3.Model.XK3_Bet modelBuy = new BCW.XinKuai3.Model.XK3_Bet(); if (IsOpen() == true) { modelBuy.Lottery_issue = issue33; } else { if (issue3 == "078") { modelBuy.Lottery_issue = dnu.ToString(); } else { modelBuy.Lottery_issue = (issue33);//投注期号 } } //计数出该机器人投注的次数是否大于xml限定次数 int count = new BCW.XinKuai3.BLL.XK3_Bet().GetXK3_Bet_GetRecordCount(" UsID=" + meid + " and Lottery_issue='" + modelBuy.Lottery_issue + "'"); if ((count < buycou) || (buycou == 0)) { if (num1 == 9)//1大2小 { int a11 = int.Parse(Get_DXSD()); if (a11 == 1) { modelBuy.DaXiao = "1"; modelBuy.Odds = (decimal)Da; } else { modelBuy.DaXiao = "2"; modelBuy.Odds = (decimal)Xiao; } modelBuy.Play_Way = 9; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DanShuang = ""; } else if (num1 == 10)//1单2双 { int a22 = int.Parse(Get_DXSD()); if (a22 == 1) { modelBuy.DanShuang = "2"; modelBuy.Odds = (decimal)Shuang; } else { modelBuy.DanShuang = "1"; modelBuy.Odds = (decimal)Dan; } modelBuy.Play_Way = 10; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; } //和值4-17 else if (num1 == 1) { Random a3 = new Random(); int a33 = a3.Next(1, 15); switch (a33) { case 1: modelBuy.Sum = "4"; break; case 2: modelBuy.Sum = "5"; break; case 3: modelBuy.Sum = "6"; break; case 4: modelBuy.Sum = "7"; break; case 5: modelBuy.Sum = "8"; break; case 6: modelBuy.Sum = "9"; break; case 7: modelBuy.Sum = "10"; break; case 8: modelBuy.Sum = "11"; break; case 9: modelBuy.Sum = "12"; break; case 10: modelBuy.Sum = "13"; break; case 11: modelBuy.Sum = "14"; break; case 12: modelBuy.Sum = "15"; break; case 13: modelBuy.Sum = "16"; break; case 14: modelBuy.Sum = "17"; break; } modelBuy.Play_Way = 1; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } //三同号通选 else if (num1 == 2) { modelBuy.Play_Way = 2; modelBuy.Sum = ""; modelBuy.Three_Same_All = "1"; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } //三同号单选 else if (num1 == 3) { int a55 = int.Parse(Get_danxuan()); switch (a55) { case 1: modelBuy.Three_Same_Single = "111"; break; case 2: modelBuy.Three_Same_Single = "222"; break; case 3: modelBuy.Three_Same_Single = "333"; break; case 4: modelBuy.Three_Same_Single = "444"; break; case 5: modelBuy.Three_Same_Single = "555"; break; case 6: modelBuy.Three_Same_Single = "666"; break; } modelBuy.Play_Way = 3; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } else if (num1 == 4)//三不同号-------------------再随机3个不同的数字 { //随机产生3条不重复的1-6的数 int[] result = new int[6]; for (int i = 0; i < 6; i++) { result[i] = i + 1; } for (int j = 5; j > 0; j--) { Random r = new Random(); int index = r.Next(0, j); int temp = result[index]; result[index] = result[j]; result[j] = temp; } //冒泡排序 从大到小 for (int i = 0; i < 3; i++) { for (int j = i + 1; j < 3; j++) { if (result[j] < result[i]) { int temp = result[i]; result[i] = result[j]; result[j] = temp; } } } modelBuy.Three_Same_Not = (result[0]).ToString() + (result[1]).ToString() + (result[2]).ToString(); modelBuy.Play_Way = 4; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } else if (num1 == 5)//三连号 { modelBuy.Play_Way = 5; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = "1"; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } //二同号复选 else if (num1 == 6) { int a66 = int.Parse(Get_danxuan()); switch (a66) { case 1: modelBuy.Two_Same_All = "11"; break; case 2: modelBuy.Two_Same_All = "22"; break; case 3: modelBuy.Two_Same_All = "33"; break; case 4: modelBuy.Two_Same_All = "44"; break; case 5: modelBuy.Two_Same_All = "55"; break; case 6: modelBuy.Two_Same_All = "66"; break; } modelBuy.Play_Way = 6; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } else if (num1 == 7)//二同号单选 { modelBuy.Play_Way = 7; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = Get_Two_Same_Single(); modelBuy.Two_dissame = ""; modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } else if (num1 == 8)//二不同号 { modelBuy.Play_Way = 8; modelBuy.Sum = ""; modelBuy.Three_Same_All = ""; modelBuy.Three_Same_Single = ""; modelBuy.Three_Same_Not = ""; modelBuy.Three_Continue_All = ""; modelBuy.Two_Same_All = ""; modelBuy.Two_Same_Single = ""; modelBuy.Two_dissame = Get_Two_dissame2(); modelBuy.DaXiao = ""; modelBuy.DanShuang = ""; modelBuy.Odds = 1; } modelBuy.UsID = meid; //用户id modelBuy.Input_Time = DateTime.Now; //投注时间 modelBuy.Zhu = 1; //注数----默认全部投一注。 modelBuy.DanTuo = "0"; //胆拖 modelBuy.State = 0; //未开奖 modelBuy.GetMoney = 0; //获得多少酷币 modelBuy.isRobot = 1; modelBuy.Zhu_money = Price; //每注投多少钱 modelBuy.PutGold = Price * modelBuy.Zhu; //总投了多少钱 long gold = new BCW.BLL.User().GetGold(meid); long prices = Convert.ToInt64(Price * modelBuy.Zhu); string mename = new BCW.BLL.User().GetUsName(meid); if (gold < prices) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = 0; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = prices; modelx.AfterGold = gold + prices;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + prices + ") where id=" + meid + ""); } long xPrices = Utils.ParseInt64(ub.GetSub("XK3Price", xmlPath)); if (xPrices > 0) { long oPrices = 0; DataSet ds; if (IsOpen() == true) { ds = new BCW.XinKuai3.BLL.XK3_Bet().GetList("PutGold", "UsID=" + meid + " and Lottery_issue='" + issue33 + "'"); } else { if (issue3 == "078") { ds = new BCW.XinKuai3.BLL.XK3_Bet().GetList("PutGold", "UsID=" + meid + " and Lottery_issue='" + dnu + "'"); } else { ds = new BCW.XinKuai3.BLL.XK3_Bet().GetList("PutGold", "UsID=" + meid + " and Lottery_issue='" + issue33 + "'"); } } DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { int drs = int.Parse(dr[0].ToString()); oPrices = oPrices + drs; } if (oPrices + prices > xPrices) { Response.End(); } } //new BCW.BLL.User().UpdateiGold(meid, mename, -prices, 12);//新快3----更新排行榜与扣钱 if (IsOpen() == true) { new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第" + issue33 + "期投注消费"); } else { if (issue3 == "078") { new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第" + dnu.ToString() + "期投注消费"); } else { new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第" + issue33 + "期投注消费"); } } int id = new BCW.XinKuai3.BLL.XK3_Bet().Add_Robot(modelBuy); new BCW.BLL.User().UpdateTime(meid, 5);// 更新会员在线时长 ////更新排行榜 //if (!(new BCW.XinKuai3.BLL.XK3_Toplist().Exists_usid(meid))) //{ // BCW.XinKuai3.Model.XK3_Toplist model_2 = new BCW.XinKuai3.Model.XK3_Toplist(); // model_2.UsId = meid; // model_2.UsName = mename; // model_2.WinGold = 0; // model_2.PutGold = prices; // new BCW.XinKuai3.BLL.XK3_Toplist().Add(model_2); //} //else //{ // BCW.XinKuai3.Model.XK3_Toplist model_1 = new BCW.XinKuai3.BLL.XK3_Toplist().GetXK3_meid(meid); // long all_prices = model_1.PutGold + prices; // new BCW.XinKuai3.BLL.XK3_Toplist().Update_gold(meid, all_prices); //} //动态 string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/xk3.aspx]" + GameName + "[/url]下注**" + ub.Get("SiteBz") + "";//" + modelBuy.Zhu * modelBuy.Zhu_money + " new BCW.BLL.Action().Add(1001, id, meid, "", wText); } }
//机器人购买 private void Play_jqcRobot() { int meid = GetUsID();//得到随机的UsID if (!new BCW.BLL.User().ExistsID(meid)) { Response.Write("随机机器人ID不存在.error1<br/>"); Response.End(); } if (meid > 0) { //随机延时 System.Threading.Thread.Sleep(R(1, 11) * 1000); int beilv = GetPayCent(); //得到随机投注的倍率 int buycou = Convert.ToInt32(ub.GetSub("ROBOTBUY", xmlPath)); //xml限定每个机器人购买次数 int zhuPrice = Convert.ToInt32(ub.GetSub("zhuPrice", xmlPath)); //每注酷币 long Price = zhuPrice * beilv; //随机得到投注号码 string votenum = string.Empty; int[] a = new int[] { 0, 1, 2, 3 }; string s = string.Empty; Random ran = new Random(); for (int j = 0; j < 8; j++) { s = a[ran.Next(0, 4)].ToString(); if (j == 7) { votenum += s; } else { votenum += s + "#"; } } string where1 = "where phase!='' and Sale_Start < getdate() and Sale_End > getdate() order by newid()";//查询数据库可以下注的随机一期 BCW.JQC.Model.JQC_Internet model = new BCW.JQC.BLL.JQC_Internet().GetJQC_Internet_model(where1); if (model.phase > 0) { BCW.JQC.Model.JQC_Bet modelBuy = new BCW.JQC.Model.JQC_Bet(); //计数出该机器人投注的次数是否大于xml限定次数 int count = new BCW.JQC.BLL.JQC_Bet().GetRecordCount(" UsID=" + meid + " and Lottery_issue='" + model.phase + "'"); if ((count < buycou) || (buycou == 0)) { modelBuy.Lottery_issue = model.phase; modelBuy.UsID = meid; modelBuy.Input_Time = DateTime.Now; modelBuy.State = 0; modelBuy.isRobot = 1; modelBuy.Zhu = 1; modelBuy.Zhu_money = zhuPrice; modelBuy.GetMoney = 0; modelBuy.VoteRate = beilv; modelBuy.PutGold = Price; modelBuy.VoteNum = votenum; long gold = new BCW.BLL.User().GetGold(meid); long prices = Price; string mename = new BCW.BLL.User().GetUsName(meid); if (gold < prices) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = 0; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = prices; modelx.AfterGold = gold + prices;//更新后的币数 modelx.AcText = "系统进球彩机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + prices + ") where id=" + meid + ""); } long xPrices = Utils.ParseInt64(ub.GetSub("BigPrice", xmlPath)); if (xPrices > 0) { long oPrices = 0; DataSet ds = new BCW.JQC.BLL.JQC_Bet().GetList("PutGold", "UsID=" + meid + " and Lottery_issue='" + model.phase + "'"); DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { int drs = int.Parse(dr[0].ToString()); oPrices = oPrices + drs; } if (oPrices + prices > xPrices) { Response.End(); } } int id = new BCW.JQC.BLL.JQC_Bet().Add(modelBuy); new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "进球彩第" + model.phase + "期投注消费-标识ID" + id + ""); //更新奖池 BCW.JQC.Model.JQC_Jackpot jack = new BCW.JQC.Model.JQC_Jackpot(); jack.UsID = meid; jack.InPrize = Price; jack.OutPrize = 0; //jack.Jackpot = Price + new BCW.JQC.BLL.JQC_Jackpot().GetGold();//实时奖池 jack.Jackpot = Price + new BCW.JQC.BLL.JQC_Jackpot().GetGold_phase(model.phase); jack.AddTime = DateTime.Now; jack.phase = model.phase; jack.type = 0;//玩家下注 jack.BetID = id; new BCW.JQC.BLL.JQC_Jackpot().Add(jack); new BCW.BLL.User().UpdateTime(meid, 5); //更新会员在线时长 //动态 string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + new BCW.BLL.User().GetUsName(meid) + "[/url]在[url=/bbs/game/jqc.aspx]" + GameName + "[/url]第" + model.phase + "期下注" + Price + "" + ub.Get("SiteBz") + ""; new BCW.BLL.Action().Add(1014, id, meid, "", wText); } } Response.Write("ok1"); } else { Response.Write("error1.机器人为空."); } }
/// <summary> /// 增加一条数据 /// </summary> public int Add(BCW.Model.Goldlog model) { return(dal.Add(model)); }
//机器人购买 private void PlayHc1_Robot() { //得到随机的UsID int meid = GetUsID(); if (meid == 0) { Response.Write("随机机器人ID出错.error1<br/>"); Response.End(); } if (!new BCW.BLL.User().ExistsID(meid)) { Response.Write("随机机器人ID不存在.error1<br/>"); Response.End(); } //得到随机的类型 int num1 = GetPtype(); //得到随机投注的酷币 long Price = GetPayCent(); //xml限定每个机器人购买次数 int buycou = 0; try { buycou = Convert.ToInt32(ub.GetSub("hc1ROBOTBUY", xmlPath)); } catch { buycou = 0; } long Gold = new BCW.BLL.User().GetGold(meid); #region 判断机器人币够不够投注 if (Gold < Price || Gold < 0) { Response.Write("<b>机器人" + meid + "币不够!请换一个机器人或者给该机器人充值 </b><br />"); } else { #region 机器人投注 int dnu = 0; string dsb = DateTime.Now.ToString("yyMMdd"); dnu = int.Parse(dsb + "001"); string where1 = string.Empty; where1 = "ORDER BY ID DESC"; //最后一期 DataSet ds = new BCW.BLL.Game.HcList().GetList("top 1 id", "State=0 order by EndTime desc"); int maxid = Convert.ToInt32(ds.Tables[0].Rows[0][0]); BCW.Model.Game.HcList modelbuy1 = new BCW.BLL.Game.HcList().GetHcList(maxid); BCW.Model.Game.HcPay modelbuy = new BCW.Model.Game.HcPay(); int count = new BCW.BLL.Game.HcList().GetcountRebot(meid); if ((count < buycou) || (buycou == 0)) { #region 大小单双投注 if (num1 == 5)//1大2小/3单/4双 { int a11 = int.Parse(Get_DXSD()); modelbuy.Types = 5; if (a11 == 1) { modelbuy.Vote = "大"; } else if (a11 == 2) { modelbuy.Vote = "小"; } else if (a11 == 3) { modelbuy.Vote = "单"; } else { modelbuy.Vote = "双"; } } #endregion //选号玩法 else if (num1 == 1) { modelbuy.Types = 1; Random a3 = new Random(); int a33 = a3.Next(1, 37); modelbuy.Vote = Convert.ToString(a33); } //生肖玩法 else if (num1 == 2) { modelbuy.Types = 2; Random a4 = new Random(); int a44 = a4.Next(1, 13); switch (a44) { case 1: modelbuy.Vote = "鼠"; break; case 2: modelbuy.Vote = "牛"; break; case 3: modelbuy.Vote = "虎"; break; case 4: modelbuy.Vote = "兔"; break; case 5: modelbuy.Vote = "龙"; break; case 6: modelbuy.Vote = "蛇"; break; case 7: modelbuy.Vote = "马"; break; case 8: modelbuy.Vote = "羊"; break; case 9: modelbuy.Vote = "猴"; break; case 10: modelbuy.Vote = "鸡"; break; case 11: modelbuy.Vote = "狗"; break; case 12: modelbuy.Vote = "猪"; break; } } //方位玩法 else if (num1 == 3) { modelbuy.Types = 3; Random a5 = new Random(); int a55 = a5.Next(1, 5); switch (a55) { case 1: modelbuy.Vote = "东"; break; case 2: modelbuy.Vote = "南"; break; case 3: modelbuy.Vote = "西"; break; case 4: modelbuy.Vote = "北"; break; } } else if (num1 == 4)//四季玩法 { modelbuy.Types = 4; Random a6 = new Random(); int a66 = a6.Next(1, 5); switch (a66) { case 1: modelbuy.Vote = "春"; break; case 2: modelbuy.Vote = "夏"; break; case 3: modelbuy.Vote = "秋"; break; case 4: modelbuy.Vote = "东"; break; } } //六肖中奖 else if (num1 == 6) { modelbuy.Types = 6; int a66 = 0; //随机生成6个生肖 string rand = ""; while (a66 < 6) { rand += GetRandomNum1()[a66]; rand += ","; a66++; } modelbuy.Vote = rand; } //尾数大小 else if (num1 == 7) { modelbuy.Types = 7; Random a7 = new Random(); int a77 = a7.Next(0, 2); switch (a77) { case 0: modelbuy.Vote = "大"; break; case 1: modelbuy.Vote = "小"; break; } } //尾数单双 else if (num1 == 8) { modelbuy.Types = 8; Random a8 = new Random(); int a88 = a8.Next(0, 2); switch (a88) { case 0: modelbuy.Vote = "单"; break; case 1: modelbuy.Vote = "双"; break; } } //家禽0野兽1 else if (num1 == 9) { modelbuy.Types = 9; Random a9 = new Random(); int a99 = a9.Next(0, 2); switch (a99) { case 0: modelbuy.Vote = "家禽"; break; case 1: modelbuy.Vote = "野兽"; break; } } modelbuy.UsID = meid; //用户id modelbuy.AddTime = DateTime.Now; //投注时间 modelbuy.State = 0; //未开奖 modelbuy.WinCent = 0; //获得多少酷币 modelbuy.IsSpier = 1; modelbuy.BzType = 0; modelbuy.Result = ""; //开奖结果 modelbuy.PayCent = Price; //每注投多少钱 modelbuy.PayCents = Price; //总投了多少钱 modelbuy.CID = modelbuy1.CID; //最新投注期数 long gold = new BCW.BLL.User().GetGold(meid); long prices = Convert.ToInt64(Price); string mename = new BCW.BLL.User().GetUsName(meid); modelbuy.UsName = mename;//用户名字 if (gold < prices) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = prices; modelx.AfterGold = gold + prices;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + prices + ") where id=" + meid + ""); } new BCW.BLL.User().UpdateiGold(meid, mename, -prices, 1001);//新快3----更新排行榜与扣钱 new BCW.BLL.Game.HcPay().Add(modelbuy); new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "好彩1" + modelbuy1.CID + "期投注消费"); new BCW.BLL.Game.HcList().Update1(modelbuy1.CID, prices, 1); //更新下注总额和下注额 ChanageOnline(meid); //邵广林 增加机器人在线时长 //动态 string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/hc1.aspx]" + GameName + "[/url]下注**" + ub.Get("SiteBz") + ""; //" + prices + " new BCW.BLL.Action().Add(1001, 1, meid, "", wText); } #endregion } #endregion }
/// <summary> /// 机器人购买自动兑奖 /// </summary> private void stkRobotPlay() { #region 机器人下注 //得到随机的UsID int meid = GetUsID(); if (meid == 0) { return; } if (!new BCW.BLL.User().Exists(meid)) { Response.Write("机器人不存在"); Response.End(); } ChanageOnline(meid); //得到随机的类型 int pType = GetPtype(); //得到投注的酷币 int Price = 0; string[] ppp = ub.GetSub("StkRoBotCent", "/Controls/stkguess.xml").Split('#'); Random ran = new Random(); int k = ran.Next(0, (ppp.Length)); Price = Convert.ToInt32(ppp[k]); //每个机器人每一期的最高购买次数 int buyCount = Convert.ToInt32(ub.GetSub("StkRoBotbuyCount", xmlPath)); double Odds = 0; double stkOdds1 = Utils.ParseDouble(ub.GetSub("StkOdds0", xmlPath)); //0 double stkOdds2 = Utils.ParseDouble(ub.GetSub("StkOdds1", xmlPath)); //1 double stkOdds3 = Utils.ParseDouble(ub.GetSub("StkOdds2", xmlPath)); //2 double stkOdds4 = Utils.ParseDouble(ub.GetSub("StkOdds3", xmlPath)); //3 double stkOdds5 = Utils.ParseDouble(ub.GetSub("StkOdds4", xmlPath)); //4 double stkOdds6 = Utils.ParseDouble(ub.GetSub("StkOdds5", xmlPath)); //5 double stkOdds7 = Utils.ParseDouble(ub.GetSub("StkOdds6", xmlPath)); //6 double stkOdds8 = Utils.ParseDouble(ub.GetSub("StkOdds7", xmlPath)); //7 double stkOdds9 = Utils.ParseDouble(ub.GetSub("StkOdds8", xmlPath)); //8 double stkOdds10 = Utils.ParseDouble(ub.GetSub("StkOdds9", xmlPath)); //9 double stkOdds11 = Utils.ParseDouble(ub.GetSub("StkOdds10", xmlPath)); //单 double stkOdds12 = Utils.ParseDouble(ub.GetSub("StkOdds11", xmlPath)); //双 double stkOdds13 = Utils.ParseDouble(ub.GetSub("StkOdds12", xmlPath)); //大 double stkOdds14 = Utils.ParseDouble(ub.GetSub("StkOdds13", xmlPath)); //小 double stkOdds15 = Utils.ParseDouble(ub.GetSub("StkOdds14", xmlPath)); //合单 double stkOdds16 = Utils.ParseDouble(ub.GetSub("StkOdds15", xmlPath)); //合双 double stkOdds17 = Utils.ParseDouble(ub.GetSub("StkOdds16", xmlPath)); //合大 double stkOdds18 = Utils.ParseDouble(ub.GetSub("StkOdds17", xmlPath)); //合小 string mename = new BCW.BLL.User().GetUsName(meid); BCW.Model.Game.Stklist model = new BCW.BLL.Game.Stklist().GetStklist(); if (model.EndTime > DateTime.Now && DateTime.Now > model.BeginTime) { BCW.Model.Game.Stkpay modelPay = new BCW.Model.Game.Stkpay(); //计数出该机器人投注的次数是否大于xml限定次数 int count = new BCW.BLL.Game.Stkpay().GetRecordCount(" UsID=" + meid + " and StkId=" + model.ID + ""); Random r = new Random(); if (count < buyCount) { if (pType == 0)//0 { Odds = stkOdds1; } else if (pType == 1)//1 { Odds = stkOdds2; } else if (pType == 2)//2 { Odds = stkOdds3; } else if (pType == 3)//3 { Odds = stkOdds4; } else if (pType == 4)//4 { Odds = stkOdds5; } else if (pType == 5)//5 { Odds = stkOdds6; } else if (pType == 6)//6 { Odds = stkOdds7; } else if (pType == 7)//7 { Odds = stkOdds8; } else if (pType == 8)//8 { Odds = stkOdds9; } else if (pType == 9)//9 { Odds = stkOdds10; } else if (pType == 10)//单 { Odds = stkOdds11; } else if (pType == 11)//双 { Odds = stkOdds12; } else if (pType == 12)//大 { Odds = stkOdds13; } else if (pType == 13)//小 { Odds = stkOdds14; } else if (pType == 14)//合单 { Odds = stkOdds15; } else if (pType == 15)//双 { Odds = stkOdds16; } else if (pType == 16)//大 { Odds = stkOdds17; } else if (pType == 17)//小 { Odds = stkOdds18; } long gold = 0; gold = new BCW.BLL.User().GetGold(meid); long prices = Convert.ToInt64(Price); long SmallPay = Utils.ParseInt64(ub.GetSub("StkSmallPay", xmlPath)); long BigPay = Utils.ParseInt64(ub.GetSub("StkBigPay", xmlPath)); if (prices >= SmallPay && prices <= BigPay) { long xPrices = Utils.ParseInt64(ub.GetSub("StkMaxpay", xmlPath)); if (xPrices > 0 && gold >= 0) { long oPrices = new BCW.BLL.Game.Stkpay().GetSumPrices(meid, model.ID); if (oPrices + prices <= xPrices) { #region 每期每玩法每ID投注上限 long ptyPrices = 0; try { ptyPrices = Convert.ToInt64(OutOddscid(pType)); } catch { ptyPrices = 0; } if (ptyPrices > 0) { long oPrices2 = new BCW.BLL.Game.Stkpay().GetSumPrices(meid, model.ID, pType); if (oPrices + prices > ptyPrices) { Response.Write("" + meid + "本期竞猜" + OutType(pType) + "下注已达上限"); Response.End(); } } #endregion #region //浮动限制 long xPricesc = 0; if (pType < 10) { xPricesc = OutOddsc(pType); if (xPricesc > 0) { long oPricesc = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(pType, model.ID); if (oPricesc + prices > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } } else if (pType == 10 || pType == 11)//单双 { xPricesc = OutOddsc(10); long Cent = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(10, model.ID); long Cent2 = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(11, model.ID); if (pType == 10) { if (Math.Abs(Cent + prices - Cent2) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } if (pType == 11) { if (Math.Abs(Cent2 + prices - Cent) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } } else if (pType == 12 || pType == 13)//大小 { xPricesc = OutOddsc(12); long Cent = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(12, model.ID); long Cent2 = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(13, model.ID); if (pType == 12) { if (Math.Abs(Cent + prices - Cent2) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } if (pType == 13) { if (Math.Abs(Cent2 + prices - Cent) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } } else if (pType == 14 || pType == 15)//合单双 { xPricesc = OutOddsc(14); long Cent = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(14, model.ID); long Cent2 = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(15, model.ID); if (pType == 14) { if (Math.Abs(Cent + prices - Cent2) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } if (pType == 15) { if (Math.Abs(Cent2 + prices - Cent) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } } else if (pType == 16 || pType == 17)//合大小 { xPricesc = OutOddsc(16); long Cent = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(16, model.ID); long Cent2 = new BCW.BLL.Game.Stkpay().GetSumPricesbytype(17, model.ID); if (pType == 16) { if (Math.Abs(Cent + prices - Cent2) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } if (pType == 17) { if (Math.Abs(Cent2 + prices - Cent) > xPricesc) { Response.Write("投注达到限额ok1"); Response.End(); } } } #endregion if (gold < prices) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = 0; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = prices; modelx.AfterGold = (gold + prices);//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + prices + ") where ID=" + meid + ""); { modelPay.StkId = model.ID; modelPay.UsID = meid; modelPay.UsName = mename; modelPay.Types = pType; modelPay.WinNum = 0; modelPay.Odds = Convert.ToDecimal(Odds); modelPay.BuyCent = prices; modelPay.WinCent = 0; modelPay.AddTime = DateTime.Now; modelPay.State = 0; modelPay.bzType = 0; //酷币 modelPay.isSpier = 1; //机器人 int id = new BCW.BLL.Game.Stkpay().Add(modelPay); //动态投注后记录投注信息 string wText = string.Empty; new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "在-[url=/bbs/game/stkguess.aspx]" + GameName + "[/url]" + model.ID + "(" + model.EndTime.ToString("MM-dd") + ")-|押" + OutType(pType) + "|赔率:" + Odds + "|标识ID:" + id + ""); wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/stkguess.aspx]" + GameName + "[/url]下注**" + "" + ub.Get("SiteBz") + "";//+ prices " + OutType(pType) + " new BCW.BLL.Action().Add(11, id, meid, "", wText); } } else { modelPay.StkId = model.ID; modelPay.UsID = meid; modelPay.UsName = mename; modelPay.Types = pType; modelPay.WinNum = 0; modelPay.Odds = Convert.ToDecimal(Odds); modelPay.BuyCent = prices; modelPay.WinCent = 0; modelPay.AddTime = DateTime.Now; modelPay.State = 0; modelPay.bzType = 0; //酷币 modelPay.isSpier = 1; //机器人 int id = new BCW.BLL.Game.Stkpay().Add(modelPay); //动态投注后记录投注信息 string wText = string.Empty; new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "在-[url=/bbs/game/stkguess.aspx]" + GameName + "[/url]" + model.ID + "(" + model.EndTime.ToString("MM-dd") + ")-|押" + OutType(pType) + "|赔率:" + Odds + "|标识ID:" + id + ""); wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/stkguess.aspx]" + GameName + "[/url]下注**" + "" + ub.Get("SiteBz") + "";//+ prices 竞猜" + OutType(pType) + " new BCW.BLL.Action().Add(11, id, meid, "", wText); } } } } } } #endregion #region 机器人自动兑奖 string RoBot = ub.GetSub("StkRoBotID", xmlPath); string[] RoBotID = RoBot.Split('#'); for (int i = 0; i < RoBotID.Length; i++) { if (RoBotID[i] != "") { meid = Convert.ToInt32(RoBotID[i].Replace(" ", "")); string mename1 = new BCW.BLL.User().GetUsName(meid); DataSet model2 = new BCW.BLL.Game.Stkpay().GetList("ID", "UsID=" + meid + " and isSpier=1 and WinCent > 0 and State!=2 "); if (model2 != null && model2.Tables[0].Rows.Count > 0) { for (int i2 = 0; i2 < model2.Tables[0].Rows.Count; i2++) { int pid = 0; try { pid = Convert.ToInt32(model2.Tables[0].Rows[0][i2]); } catch { } if (new BCW.BLL.Game.Stkpay().ExistsReBot(pid, meid)) { if (new BCW.BLL.Game.Stkpay().getState(pid) != 2) { //操作币 BCW.Model.Game.Stkpay model1 = new BCW.BLL.Game.Stkpay().GetStkpay(pid); int number = model1.StkId; BCW.Model.Game.Stklist idd = new BCW.BLL.Game.Stklist().GetStklist(number); long winMoney = Convert.ToInt64(model1.WinCent); int bzType = new BCW.BLL.Game.Stkpay().GetbzType(pid); //税率 long SysTax = 0; int Tax = Utils.ParseInt(ub.GetSub("StkTax", xmlPath)); if (Tax > 0) { SysTax = Convert.ToInt64(winMoney * Tax * 0.01); } winMoney = winMoney - SysTax; new BCW.BLL.User().UpdateiGold(meid, mename1, winMoney, "" + GameName + "兑奖-" + "[url=./game/stkguess.aspx?act=view&id=" + idd.ID + "&ptype=2]" + number + "(" + idd.EndTime.ToString("MM-dd") + ")" + "[/url]" + "-标识ID:" + pid + ""); new BCW.BLL.Game.Stkpay().UpdateState(pid); Response.Write("" + GameName + "机器人" + meid + "自动兑奖!ok1<br />"); } } } } } } #endregion }
//应战操作 private void PlayDxdice2(int meid) { if (meid == 0) { meid = GetUsID(); } ChanageOnline(meid); DataSet ds = new BCW.BLL.Game.Dxdice().GetList("ID", "Types=0 and State=0 and UsID<>" + meid + " and AddTime<'" + DateTime.Now.AddMinutes(-20) + "' ORDER BY NEWID()"); if (ds != null && ds.Tables[0].Rows.Count > 0) { int TNum = Utils.ParseInt(ub.GetSub("DxdiceTNum", xmlPath)); if (TNum > 0) { int TCount2 = new BCW.BLL.Game.Dxdice().GetCount2(meid); if (TCount2 > TNum) { int TCount = new BCW.BLL.Game.Dxdice().GetCount(meid); if ((TCount2 - TNum) > Convert.ToInt32(TCount * TNum)) { PlayDxdice(0); meid = GetUsID(); } } } string mename = new BCW.BLL.User().GetUsName(meid); int id = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); BCW.Model.Game.Dxdice model = new BCW.BLL.Game.Dxdice().GetDxdice(id); long gold = 0; string bzText = string.Empty; if (model.BzType == 0) { gold = new BCW.BLL.User().GetGold(meid); bzText = ub.Get("SiteBz"); } else { gold = new BCW.BLL.User().GetMoney(meid); bzText = ub.Get("SiteBz2"); } if (model.Price > gold) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = model.BzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (model.BzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + ""); } } //操作币 long winMoney = model.Price; //税率 long SysTax = 0; int Tax = Utils.ParseInt(ub.GetSub("DxdiceTar", xmlPath)); if (Tax > 0) { SysTax = Convert.ToInt64(winMoney * Tax * 0.01); } winMoney = winMoney - SysTax; //庄家是不是机器人 bool IsRobot = false; if (new BCW.BLL.User().GetIsSpier(model.UsID) == 1) { IsRobot = true; } Random rd = new Random(unchecked ((int)DateTime.Now.Ticks)); int C = rd.Next(1, 7); int D = rd.Next(1, 7); int IsWin = 0; int iWin = GetiWin(model.DxdiceA, "" + C + "#" + D + ""); if (iWin == 3) { //消费 if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, winMoney, 10); new BCW.BLL.User().UpdateiGoldTop(model.UsID, model.UsName, -model.Price, 10); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, winMoney, "掷骰消费"); } //内线与动态 if (!IsRobot) { new BCW.BLL.Guest().Add(1, model.UsID, model.UsName, "您的掷骰已经结束,参与庄家[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url],结果对方掷了" + C + "#" + D + "点战胜了你掷的" + model.DxdiceA + "点![url=/bbs/game/dxdice.aspx?act=add]我要继续掷骰[/url]"); } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/dxdice.aspx]大小掷骰[/url]以" + C + "#" + D + "点战胜了" + model.UsName + "掷的" + model.DxdiceA + "点(赢" + model.Price + "" + bzText + ")"; new BCW.BLL.Action().Add(18, id, 0, "", wText); } else if (iWin == 2) { IsWin = 2;//打平 //内线与动态 if (!IsRobot) { new BCW.BLL.Guest().Add(1, model.UsID, model.UsName, "您的掷骰已经结束,参与庄家[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url],结果对方掷了" + C + "#" + D + "点打平了你掷的" + model.DxdiceA + "点![url=/bbs/game/dxdice.aspx?act=case]马上兑奖[/url]"); } else//自动兑换 { new BCW.BLL.Game.Dxdice().UpdateState(id, 2); if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(model.UsID, model.Price, "掷骰消费"); } else { new BCW.BLL.User().UpdateiMoney(model.UsID, model.Price, "掷骰消费"); } } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/dxdice.aspx]大小掷骰[/url]以" + C + "#" + D + "点打平" + model.UsName + "掷的" + model.DxdiceA + "点"; new BCW.BLL.Action().Add(18, id, 0, "", wText); } else { IsWin = 1; //消费 if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, -model.Price, 10); new BCW.BLL.User().UpdateiGoldTop(model.UsID, model.UsName, winMoney, 10); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, -model.Price, "掷骰消费"); } //内线与动态 if (!IsRobot) { new BCW.BLL.Guest().Add(1, model.UsID, model.UsName, "您的掷骰已经结束,参与庄家[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url],结果对方掷了" + C + "#" + D + "点负了你掷的" + model.DxdiceA + "点![url=/bbs/game/dxdice.aspx?act=case]马上兑奖[/url]"); } else//自动兑换 { new BCW.BLL.Game.Dxdice().UpdateState(id, 2); if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(model.UsID, winMoney, "掷骰消费"); } else { new BCW.BLL.User().UpdateiMoney(model.UsID, winMoney, "掷骰消费"); } } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/dxdice.aspx]大小掷骰[/url]以" + C + "#" + D + "点负了" + model.UsName + "掷的" + model.DxdiceA + "点(输" + model.Price + "" + bzText + ")"; new BCW.BLL.Action().Add(18, id, 0, "", wText); } //更新掷骰记录 BCW.Model.Game.Dxdice m = new BCW.Model.Game.Dxdice(); m.ID = id; m.ReID = meid; m.DxdiceB = C + "#" + D; m.ReName = mename; m.ReTime = DateTime.Now; m.IsWin = IsWin; m.State = 1; new BCW.BLL.Game.Dxdice().UpdateState(m); } }
//下注操作 private void PlayDxdice(int meid) { if (meid == 0) { meid = GetUsID(); } ChanageOnline(meid); //币的类型 int bzType = new Random().Next(0, 2); long paycent = GetPayCent(); if (bzType == 1) { paycent = paycent * 10; } string mename = new BCW.BLL.User().GetUsName(meid); long gold = 0; string bzText = string.Empty; if (bzType == 0) { gold = new BCW.BLL.User().GetGold(meid); bzText = ub.Get("SiteBz"); } else { gold = new BCW.BLL.User().GetMoney(meid); bzText = ub.Get("SiteBz2"); } if (paycent > gold) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = bzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (bzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + ""); } } if (bzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, -paycent, "掷骰消费"); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, -paycent, "掷骰消费"); } Random rd = new Random(unchecked ((int)DateTime.Now.Ticks)); int A = rd.Next(1, 7); int B = rd.Next(1, 7); if (A + B < 5) { if (A > B) { A = A + rd.Next(1, 3); } else { B = B + rd.Next(1, 3); } } BCW.Model.Game.Dxdice model = new BCW.Model.Game.Dxdice(); model.Types = 0; model.DxdiceA = A + "#" + B; model.DxdiceB = ""; model.StopTime = DateTime.Now.AddHours(1); model.UsID = meid; model.UsName = mename; model.AddTime = DateTime.Now; model.ReID = 0; model.ReName = ""; model.Price = paycent; model.IsWin = 0; model.State = 0; model.BzType = bzType; int id = new BCW.BLL.Game.Dxdice().Add(model); string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/dxdice.aspx]大小掷骰[/url]开盘成功(" + paycent + "" + bzText + ")"; new BCW.BLL.Action().Add(18, id, 0, "", wText); }
//应战操作 private void PlayBrag2(int meid) { if (meid == 0) { meid = GetUsID(); } ChanageOnline(meid); Random ra = new Random(unchecked ((int)DateTime.Now.Ticks)); int ptype = ra.Next(1, 3); DataSet ds = new BCW.BLL.Game.Brag().GetList("ID", "Types=0 and State=0 and UsID<>" + meid + " and AddTime<'" + DateTime.Now.AddMinutes(-20) + "' ORDER BY NEWID()"); if (ds != null && ds.Tables[0].Rows.Count > 0) { int TNum = Utils.ParseInt(ub.GetSub("BragTNum", xmlPath)); if (TNum > 0) { int TCount2 = new BCW.BLL.Game.Brag().GetCount2(meid); if (TCount2 > TNum) { int TCount = new BCW.BLL.Game.Brag().GetCount(meid); if ((TCount2 - TNum) > Convert.ToInt32(TCount * TNum)) { PlayBrag(0); meid = GetUsID(); } } } string mename = new BCW.BLL.User().GetUsName(meid); int id = int.Parse(ds.Tables[0].Rows[0]["ID"].ToString()); BCW.Model.Game.Brag model = new BCW.BLL.Game.Brag().GetBrag(id); long gold = 0; string bzText = string.Empty; if (model.BzType == 0) { gold = new BCW.BLL.User().GetGold(meid); bzText = ub.Get("SiteBz"); } else { gold = new BCW.BLL.User().GetMoney(meid); bzText = ub.Get("SiteBz2"); } if (model.Price > gold) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = model.BzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (model.BzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + ""); } } //应战十赌六赢 //if (model.Price > 10000) //{ int bet = model.TrueType; Random ra2 = new Random(unchecked ((int)DateTime.Now.Ticks)); int rdNext = ra2.Next(1, 1000); if (rdNext <= 400) { rdNext = ((bet == 1) ? 2 : 1); } else { rdNext = bet; } ptype = rdNext; //} //更新吹牛记录 BCW.Model.Game.Brag m = new BCW.Model.Game.Brag(); m.ID = id; m.ReID = meid; m.ReName = mename; m.ReTime = DateTime.Now; m.ChooseType = ptype; m.State = 1; new BCW.BLL.Game.Brag().UpdateState(m); //操作币 long winMoney = model.Price; //税率 long SysTax = 0; int Tax = 0; if (CaseBrag(model.Price, model.BzType) == "蜗牛") { Tax = Utils.ParseInt(ub.GetSub("BragTar1", xmlPath)); } else if (CaseBrag(model.Price, model.BzType) == "水牛") { Tax = Utils.ParseInt(ub.GetSub("BragTar2", xmlPath)); } else { Tax = Utils.ParseInt(ub.GetSub("BragTar3", xmlPath)); } if (Tax > 0) { SysTax = Convert.ToInt64(winMoney * Tax * 0.01); } winMoney = winMoney - SysTax; //庄家是不是机器人 bool IsRobot = false; if (new BCW.BLL.User().GetIsSpier(model.UsID) == 1) { IsRobot = true; } if (model.TrueType == ptype) { if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, winMoney, 7); new BCW.BLL.User().UpdateiGoldTop(model.UsID, model.UsName, -model.Price, 7); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, winMoney, "吹牛消费"); } if (!IsRobot) { new BCW.BLL.Guest().Add(1, model.UsID, model.UsName, "您的吹牛:" + model.Title + "已经结束,参与吹牛人[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url],结果你忽悠不了对方,输了![url=/bbs/game/brag.aspx?act=add]我要继续吹[/url]"); } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/brag.aspx]疯狂吹牛[/url]识破了" + model.UsName + "的吹牛(赢" + model.Price + "" + bzText + ")"; new BCW.BLL.Action().Add(14, id, 0, "", wText); } else { if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, -model.Price, 7); new BCW.BLL.User().UpdateiGoldTop(model.UsID, model.UsName, winMoney, 7); } else { new BCW.BLL.User().UpdateiGold(meid, mename, -model.Price, "吹牛消费"); } //如果是机器人就马上兑奖 if (!IsRobot) { new BCW.BLL.Guest().Add(1, model.UsID, model.UsName, "您的吹牛:" + model.Title + "已经结束,参与吹牛人[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url],结果全赢![url=/bbs/game/brag.aspx?act=case]马上兑奖[/url]"); } else//自动兑换 { new BCW.BLL.Game.Brag().UpdateState(id, 2); if (model.BzType == 0) { new BCW.BLL.User().UpdateiGold(model.UsID, winMoney, "吹牛消费"); } else { new BCW.BLL.User().UpdateiMoney(model.UsID, winMoney, "吹牛消费"); } } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/brag.aspx]疯狂吹牛[/url]中的" + model.UsName + "的吹牛上当了(输" + model.Price + "" + bzText + ")"; new BCW.BLL.Action().Add(14, id, 0, "", wText); } } }
//下注操作 private void PlayBrag(int meid) { if (meid == 0) { meid = GetUsID(); } ChanageOnline(meid); Random ra = new Random(unchecked ((int)DateTime.Now.Ticks)); int bzType = ra.Next(0, 2); int ptype = ra.Next(1, 3); //币的类型 long paycent = GetPayCent(); if (bzType == 1) { paycent = paycent * 10; } string mename = new BCW.BLL.User().GetUsName(meid); long gold = 0; string bzText = string.Empty; if (bzType == 0) { gold = new BCW.BLL.User().GetGold(meid); bzText = ub.Get("SiteBz"); } else { gold = new BCW.BLL.User().GetMoney(meid); bzText = ub.Get("SiteBz2"); } if (paycent > gold) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = bzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (bzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + ""); } } if (bzType == 0) { new BCW.BLL.User().UpdateiGold(meid, mename, -paycent, "吹牛消费"); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, -paycent, "吹牛消费"); } BCW.Model.Game.Brag model = new BCW.Model.Game.Brag(); model.Title = "我比你帅多了"; model.Types = 0; model.BragA = "信"; model.BragB = "不信"; model.ChooseType = 0; model.TrueType = ptype; model.StopTime = DateTime.Now.AddHours(1); model.UsID = meid; model.UsName = mename; model.AddTime = DateTime.Now; model.ReID = 0; model.ReName = ""; model.Price = paycent; model.State = 0; model.BzType = bzType; int id = new BCW.BLL.Game.Brag().Add(model); string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/brag.aspx]疯狂吹牛[/url]开盘成功(" + paycent + "" + bzText + ")"; new BCW.BLL.Action().Add(14, id, 0, "", wText); }
private void PlayHorse(int HorseId) { int meid = GetUsID(); ChanageOnline(meid); int ptype = GetPtype(); long paycent = GetPayCent(); int bzType = 0;//new Random().Next(0, 2) if (bzType == 1) { paycent = paycent * 5; } string mename = new BCW.BLL.User().GetUsName(meid); long gold = 0; string bzText = string.Empty; if (bzType == 0) { gold = new BCW.BLL.User().GetGold(meid); bzText = ub.Get("SiteBz"); } else { gold = new BCW.BLL.User().GetMoney(meid); bzText = ub.Get("SiteBz2"); } if (paycent > gold) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = bzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; if (bzType == 0) { modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 } else { modelx.AcGold = 5000000; modelx.AfterGold = gold + 5000000;//更新后的币数 } modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (bzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+5000000 where id=" + meid + ""); } } BCW.Model.Game.Horselist horse = new BCW.BLL.Game.Horselist().GetHorselist(); if (horse.ID == HorseId) { //加总押注额 if (bzType == 0) { new BCW.BLL.Game.Horselist().UpdatePool(horse.ID, paycent); new BCW.BLL.User().UpdateiGold(meid, mename, -paycent, "跑马押注"); } else { new BCW.BLL.Game.Horselist().UpdateWinPool(horse.ID, paycent); new BCW.BLL.User().UpdateiMoney(meid, mename, -paycent, "跑马押注"); } BCW.Model.Game.Horsepay model = new BCW.Model.Game.Horsepay(); model.HorseId = horse.ID; model.UsID = meid; model.UsName = mename; model.Types = ptype; model.BuyCent = paycent; model.WinCent = 0; model.AddTime = DateTime.Now; model.State = 0; model.bzType = bzType; if (!new BCW.BLL.Game.Horsepay().Exists(horse.ID, meid, bzType, ptype)) { int pid = new BCW.BLL.Game.Horsepay().Add(model); BCW.Data.SqlHelper.ExecuteSql("Update tb_Horsepay set IsSpier=1 where id=" + pid + "");//机器人标识 } else { new BCW.BLL.Game.Horsepay().Update(model); } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/horse.aspx]跑马第" + horse.ID + "局[/url]押注" + paycent + "" + bzText + ""; new BCW.BLL.Action().Add(10, 0, 0, "", wText); } }
//机器人购买下注操作 private void PlayLuck(int LuckId) { //得到随机的UsID int meid = GetUsID(); if (meid == 0) { Response.Write("随机机器人ID出错.error1<br/>"); Response.End(); } if (!new BCW.BLL.User().ExistsID(meid)) { Response.Write("随机机器人ID不存在.error1<br/>"); Response.End(); } #region 隐藏财产 string ForumSet = new BCW.BLL.User().GetForumSet(meid); string[] fs = ForumSet.Split(",".ToCharArray()); string sforumsets = string.Empty; for (int i = 0; i < fs.Length; i++) { string[] sfs = fs[i].ToString().Split("|".ToCharArray()); if (i == 24) { if (string.IsNullOrEmpty(sforumsets)) { sforumsets += sfs[0] + "|" + 1; } else { sforumsets += "," + sfs[0] + "|" + 1; } } else { if (string.IsNullOrEmpty(sforumsets)) { sforumsets += sfs[0] + "|" + sfs[1]; } else { sforumsets += "," + sfs[0] + "|" + sfs[1]; } } } new BCW.BLL.User().UpdateForumSet(meid, sforumsets); #endregion if (IsOpen() == false) { //Response.Write("" + GameName + "_机器人已休息close1!"); //Response.End(); } ChanageOnline(meid); //得到下注的类型 待写 int num1 = Get28Type(); //int num1 = 13; int bzType = 0; // new Random().Next(0, 2); long paycent = GetPayCent(); //得到下注金额 // Utils.Error("paycent:"+ paycent, ""); string mename = new BCW.BLL.User().GetUsName(meid); long gold = 0; string bzText = string.Empty; if (bzType == 0) { gold = new BCW.BLL.User().GetGold(meid); bzText = ub.Get("SiteBz"); } else { gold = new BCW.BLL.User().GetMoney(meid); bzText = ub.Get("SiteBz2"); } #region 读XML long Luck28BigCents = Utils.ParseInt(ub.GetSub("Luck28BigCents", xmlPath));//半数浮动设置下注额 long Luck28SmallCents = Utils.ParseInt(ub.GetSub("Luck28SmallCents", xmlPath)); long Luck28SingleCents = Utils.ParseInt(ub.GetSub("Luck28SingleCents", xmlPath)); long Luck28DoubleCents = Utils.ParseInt(ub.GetSub("Luck28DoubleCents", xmlPath)); long Luck28BigSingleCents = Utils.ParseInt(ub.GetSub("Luck28BigSingleCents", xmlPath)); long Luck28SmallSingleCents = Utils.ParseInt(ub.GetSub("Luck28SmallSingleCents", xmlPath)); long Luck28BigDoubleCents = Utils.ParseInt(ub.GetSub("Luck28BigDoubleCents", xmlPath)); long Luck28SmallDoubleCents = Utils.ParseInt(ub.GetSub("Luck28SmallDoubleCents", xmlPath)); long Luck28FirstCents = Utils.ParseInt(ub.GetSub("Luck28FirstCents", xmlPath));//分段每个段设置下注额 long Luck28SecendCents = Utils.ParseInt(ub.GetSub("Luck28SecendCents", xmlPath)); long Luck28ThreeCents = Utils.ParseInt(ub.GetSub("Luck28ThreeCents", xmlPath)); long Luck28AllCents = Utils.ParseInt(ub.GetSub("Luck28AllCents", xmlPath)); string FloatBig = (ub.GetSub("FloatBig", xmlPath));//得到浮动赔率 string FloatSmall = (ub.GetSub("FloatSmall", xmlPath)); string FloatSingle = (ub.GetSub("FloatSingle", xmlPath)); string FloatDouble = (ub.GetSub("FloatDouble", xmlPath)); string bigsingleodds = ub.GetSub("Luck28BigSingle", xmlPath); string smallsingleodds = ub.GetSub("Luck28SmallSingle", xmlPath); string bigdoubleoddds = ub.GetSub("Luck28BigDouble", xmlPath); string smalldoubleodds = ub.GetSub("Luck28SmallDouble", xmlPath); string firstodds = ub.GetSub("Luck28First", xmlPath); string secendodds = ub.GetSub("Luck28Secend", xmlPath); string threeodds = ub.GetSub("Luck28Three", xmlPath); long Big = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28Big"); long small = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28Small"); long single = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28Single"); long doubl = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28Double"); long bigsingle = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28BigSingle"); long smallsingle = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28SmallSingle"); long bigdouble = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28BigDouble"); long smalldouble = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28SmallDouble"); long first = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28First"); long secend = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28Secend"); long three = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28Three"); long all = new BCW.BLL.Game.Luckpay().GetSumBuyTypeCent(LuckId, "Luck28All"); long MaxPool = Utils.ParseInt(ub.GetSub("Luck28MaxPool", xmlPath)); //每期下注总额 long hadbuy = new BCW.BLL.Game.Luckpay().GetPrice("BuyCents", "LuckId=" + LuckId); //得到某一期所有玩家的下注金额 long paysmall = Convert.ToInt64(ub.GetSub("Luck28SmallPay", xmlPath)); long paybig = Convert.ToInt64(ub.GetSub("Luck28BigPay", xmlPath)); #endregion //机器人每一期的最高购买次数 int buyCount = Convert.ToInt32(ub.GetSub("Luck28RobotBuy", xmlPath)); string BuyNum = ""; string EngText = ""; string Text = ""; string myend = ""; string odds = ""; string weishu = string.Empty; int flag = 1; //是否可以下注 long allBuyCent = 0; //总的下注额 #region 机械人下注 // else //{ BCW.Model.Game.Lucklist luck = new BCW.BLL.Game.Lucklist().GetNextLucklist(); //得到最新一期 long wanjia = 0; int count = new BCW.BLL.Game.Luckpay().GetRobotbuy(meid, luck.ID); //得到机械人的下注次数 if ((count < buyCount) && (buyCount != 0)) //可以下注 { #region 机械人下注 #region 大小单双 if (num1 == 1) { BuyNum = "14,15,16,17,18,19,20,21,22,23,24,25,26,27"; EngText = "Luck28Big"; Text = "押大"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > Luck28BigCents - Big + small) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = FloatBig; } else if (num1 == 2) { BuyNum = "0,1,2,3,4,5,6,7,8,9,10,11,12,13"; Text = "小"; EngText = "Luck28Small"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28SmallCents - small + Big)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = FloatSmall; } else if (num1 == 3) { BuyNum = "1,3,5,7,9,11,13,15,17,19,21,23,25,27"; Text = "单"; EngText = "Luck28Single"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28SingleCents - single + doubl)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = FloatSingle; } else if (num1 == 4) { BuyNum = "0,2,4,6,8,10,12,14,16,18,20,22,24,26"; Text = "双"; EngText = "Luck28Double"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28DoubleCents - doubl + single)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = FloatDouble; } else if (num1 == 5) { BuyNum = "15,17,19,21,23,25,27"; Text = "大单"; EngText = "Luck28BigSingle"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28BigSingleCents - bigsingle + smallsingle)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = bigsingleodds.ToString(); } else if (num1 == 6) { BuyNum = "1,3,5,7,9,11,13"; Text = "小单"; EngText = "Luck28SmallSingle"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28SmallSingleCents - smallsingle + bigsingle)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = smallsingleodds.ToString(); } else if (num1 == 7) { BuyNum = "14,16,18,20,22,24,26"; Text = "大双"; EngText = "Luck28BigDouble"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28BigDoubleCents - bigdouble + smalldouble)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = bigdoubleoddds.ToString(); } else if (num1 == 8) { BuyNum = "0,2,4,6,8,10,12"; Text = "小双"; EngText = "Luck28SmallDouble"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28SmallDoubleCents - smalldouble + bigdouble)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = smalldoubleodds.ToString(); } else if (num1 == 9) { BuyNum = "0,1,2,3,4,5,6,7,8,9"; Text = "一段"; EngText = "Luck28First"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28FirstCents - first)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = firstodds.ToString(); } else if (num1 == 10) { BuyNum = "10,11,12,13,14,15,16,17,18"; Text = "二段"; EngText = "Luck28Secend"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28SecendCents - secend)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = secendodds.ToString(); } else if (num1 == 11) { BuyNum = "19,20,21,22,23,24,25,26,27"; Text = "三段"; EngText = "Luck28Three"; wanjia = paycent; allBuyCent = paycent; if ((wanjia) > (Luck28ThreeCents - three)) { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } odds = threeodds.ToString(); } #endregion else if (num1 == 12) { BuyNum = Choose(27); Text = "自选"; EngText = "Luck28Choose"; wanjia = paycent; // Response.Write("产生的自选号码是:" + BuyNum + "<>br/"); string[] a = BuyNum.Split(','); allBuyCent = paycent * a.Length; for (int i = 0; i < a.Length; i++) { string haoma = a[i].ToString(); //得到选的第几个号码 long canbuy = Utils.ParseInt(ub.GetSub("Luck28Buy" + haoma, xmlPath)); //得到每个号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCentbychoose(luck.ID, haoma); //得到某数字的已下的总下注金额 if (hasbuy + paycent > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 该号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } } else if (num1 == 13) { BuyNum = Choose(10); myend = BuyNum; Text = "尾号"; EngText = "Luck28End"; wanjia = paycent; // Response.Write("产生的尾号是:" + BuyNum + "<br/>"); string[] a = BuyNum.Split(','); string getWS = ""; for (int i = 0; i < a.Length; i++) { #region 尾数判断 if (a[i] == "0") { getWS = "0,10,20"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last0Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS+"<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "1") { getWS = "1,11,21"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last1Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "2") { getWS = "2,12,22"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last2Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "3") { getWS = "3,13,23"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last3Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "4") { getWS = "4,14,24"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last4Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "5") { getWS = "5,15,25"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last5Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "6") { getWS = "6,16,26"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last6Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "7") { getWS = "7,17,27"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last7Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "8") { getWS = "8,18"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last8Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 // Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } else if (a[i] == "9") { getWS = "9,19"; long canbuy = Utils.ParseInt(ub.GetSub("Luck28Last9Cents", xmlPath)); //得到号码最大下注金额 long hasbuy = new BCW.BLL.Game.Luckpay().GetSumBuyCent(luck.ID, getWS); //得到某数字的总下注金额 //Response.Write("尾数:" + getWS + "<br/>"); if (((hasbuy + (paycent))) > canbuy) //某数字的总下注金额 + 玩家单个数下注金额 > 号码最大下注金额 { flag = 0; } if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } } if (string.IsNullOrEmpty(weishu)) { weishu = weishu + getWS; } else { weishu = weishu + "," + getWS; } #endregion } BuyNum = weishu; //Response.Write("尾数是:" + weishu + "<br/>"); //Response.Write("BuyNum:" + BuyNum + "<br/>"); string[] Temp1 = myend.Split(','); // Response.Write("尾数总数:" + Temp1.Length + "<br/>"); allBuyCent = paycent * Temp1.Length; if ((allBuyCent + hadbuy) > MaxPool)//当前玩家下注+之前所有玩家下注 > 当期最大下注金额 { flag = 0; } //Response.Write("wanjia:" + wanjia + "<br/>"); //Response.Write("Temp1.Length:" + Temp1.Length + "<br/>"); //Response.Write("allBuyCent:" + allBuyCent + "<br/>"); if (allBuyCent > paybig || allBuyCent < paysmall)//超过单注下注范围 { flag = 0; } } long myIDPay = new BCW.BLL.Game.Luckpay().GetPrice("BuyCents", "LuckId=" + LuckId + " and UsID=" + meid); //得到这一期该玩家的总下注额 long XMLEveryPay = Convert.ToInt64(ub.GetSub("Luck28EveryPay", xmlPath)); //限制每个ID每期下注的金额 if (myIDPay + allBuyCent > XMLEveryPay) { flag = 0; Response.Write("每期每ID最多可下" + XMLEveryPay + ub.Get("SiteBz") + ",你已下" + myIDPay + ub.Get("SiteBz")); // Utils.Error("每期每ID最多可下" + XMLEveryPay + ub.Get("SiteBz") + ",你已下" + myIDPay + ub.Get("SiteBz"), ""); } #endregion if (flag == 1)//可以下注并且不超过最大下注额 { if (gold < allBuyCent || gold < 0) { // Response.Write("<b>机器人" + meid + "币不够!请换一个机器人或者给该机器人充值 </b><br />"); //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = 0; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = paycent; modelx.AfterGold = gold + allBuyCent;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + allBuyCent + ") where id=" + meid + ""); } // Utils.Error("allBuyCent:"+ allBuyCent+ ",EngText:"+ EngText, ""); Response.Write("paycent:" + paycent + "<br/>"); Response.Write("BuyNum:" + BuyNum + "<br/>"); Response.Write("allBuyCent:" + allBuyCent + "<br/>"); Response.Write("EngText:" + EngText + "<br/>"); Response.Write("flag:" + flag + "<br/>"); //return; // Response.Write("尾数:" + myend + "<br/>"); count++;//机械人下注次数加一 Response.Write(meid + "机械人可以加入数据库:" + count + "<br/>"); BCW.Model.Game.Luckpay model = new BCW.Model.Game.Luckpay(); model.LuckId = LuckId; model.UsID = meid; model.UsName = mename; model.BuyCent = paycent; model.BuyCents = allBuyCent; model.BuyNum = BuyNum; model.BuyType = EngText; model.State = 0; model.IsRobot = 1;//是机械人下注 model.WinCent = 0; model.AddTime = DateTime.Now; if (odds != "") { model.odds = odds; } else { model.odds = "1"; } // Response.Write("allBuyCent:" + allBuyCent + "<br/>"); int id = new BCW.BLL.Game.Luckpay().Add(model); if (EngText == "Luck28Choose") { //向102加钱 // new BCW.BLL.User().UpdateiGold(102, new BCW.BLL.User().GetUsName(102), allBuyCent, "ID:" + meid + "二八第" + luck.Bjkl8Qihao + "期买" + Text + BuyNum + "共" + allBuyCent + "-标识" + id + ""); //扣币 new BCW.BLL.User().UpdateiGold(meid, new BCW.BLL.User().GetUsName(meid), -allBuyCent, "二八第" + luck.Bjkl8Qihao + "期押" + Text + BuyNum + "-标识" + id + ""); } else if (Text == "Luck28End") { new BCW.BLL.User().UpdateiGold(meid, new BCW.BLL.User().GetUsName(meid), -allBuyCent, "二八第" + luck.Bjkl8Qihao + "期押" + Text + "" + myend + "-标识" + id + ""); } else { new BCW.BLL.User().UpdateiGold(meid, new BCW.BLL.User().GetUsName(meid), -allBuyCent, "二八第" + luck.Bjkl8Qihao + "期押" + Text + ",赔率:" + model.odds + "-标识" + id + ""); } string wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/luck28.aspx]幸运28第" + luck.Bjkl8Qihao + "期[/url]下注**" + ub.Get("SiteBz") + "";//" + Convert.ToInt64(allBuyCent) + " new BCW.BLL.Action().Add(1020, id, 0, "", wText); } else { // Response.Write(meid + "机械人下注过大:"+allBuyCent+"<br/>" ); } } else { Response.Write(meid + "机械人不能再下注啦:" + count); } }
private void PlayBigSmallInfo(int meid, int id, long PayCent) { ChanageOnline(meid); string mename = new BCW.BLL.User().GetUsName(meid); BCW.Model.Game.Bslist model = new BCW.BLL.Game.Bslist().GetBslist(id); if (model.UsID == meid) { Response.End(); } int bet = new Random().Next(0, 2); if (PayCent < model.SmallPay || PayCent > model.BigPay) { Response.End(); } if (PayCent > model.Money) { Response.End(); } long gold = 0; string bzText = string.Empty; if (model.BzType == 0) { bzText = ub.Get("SiteBz"); gold = new BCW.BLL.User().GetGold(meid); } else { bzText = ub.Get("SiteBz2"); gold = new BCW.BLL.User().GetMoney(meid); } if (gold < PayCent) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = model.BzType; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = 500000; modelx.AfterGold = gold + 500000;//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); if (model.BzType == 0) { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+500000 where id=" + meid + ""); } else { BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iMoney=iMoney+500000 where id=" + meid + ""); } } bool IsWin = false; Random ra = new Random(unchecked ((int)DateTime.Now.Ticks)); int rdNext = ra.Next(0, 2); if (rdNext == bet) { IsWin = true; } //客家十赌六赢 string IsWinBot = ub.GetSub("BsIsWinBot", xmlPath); if (IsWinBot == "0") { rdNext = ra.Next(1, 1000); if (rdNext <= 400) { rdNext = ((bet == 0) ? 1 : 0); IsWin = false; } else { rdNext = bet; IsWin = true; } } long WinCent = 0; if (IsWin)//闲胜 { double XTar = Convert.ToDouble(ub.GetSub("BsXTar", xmlPath)); long xMoney = PayCent - Convert.ToInt64(XTar * 0.01 * PayCent); if (model.BzType == 0) { //更新排行榜 BCW.Model.Toplist modeltop = new BCW.Model.Toplist(); modeltop.Types = 9; modeltop.UsId = model.UsID; modeltop.UsName = model.UsName; modeltop.PutNum = 1; modeltop.PutGold = -PayCent; if (!new BCW.BLL.Toplist().Exists(model.UsID, 9)) { new BCW.BLL.Toplist().Add(modeltop); } else { new BCW.BLL.Toplist().Update(modeltop); } new BCW.BLL.User().UpdateiGold(meid, mename, xMoney, 9); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, xMoney, "大小庄赢得"); } new BCW.BLL.Game.Bslist().UpdateMoney(id, -PayCent); WinCent = xMoney; } else//庄胜 { double ZTar = Convert.ToDouble(ub.GetSub("BsZTar", xmlPath)); long zMoney = PayCent - Convert.ToInt64(ZTar * 0.01 * PayCent); new BCW.BLL.Game.Bslist().UpdateMoney(id, zMoney); if (model.BzType == 0) { //更新排行榜 BCW.Model.Toplist modeltop = new BCW.Model.Toplist(); modeltop.Types = 9; modeltop.UsId = model.UsID; modeltop.UsName = model.UsName; modeltop.WinNum = 1; modeltop.WinGold = zMoney; if (!new BCW.BLL.Toplist().Exists(model.UsID, 9)) { new BCW.BLL.Toplist().Add(modeltop); } else { new BCW.BLL.Toplist().Update(modeltop); } new BCW.BLL.User().UpdateiGold(meid, mename, -PayCent, 9); } else { new BCW.BLL.User().UpdateiMoney(meid, mename, -PayCent, "大小庄失去"); } WinCent = -PayCent; } //写进下注记录 BCW.Model.Game.Bspay addmodel = new BCW.Model.Game.Bspay(); addmodel.BsId = id; addmodel.BsTitle = model.Title; addmodel.BzType = model.BzType; addmodel.BetType = bet; addmodel.PayCent = PayCent; addmodel.UsID = meid; addmodel.UsName = mename; addmodel.WinCent = WinCent; addmodel.AddTime = DateTime.Now; new BCW.BLL.Game.Bspay().Add(addmodel); //写进人气 new BCW.BLL.Game.Bslist().UpdateClick(id); //动态 string wText = string.Empty; if (IsWin == true) { wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/bigsmall.aspx]大小庄[/url]《" + model.Title + "》赢得了" + PayCent + "" + bzText + ""; } else { wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/bigsmall.aspx]大小庄[/url]《" + model.Title + "》失去了" + PayCent + "" + bzText + ""; } new BCW.BLL.Action().Add(13, 0, 0, "", wText); }
//机器人ROBOT public void Robot() { string buycount = ub.GetSub("HP3ROBOTBUY", xmlPath); int buycou = Convert.ToInt32(buycount); string RoBotCost1 = ub.GetSub("HP3ROBOTCOST", xmlPath); //得到投注的酷币 string[] ppp = RoBotCost1.Split('#'); Random ran = new Random(); int k = ran.Next(0, (ppp.Length)); long RoBotCost = Convert.ToInt32(ppp[k]); int meid = GetUsID();//下注ID ChanageOnline(meid); BCW.HP3.Model.HP3_kjnum model2 = new BCW.HP3.Model.HP3_kjnum(); model2 = new BCW.HP3.BLL.HP3_kjnum().GetListLast(); int dnu = int.Parse(model2.datenum); DateTime kjtime = model2.datetime; BCW.HP3.Model.HP3Buy modelBuy = new BCW.HP3.Model.HP3Buy(); int[] xx = new int[] { 1, 6, 7, 9, 11, 13, 15, 17 }; string[] xx2 = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" }; int x; Random r = new Random(); x = r.Next(0, 8); modelBuy.BuyType = xx[x]; modelBuy.BuyID = meid; modelBuy.BuyTime = DateTime.Now; modelBuy.BuyDate = dnu.ToString(); Random Od = new Random(); int Odd = Od.Next(1, 99); int zhu = 1; System.Threading.Thread.Sleep(100);//当前休眠100毫秒 if (modelBuy.BuyType == 1) { int x2; Random r2 = new Random(); x2 = r2.Next(1, 52); modelBuy.BuyNum = x2.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; modelBuy.BuyZhu = 1; } else if (modelBuy.BuyType == 17) { string x3 = string.Empty; Random r3 = new Random(); x3 = r3.Next(1, 5).ToString(); modelBuy.BuyNum = x3; modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; modelBuy.BuyZhu = 1; } else if (modelBuy.BuyType == 6) { int x6; Random r6 = new Random(); x6 = r6.Next(1, 14); int[] arrayK = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; RandomKDiffer(x6, arrayK); string sbb = ""; for (int s = 0; s < x6; s++) { if (s != x6 - 1) { sbb = sbb + xx2[arrayK[s]] + ","; } else { sbb = sbb + xx2[arrayK[s]]; } } modelBuy.BuyNum = sbb.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; } else if (modelBuy.BuyType == 7) { int x6; Random r6 = new Random(); x6 = r6.Next(2, 14); int[] arrayK = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; RandomKDiffer(x6, arrayK); string sbb = ""; for (int s = 0; s < x6; s++) { if (s != x6 - 1) { sbb = sbb + xx2[arrayK[s]] + ","; } else { sbb = sbb + xx2[arrayK[s]]; } } modelBuy.BuyNum = sbb.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; } else if (modelBuy.BuyType == 9) { int x6; Random r6 = new Random(); x6 = r6.Next(3, 14); int[] arrayK = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; RandomKDiffer(x6, arrayK); string sbb = ""; for (int s = 0; s < x6; s++) { if (s != x6 - 1) { sbb = sbb + xx2[arrayK[s]] + ","; } else { sbb = sbb + xx2[arrayK[s]]; } } modelBuy.BuyNum = sbb.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; } else if (modelBuy.BuyType == 11) { int x6; Random r6 = new Random(); x6 = r6.Next(4, 14); int[] arrayK = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; RandomKDiffer(x6, arrayK); string sbb = ""; for (int s = 0; s < x6; s++) { if (s != x6 - 1) { sbb = sbb + xx2[arrayK[s]] + ","; } else { sbb = sbb + xx2[arrayK[s]]; } } modelBuy.BuyNum = sbb.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; } else if (modelBuy.BuyType == 13) { int x6; Random r6 = new Random(); x6 = r6.Next(5, 14); int[] arrayK = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; RandomKDiffer(x6, arrayK); string sbb = ""; for (int s = 0; s < x6; s++) { if (s != x6 - 1) { sbb = sbb + xx2[arrayK[s]] + ","; } else { sbb = sbb + xx2[arrayK[s]]; } } modelBuy.BuyNum = sbb.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; } else if (modelBuy.BuyType == 15) { int x6; Random r6 = new Random(); x6 = r6.Next(6, 14); int[] arrayK = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; RandomKDiffer(x6, arrayK); string sbb = ""; for (int s = 0; s < x6; s++) { if (s != x6 - 1) { sbb = sbb + xx2[arrayK[s]] + ","; } else { sbb = sbb + xx2[arrayK[s]]; } } modelBuy.BuyNum = sbb.ToString(); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd; } int ptype = modelBuy.BuyType; string Num2 = modelBuy.BuyNum; if (ptype == 6)//直1 { int len = Num2.Length; zhu = (len + 1) / 2; } else if (ptype == 7)//直2 { int len = Num2.Length; int Anum = (len + 1) / 2; switch (Anum) { case 2: zhu = 1; break; case 3: zhu = 3; break; case 4: zhu = 6; break; case 5: zhu = 10; break; case 6: zhu = 15; break; case 7: zhu = 21; break; case 8: zhu = 28; break; case 9: zhu = 36; break; case 10: zhu = 45; break; case 11: zhu = 55; break; case 12: zhu = 66; break; case 13: zhu = 78; break; } } else if (ptype == 9)//直3 { int len = Num2.Length; int Anum = (len + 1) / 2; switch (Anum) { case 3: zhu = 1; break; case 4: zhu = 4; break; case 5: zhu = 10; break; case 6: zhu = 20; break; case 7: zhu = 35; break; case 8: zhu = 56; break; case 9: zhu = 84; break; case 10: zhu = 120; break; case 11: zhu = 165; break; case 12: zhu = 220; break; case 13: zhu = 288; break; } } else if (ptype == 11)//直4 { int len = Num2.Length; int Anum = (len + 1) / 2; switch (Anum) { case 4: zhu = 1; break; case 5: zhu = 5; break; case 6: zhu = 15; break; case 7: zhu = 35; break; case 8: zhu = 70; break; case 9: zhu = 126; break; case 10: zhu = 210; break; case 11: zhu = 330; break; case 12: zhu = 495; break; case 13: zhu = 715; break; } } else if (ptype == 13)//直5 { int len = Num2.Length; int Anum = (len + 1) / 2; switch (Anum) { case 5: zhu = 1; break; case 6: zhu = 6; break; case 7: zhu = 21; break; case 8: zhu = 56; break; case 9: zhu = 126; break; case 10: zhu = 252; break; case 11: zhu = 462; break; case 12: zhu = 792; break; case 13: zhu = 1287; break; } } else if (ptype == 15)//直6 { int len = Num2.Length; int Anum = (len + 1) / 2; switch (Anum) { case 6: zhu = 1; break; case 7: zhu = 7; break; case 8: zhu = 28; break; case 9: zhu = 84; break; case 10: zhu = 210; break; case 11: zhu = 462; break; case 12: zhu = 924; break; case 13: zhu = 1716; break; } } modelBuy.BuyZhu = zhu; string buynum = modelBuy.BuyNum; if (modelBuy.BuyType == 1) { switch (buynum) { case "1": case "2": case "3": case "4": modelBuy.Odds = Convert.ToDecimal(XML(2)); break; case "5": modelBuy.Odds = Convert.ToDecimal(XML(1)); break; case "6": case "7": case "8": case "9": case "10": case "11": case "12": case "13": case "14": case "15": case "16": case "17": modelBuy.Odds = Convert.ToDecimal(XML(6)); break; case "18": modelBuy.Odds = Convert.ToDecimal(XML(5)); break; case "19": case "20": case "21": case "22": modelBuy.Odds = Convert.ToDecimal(XML(4)); break; case "23": modelBuy.Odds = Convert.ToDecimal(XML(3)); break; case "24": case "25": case "26": case "27": case "28": case "29": case "30": case "31": case "32": case "33": case "34": case "35": case "36": modelBuy.Odds = Convert.ToDecimal(XML(8)); break; case "37": modelBuy.Odds = Convert.ToDecimal(XML(7)); break; case "38": case "39": case "40": case "41": case "42": case "43": case "44": case "45": case "46": case "47": case "48": case "49": case "50": modelBuy.Odds = Convert.ToDecimal(XML(10)); break; case "51": modelBuy.Odds = Convert.ToDecimal(XML(9)); break; } } else if (modelBuy.BuyType == 6) { modelBuy.Odds = Convert.ToDecimal(XML(11)); } else if (modelBuy.BuyType == 7) { modelBuy.Odds = Convert.ToDecimal(XML(12)); } else if (modelBuy.BuyType == 9) { modelBuy.Odds = Convert.ToDecimal(XML(13)); } else if (modelBuy.BuyType == 11) { modelBuy.Odds = Convert.ToDecimal(XML(14)); } else if (modelBuy.BuyType == 13) { modelBuy.Odds = Convert.ToDecimal(XML(15)); } else if (modelBuy.BuyType == 15) { modelBuy.Odds = Convert.ToDecimal(XML(16)); } else if (modelBuy.BuyType == 17) { switch (modelBuy.BuyNum) { case "1": modelBuy.Odds = Convert.ToDecimal(XML(21)); break; case "2": modelBuy.Odds = Convert.ToDecimal(XML(22)); break; case "3": modelBuy.Odds = Convert.ToDecimal(XML(23)); break; case "4": modelBuy.Odds = Convert.ToDecimal(XML(24)); break; } } int count = new BCW.HP3.BLL.HP3Buy().GetRecordCount(" BuyID=" + meid + " and BuyDate='" + modelBuy.BuyDate + "'"); long big = Convert.ToInt64(ub.GetSub("HP3BigPay", xmlPath)); while (modelBuy.BuyMoney > big) { Random Od2 = new Random(); int Odd2 = Od2.Next(1, 99); modelBuy.BuyMoney = Convert.ToInt64(RoBotCost) * Odd2; } long xPrices = Utils.ParseInt64(ub.GetSub("HP3Price", xmlPath)); long prices = Convert.ToInt64(modelBuy.BuyMoney * modelBuy.BuyZhu); long SmallPay = Utils.ParseInt64(ub.GetSub("HP3SmallPay", xmlPath)); long BigPay = Utils.ParseInt64(ub.GetSub("HP3BigPay", xmlPath)); if (prices >= SmallPay && prices <= BigPay) { if (xPrices > 0) { DataSet ds = new BCW.HP3.BLL.HP3Buy().GetListByID("BuyMoney", meid, modelBuy.BuyDate); int oPrices = 0; DataTable dt = ds.Tables[0]; foreach (DataRow dr in dt.Rows) { int drs = int.Parse(dr[0].ToString()); oPrices = oPrices + drs; } int end2 = int.Parse(GetLastStr(model2.datenum, 2)); int LiangTing = int.Parse(ub.GetSub("HP3LianTing", xmlPath)); long gold = new BCW.BLL.User().GetGold(meid); string mename = new BCW.BLL.User().GetUsName(meid); if (count < buycou && oPrices + prices < xPrices && gold >= 0) { if (gold >= prices) { int Sec = Utils.ParseInt(ub.GetSub("HP3Sec", xmlPath)); if (kjtime < DateTime.Now.AddSeconds(Sec)) { Response.Write("未到下注时间ok1"); } else { string xfjl = ""; if (modelBuy.BuyType == 1) { xfjl = speChoose(Convert.ToInt32(modelBuy.BuyNum)); } else if (modelBuy.BuyType == 17) { switch (modelBuy.BuyNum) { case "1": xfjl = "大"; break; case "2": xfjl = "小"; break; case "3": xfjl = "单"; break; case "4": xfjl = "双"; break; } } else { switch (modelBuy.BuyType) { case 6: xfjl = "任选一:" + modelBuy.BuyNum; break; case 7: xfjl = "任选二:" + modelBuy.BuyNum; break; case 8: xfjl = "任选二胆拖:" + modelBuy.BuyNum; break; case 9: xfjl = "任选三:" + modelBuy.BuyNum; break; case 10: xfjl = "任选三胆拖:" + modelBuy.BuyNum; break; case 11: xfjl = "任选四:" + modelBuy.BuyNum; break; case 12: xfjl = "任选四胆拖:" + modelBuy.BuyNum; break; case 13: xfjl = "任选五:" + modelBuy.BuyNum; break; case 14: xfjl = "任选五胆拖:" + modelBuy.BuyNum; break; case 15: xfjl = "任选六:" + modelBuy.BuyNum; break; case 16: xfjl = "任选六胆拖:" + modelBuy.BuyNum; break; } } int id = new BCW.HP3.BLL.HP3Buy().Add(modelBuy); new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第" + "[url=./game/HP3.aspx?act=BuyWin&qihaos=" + modelBuy.BuyDate + "&ptype=2]" + modelBuy.BuyDate + "[/url]期买" + xfjl + "投注ID" + id); new BCW.HP3.BLL.HP3Buy().UpdateIsRot(id, 1); new BCW.HP3.BLL.HP3Buy().UpdateWillGet(id, 0); string gameplay = ""; switch (modelBuy.BuyType) { case 1: gameplay = "花色连号同号投注"; break; case 17: gameplay = "大小单双投注"; break; default: gameplay = "任选投注"; break; } //动态 string wText = "在[url=/bbs/game/HP3.aspx]" + GameName + "[/url]《" + gameplay + "》下注**" + "" + ub.Get("SiteBz") + "";// + prices new BCW.BLL.Action().Add(1003, id, meid, mename, wText); } } else { // if (gold < prices) //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = 0; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = prices; modelx.AfterGold = gold + prices;//更新后的币数 modelx.AcText = "HP3系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); //给机器人发钱 BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + prices + ") where id=" + meid + ""); int Sec = Utils.ParseInt(ub.GetSub("HP3Sec", xmlPath)); if (kjtime < DateTime.Now.AddSeconds(Sec)) { Response.Write("未到下注时间ok1"); } else { string xfjl = ""; if (modelBuy.BuyType == 1) { xfjl = speChoose(Convert.ToInt32(modelBuy.BuyNum)); } else if (modelBuy.BuyType == 17) { switch (modelBuy.BuyNum) { case "1": xfjl = "大"; break; case "2": xfjl = "小"; break; case "3": xfjl = "单"; break; case "4": xfjl = "双"; break; } } else { switch (modelBuy.BuyType) { case 6: xfjl = "任选一:" + modelBuy.BuyNum; break; case 7: xfjl = "任选二:" + modelBuy.BuyNum; break; case 8: xfjl = "任选二胆拖:" + modelBuy.BuyNum; break; case 9: xfjl = "任选三:" + modelBuy.BuyNum; break; case 10: xfjl = "任选三胆拖:" + modelBuy.BuyNum; break; case 11: xfjl = "任选四:" + modelBuy.BuyNum; break; case 12: xfjl = "任选四胆拖:" + modelBuy.BuyNum; break; case 13: xfjl = "任选五:" + modelBuy.BuyNum; break; case 14: xfjl = "任选五胆拖:" + modelBuy.BuyNum; break; case 15: xfjl = "任选六:" + modelBuy.BuyNum; break; case 16: xfjl = "任选六胆拖:" + modelBuy.BuyNum; break; } } int id = 0; try { id = new BCW.HP3.BLL.HP3Buy().Add(modelBuy); new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第" + "[url=./game/HP3.aspx?act=BuyWin&qihaos=" + modelBuy.BuyDate + "&ptype=2]" + modelBuy.BuyDate + "[/url]期买" + xfjl + "投注ID" + id); new BCW.HP3.BLL.HP3Buy().UpdateIsRot(id, 1); new BCW.HP3.BLL.HP3Buy().UpdateWillGet(id, 0); string gameplay = ""; switch (modelBuy.BuyType) { case 1: gameplay = "花色连号同号投注"; break; case 17: gameplay = "大小单双投注"; break; default: gameplay = "任选投注"; break; } //动态 string wText = "在[url=/bbs/game/HP3.aspx]" + GameName + "[/url]《" + gameplay + "》下注**" + "" + ub.Get("SiteBz") + "";//+ prices new BCW.BLL.Action().Add(1003, id, meid, mename, wText); } catch { } } } int countall = new BCW.HP3.BLL.HP3Buy().GetRecordCount(" BuyDate='" + modelBuy.BuyDate + "'"); Response.Write("第" + modelBuy.BuyDate + "期<br />"); Response.Write("机器人总计买了" + countall + "张<br />"); } } } }
/// <summary> /// 机器人购买自动兑奖 /// </summary> private void klsfRobotPlay() { #region 机器人下注 //得到随机的UsID int meid = GetUsID(); if (meid == 0) { return; } ChanageOnline(meid); //得到随机的类型 int pType = GetPtype(); //得到投注的酷币 int Price = 0; string[] ppp = ub.GetSub("klsfRobotBuyCent", "/Controls/klsf.xml").Split('#'); Random ran = new Random(); int k = ran.Next(0, (ppp.Length)); Price = Convert.ToInt32(ppp[k]); //每个机器人每一期的最高购买次数 int buyCount = Convert.ToInt32(ub.GetSub("klsfRobotBuy", xmlPath)); double Odds = 0; double klsfOdds1 = Utils.ParseDouble(ub.GetSub("klsfOdds1", xmlPath)); //任选五胆拖 double klsfOdds2 = Utils.ParseDouble(ub.GetSub("klsfOdds2", xmlPath)); //任选五普通 double klsfOdds3 = Utils.ParseDouble(ub.GetSub("klsfOdds3", xmlPath)); //任选四胆拖 double klsfOdds4 = Utils.ParseDouble(ub.GetSub("klsfOdds4", xmlPath)); //任选四普通 double klsfOdds5 = Utils.ParseDouble(ub.GetSub("klsfOdds5", xmlPath)); //任选三胆拖 double klsfOdds6 = Utils.ParseDouble(ub.GetSub("klsfOdds6", xmlPath)); //任选三普通 double klsfOdds7 = Utils.ParseDouble(ub.GetSub("klsfOdds7", xmlPath)); //任选二胆拖 double klsfOdds8 = Utils.ParseDouble(ub.GetSub("klsfOdds8", xmlPath)); //任选二普通 double klsfOdds9 = Utils.ParseDouble(ub.GetSub("klsfOdds9", xmlPath)); //连二直选 double klsfOdds10 = Utils.ParseDouble(ub.GetSub("klsfOdds10", xmlPath)); //连二组选 double klsfOdds11 = Utils.ParseDouble(ub.GetSub("klsfOdds11", xmlPath)); //前一红投 double klsfOdds12 = Utils.ParseDouble(ub.GetSub("klsfOdds12", xmlPath)); //前一数投 double klsfOdds13 = Utils.ParseDouble(ub.GetSub("klsfOdds13", xmlPath)); //大 double klsfOdds14 = Utils.ParseDouble(ub.GetSub("klsfOdds14", xmlPath)); //小 double klsfOdds15 = Utils.ParseDouble(ub.GetSub("klsfOdds15", xmlPath)); //单 double klsfOdds16 = Utils.ParseDouble(ub.GetSub("klsfOdds16", xmlPath)); //双 double klsfOdds17 = Utils.ParseDouble(ub.GetSub("klsfOdds17", xmlPath)); //浮动 double klsfOdds18 = Utils.ParseDouble(ub.GetSub("klsfOdds18", xmlPath)); //龙18 double klsfOdds19 = Utils.ParseDouble(ub.GetSub("klsfOdds19", xmlPath)); //虎81 double klsfOdds20 = Utils.ParseDouble(ub.GetSub("klsfOdds20", xmlPath)); //龙27 double klsfOdds21 = Utils.ParseDouble(ub.GetSub("klsfOdds21", xmlPath)); //虎72 double klsfOdds22 = Utils.ParseDouble(ub.GetSub("klsfOdds22", xmlPath)); //龙36 double klsfOdds23 = Utils.ParseDouble(ub.GetSub("klsfOdds23", xmlPath)); //虎63 double klsfOdds24 = Utils.ParseDouble(ub.GetSub("klsfOdds24", xmlPath)); //龙45 double klsfOdds25 = Utils.ParseDouble(ub.GetSub("klsfOdds25", xmlPath)); //虎54 int stage = 0; string mename = new BCW.BLL.User().GetUsName(meid); string date = DateTime.Now.ToString("yyMMdd"); stage = int.Parse(date + "01"); BCW.Model.klsflist model = new BCW.BLL.klsflist().GetklsflistLast(); if (model.EndTime > DateTime.Now) { BCW.Model.klsfpay modelPay = new BCW.Model.klsfpay(); //计数出该机器人投注的次数是否大于xml限定次数 int count = new BCW.BLL.klsfpay().GetRecordCount(" UsID=" + meid + " and klsfId=" + model.klsfId + ""); Random r = new Random(); if (count < buyCount) { string Notes = string.Empty; if (pType == 1)//五胆拖 { int n = r.Next(6, 10); int m = r.Next(1, 3); Notes = GetDTNotes(n, m); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds1; } else if (pType == 2)//五任选 { int n = r.Next(6, 10); Notes = GetRPNotes(n); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds2; } else if (pType == 3)//四胆拖 { int n = r.Next(5, 9); int m = r.Next(1, 3); Notes = GetDTNotes(n, m); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds3; } else if (pType == 4)//四任选 { int n = r.Next(5, 9); Notes = GetRPNotes(n); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds4; } else if (pType == 5)//三胆拖 { int n = r.Next(4, 8); int m = r.Next(1, 2); Notes = GetDTNotes(n, m); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds5; } else if (pType == 6)//三任选 { int n = r.Next(4, 8); Notes = GetRPNotes(n); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds6; } else if (pType == 7)//两胆拖 { int n = r.Next(3, 7); Notes = GetDTNotes(n, 1); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds7; } else if (pType == 8 || pType == 10)//二任选、连二组选 { int n = r.Next(3, 7); Notes = GetRPNotes(n); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); if (pType == 8) { Odds = klsfOdds8; } if (pType == 10) { Odds = klsfOdds10; } } else if (pType == 9)//连二直选 { int n = r.Next(4, 8); int m = r.Next(1, n - 1); Notes = GetDTNotes(n, m); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds9; } else if (pType == 11)//前一红投 { int n = r.Next(1, 2); Notes = GetFSNotes(n, 19, 21); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds11; } else if (pType == 12)//前一数投 { int n = r.Next(1, 5); Notes = GetFSNotes(n, 1, 19); modelPay.Notes = Notes; modelPay.iCount = GetZS(Notes, pType); Odds = klsfOdds12; } else if (pType == 13)//买大小 { int n = r.Next(1, 3); if (n == 1) { Notes = "大"; Odds = klsfOdds13; } else { Notes = "小"; Odds = klsfOdds14; } modelPay.Notes = Notes; modelPay.iCount = 1; } else if (pType == 14)//押单双 { int n = r.Next(1, 3); if (n == 1) { Notes = "单"; Odds = klsfOdds15; } else { Notes = "双"; Odds = klsfOdds16; } modelPay.Notes = Notes; modelPay.iCount = 1; } else if (pType == 15)//押龙虎 { int n = r.Next(1, 9); if (n == 1) { Notes = "龙(1与8位)"; Odds = klsfOdds18; } else if (n == 2) { Notes = "虎(1与8位)"; Odds = klsfOdds19; } else if (n == 3) { Notes = "龙(2与7位)"; Odds = klsfOdds20; } else if (n == 4) { Notes = "虎(2与7位)"; Odds = klsfOdds21; } else if (n == 5) { Notes = "龙(3与6位)"; Odds = klsfOdds22; } else if (n == 6) { Notes = "虎(3与6位)"; Odds = klsfOdds23; } else if (n == 7) { Notes = "龙(4与5位)"; Odds = klsfOdds24; } else if (n == 8) { Notes = "虎(4与5位)"; Odds = klsfOdds25; } modelPay.Notes = Notes; modelPay.iCount = 1; } int IsSWB = Utils.ParseInt(ub.GetSub("klsfSWB", xmlPath)); long gold = 0; gold = new BCW.BLL.User().GetGold(meid); long prices = Convert.ToInt64(Price * modelPay.iCount); long SmallPay = Utils.ParseInt64(ub.GetSub("klsfSmallPay", xmlPath)); long BigPay = Utils.ParseInt64(ub.GetSub("klsfBigPay", xmlPath)); if (prices >= SmallPay && prices <= BigPay) { long xPrices = Utils.ParseInt64(ub.GetSub("klsfPrice", xmlPath)); if (xPrices > 0 && gold >= 0) { long oPrices = new BCW.BLL.klsfpay().GetSumPrices(meid, model.klsfId); if (oPrices + prices <= xPrices) { if (gold < prices) { //更新消费记录 BCW.Model.Goldlog modelx = new BCW.Model.Goldlog(); modelx.BbTag = 3; modelx.Types = 0; modelx.PUrl = Utils.getPageUrl();//操作的文件名 modelx.UsId = meid; modelx.UsName = mename; modelx.AcGold = prices; modelx.AfterGold = (gold + prices);//更新后的币数 modelx.AcText = "系统机器人自动操作"; modelx.AddTime = DateTime.Now; new BCW.BLL.Goldlog().Add(modelx); BCW.Data.SqlHelper.ExecuteSql("Update tb_User set iGold=iGold+(" + prices + ") where ID=" + meid + ""); { modelPay.klsfId = model.klsfId; //购买期数 modelPay.Types = pType; //投注类型 modelPay.UsID = meid; //用户id modelPay.UsName = mename; //用户昵称 modelPay.AddTime = DateTime.Now; //投注时间 modelPay.Result = ""; //开奖结果 modelPay.State = 0; //未开奖 modelPay.WinCent = 0; //获得多少酷币 modelPay.iWin = 0; //中了多少注 modelPay.Price = Price; //每注投多少钱 modelPay.Prices = prices; //总投了多少钱 modelPay.isRoBot = 1; modelPay.Odds = Convert.ToDecimal(Odds); //赔率 int id = new BCW.BLL.klsfpay().Add(modelPay); //动态投注后记录投注信息 #region 根据版本选择快乐币和酷币的获取和显示 string wText = string.Empty; if (IsSWB == 0) { new BCW.SWB.BLL().UpdateMoney(meid, -prices, gid); wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/klsf.aspx]" + GameName + "[/url]《" + OutType(pType) + "》下注" + prices + "快乐币"; } else { new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第[url=./game/klsf.aspx?act=view&id=" + model.ID + "]" + model.klsfId + "[/url]期" + OutType(pType) + ":" + Notes + "|赔率" + modelPay.Odds + "|标识Id" + id + ""); //酷币 //new BCW.BLL.User().UpdateiGold(105, new BCW.BLL.User().GetUsName(105), prices, "ID:[url=forumlog.aspx?act=xview&uid=" + meid + "]" + meid + "[/url]" + GameName + "第[url=./game/klsf.aspx?act=view&id=" +model.ID + "]" + model.klsfId + "[/url]期买" + OutType(pType) + ":" + Notes + "共" + prices+ub.Get("SiteBz") + "-标识Id" +id+ ""); wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/klsf.aspx]" + GameName + "[/url]《" + OutType(pType) + "》下注**" + "" + ub.Get("SiteBz") + ""; //+ prices } #endregion new BCW.BLL.Action().Add(1006, id, meid, mename, wText); } } else { // if (gold >= prices) { modelPay.klsfId = model.klsfId; //购买期数 modelPay.Types = pType; //投注类型 modelPay.UsID = meid; //用户id modelPay.UsName = mename; //用户昵称 modelPay.AddTime = DateTime.Now; //投注时间 modelPay.Result = ""; //开奖结果 modelPay.State = 0; //未开奖 modelPay.WinCent = 0; //获得多少酷币 modelPay.iWin = 0; //中了多少注 modelPay.Price = Price; //每注投多少钱 modelPay.Prices = prices; //总投了多少钱 modelPay.isRoBot = 1; modelPay.Odds = Convert.ToDecimal(Odds); //赔率 int id = new BCW.BLL.klsfpay().Add(modelPay); //动态投注后记录投注信息 #region 根据版本选择快乐币和酷币的获取和显示 string wText = string.Empty; if (IsSWB == 0) { new BCW.SWB.BLL().UpdateMoney(meid, -prices, gid); wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/klsf.aspx]" + GameName + "[/url]《" + OutType(pType) + "》下注" + prices + "快乐币"; } else { new BCW.BLL.User().UpdateiGold(meid, mename, -prices, "" + GameName + "第[url=./game/klsf.aspx?act=view&id=" + model.ID + "]" + model.klsfId + "[/url]期" + OutType(pType) + ":" + Notes + "|赔率" + modelPay.Odds + "|标识Id" + id + ""); //酷币 //new BCW.BLL.User().UpdateiGold(105, new BCW.BLL.User().GetUsName(105), prices, "ID:[url=forumlog.aspx?act=xview&uid=" + meid + "]" + meid + "[/url]" + GameName + "第[url=./game/klsf.aspx?act=view&id=" +model.ID + "]" + model.klsfId + "[/url]期买" + OutType(pType) + ":" + Notes + "共" + prices+ub.Get("SiteBz") + "-标识Id" +id+ ""); wText = "[url=/bbs/uinfo.aspx?uid=" + meid + "]" + mename + "[/url]在[url=/bbs/game/klsf.aspx]" + GameName + "[/url]《" + OutType(pType) + "》下注**" + "" + ub.Get("SiteBz") + ""; //+ prices } #endregion new BCW.BLL.Action().Add(1006, id, meid, mename, wText); } } } } } } } #endregion #region 机器人自动兑奖 string RoBot = ub.GetSub("klsfRobotId", xmlPath); // string RoBotCost = ub.GetSub("ReBotCost", xmlPath); string[] RoBotID = RoBot.Split('#'); for (int i = 0; i < RoBotID.Length; i++) { if (RoBotID[i] != "") { meid = Convert.ToInt32(RoBotID[i].Replace(" ", "")); string mename1 = new BCW.BLL.User().GetUsName(meid); DataSet model2 = new BCW.BLL.klsfpay().GetList("id", "usID=" + meid + " and isRoBot=1 and iWin > 0 and State!=2 "); if (model2 != null && model2.Tables[0].Rows.Count > 0) { for (int i2 = 0; i2 < model2.Tables[0].Rows.Count; i2++) { int pid = 0; try { pid = Convert.ToInt32(model2.Tables[0].Rows[0][i2]); } catch { } if (new BCW.BLL.klsfpay().ExistsReBot(pid, meid)) { if (new BCW.DAL.klsfpay().getState(pid) != 2) { //操作币 BCW.Model.klsfpay model1 = new BCW.BLL.klsfpay().Getklsfpay(pid); int number = new BCW.BLL.klsfpay().GetklsfId(pid); BCW.Model.klsflist idd = new BCW.BLL.klsflist().Getklsflistbyklsfid(number); long winMoney = Convert.ToInt64(model1.WinCent); new BCW.BLL.User().UpdateiGold(meid, mename1, winMoney, "" + GameName + "兑奖-" + "[url=./game/klsf.aspx?act=view&id=" + idd.ID + "&ptype=2]" + number + "[/url]" + "-标识ID:" + pid + ""); //new BCW.BLL.User().UpdateiGold(105, new BCW.BLL.User().GetUsName(105), -winMoney, "ID:[url=forumlog.aspx?act=xview&uid=" + meid + "]" + meid + "[/url]" + GameName + "第[url=./game/klsf.aspx?act=view&id=" + model.ID + "]" + number + "[/url]期兑奖" + winMoney + "(标识ID" + pid + ")"); new BCW.BLL.klsfpay().UpdateState(pid, 2); Response.Write("" + GameName + "机器人" + meid + "自动兑奖!ok1<br />"); } } } } } } #endregion }