/// <summary> /// 水果机控制台首页 /// </summary> /// <returns></returns> public ActionResult ConfigIndex(Dictionary <string, string> queryvalues) { string par = queryvalues.ContainsKey("par") ? queryvalues["par"].Trim(',') : ""; string type = queryvalues.ContainsKey("type") ? queryvalues["type"] : ""; string operType = queryvalues.ContainsKey("operType") ? queryvalues["operType"] : ""; if (par.Contains("'")) { return(Content("-4")); } switch (operType) { case "1": //说明是保存配置1,2,3 //type说明是保存的配置 string[] pars = par.Trim(',').Split('|'); string[] par1 = pars[0].Split(','); string[] par2 = pars[1].Split(','); string[] par3 = pars[2].Split(','); string[] par4 = pars[3].Split(','); string[] par5 = pars[4].Split(','); string[] par6 = pars[5].Split(','); string[] par7 = pars[6].Split(','); FruitGameExplodeConfig modelExp = new FruitGameExplodeConfig() { Normal = Convert.ToInt32(par1[0]), Lucky = Convert.ToInt32(par1[1]), Random = Convert.ToInt32(par1[2]), SmallThree = Convert.ToInt32(par1[3]), BigThree = Convert.ToInt32(par2[0]), Bigfour = Convert.ToInt32(par2[1]), Zong = Convert.ToInt32(par2[2]), TianNv = Convert.ToInt32(par2[3]), TianLong = Convert.ToInt32(par3[0]), JiuBao = Convert.ToInt32(par3[1]), GrandSlam = Convert.ToInt32(par3[2]), OpenTrain = Convert.ToInt32(par3[3]), SmallApple = Convert.ToInt32(par4[0]), SmallOrange = Convert.ToInt32(par4[1]), SmallMango = Convert.ToInt32(par4[2]), SmallRing = Convert.ToInt32(par4[3]), SmallWatermalon = Convert.ToInt32(par5[0]), SmallDoubleStar = Convert.ToInt32(par5[1]), SmallDoubleSeven = Convert.ToInt32(par5[2]), Apple = Convert.ToInt32(par5[3]), Orange = Convert.ToInt32(par6[0]), Mango = Convert.ToInt32(par6[1]), Ring = Convert.ToInt32(par6[2]), Watermalon = Convert.ToInt32(par6[3]), DoubleStar = Convert.ToInt32(par7[0]), DoubleSeven = Convert.ToInt32(par7[1]), SmallBar = Convert.ToInt32(par7[2]), BigBar = Convert.ToInt32(par7[3]), Type = Convert.ToInt32(type), CreateTime = DateTime.Now.ToString() }; int res = FruitGameBLL.UpdateExplodeConfig(modelExp); if (res > 0) { //修改成功 // return Content("1"); int callback = MessageSlot(); return(Content(callback.ToString())); } else { return(Content("-3")); } case "2": //说明是修改比倍 List <FruitBibeiConfig> modelList = new List <FruitBibeiConfig>(); string[] parsbibei = par.Trim(',').Split('|'); for (int i = 0; i <= parsbibei.Length - 1; i++) { FruitBibeiConfig m = new FruitBibeiConfig(); string[] ps = parsbibei[i].Split(','); m.SeasonID = i + 1; m.GameNum1 = Convert.ToInt32(Convert.ToDouble(ps[0]) * 1000); m.GameNum2 = Convert.ToInt32(Convert.ToDouble(ps[1]) * 1000); m.GameNum3 = Convert.ToInt32(Convert.ToDouble(ps[2]) * 1000); m.GameNumn = Convert.ToInt32(Convert.ToDouble(ps[3]) * 1000); modelList.Add(m); } int resbibei = FruitGameBLL.UpdateFruitBibei(modelList); if (resbibei > 0) { //修改成功 // return Content("1"); int callback = MessageSlot(); return(Content(callback.ToString())); } else { return(Content("-3")); } case "3": //修改奖池 IEnumerable <FruitPotConfig> potDBData = FruitGameBLL.GetFruitPotConfig("1,2,3,4,5,6", 20); string potStr = ""; string[] parsPot = par.Split('|'); List <FruitPotConfig> modelListPot = new List <FruitPotConfig>(); for (int i = 0; i <= parsPot.Length - 1; i++) { string[] ite = parsPot[i].Split(','); FruitPotConfig m = new FruitPotConfig(); m.Id = Convert.ToInt32(ite[0]); m.Open = Convert.ToInt32(ite[1]); m.CurPot = Convert.ToInt64(ite[2]); m.Critical = Convert.ToInt64(ite[3]); FruitPotConfig exist = potDBData.Where(k => k.Id == m.Id && k.CurPot != m.CurPot).FirstOrDefault(); if (exist != null) //说明奖池被修改了 { potStr = potStr + m.Id + "," + m.CurPot + "|"; } modelListPot.Add(m); } int resPot = FruitGameBLL.UpdateFruitPotConfig(modelListPot); if (resPot > 0) { int callback = MessagePot(potStr); return(Content(callback.ToString())); } else { return(Content("-3")); } case "4": //作弊 string[] parsZuobi = par.Split('|'); List <ArcadeGameStock> modelListArcade = new List <ArcadeGameStock>(); IEnumerable <ArcadeGameStock> zuobiDBData = WaterMarginBLL.GetArcadeGameStockList("'11','12','13','14','15','16'"); string zuobiStr = ""; for (int i = 0; i <= parsZuobi.Length - 1; i++) { string[] ite = parsZuobi[i].Split(','); ArcadeGameStock m = new ArcadeGameStock(); m.ID = Convert.ToInt32(ite[0]); m.StockValue = Convert.ToInt64(ite[1]); m.StockCordon = Convert.ToInt64(ite[2]); m.StockIsOpen = Convert.ToInt32(ite[3]); m.Param1 = Convert.ToInt64(ite[4]); //个人盈利控制开关 m.Param2 = Convert.ToInt64(ite[5]); //充值玩家增益开关 m.Param3 = Convert.ToInt64(ite[6]); //新手玩家增益开关 m.Param4 = 0; //小玛丽触发概率 m.Param5 = 0; //小玛丽开关 m.Param6 = 0; //连输局数 m.Param7 = 0; //全盘奖开关 m.CreateTime = DateTime.Now; modelListArcade.Add(m); ArcadeGameStock zuobidbData = zuobiDBData.Where(k => k.ID == m.ID).FirstOrDefault(); if (zuobidbData != null) { zuobiStr = zuobiStr + m.ID + "," + m.StockValue + "|"; } } int resZuobi = WaterMarginBLL.UpdateArcadeGameStock(modelListArcade); if (resZuobi > 0) { int callback = MessageZuobi(zuobiStr); return(Content(callback.ToString())); } else { return(Content("-3")); } } //爆灯配置 IEnumerable <FruitGameExplodeConfig> data = FruitGameBLL.GetExplodeConfig(); //比倍配置 IEnumerable <FruitBibeiConfig> bibeiConfig = FruitGameBLL.GetBiBeiConfig(); //彩池配置 IEnumerable <FruitPotConfig> potData = FruitGameBLL.GetFruitPotConfig("1,2,3,4,5,6", 20); //水果机作弊库存配置 IEnumerable <ArcadeGameStock> zuobiData = WaterMarginBLL.GetArcadeGameStockList("'11','12','13','14','15','16'"); WaterMarginView model = new WaterMarginView(); model.DataOne = data; model.DataTwo2 = bibeiConfig; model.DataThree = potData; model.DataFour = zuobiData; return(View(model)); }
/// <summary> /// 水浒传控制台首页 /// </summary> /// <returns></returns> public ActionResult ConfigIndex(Dictionary <string, string> queryvalues) { //从数据库中获取配置参数 //QRCodeEncoder qrCodeEncoder = new QRCodeEncoder(); //qrCodeEncoder.QRCodeEncodeMode = QRCodeEncoder.ENCODE_MODE.BYTE; //qrCodeEncoder.QRCodeScale = 4; //qrCodeEncoder.QRCodeVersion = 8; //qrCodeEncoder.QRCodeErrorCorrect = QRCodeEncoder.ERROR_CORRECTION.M; ////System.Drawing.Image image = qrCodeEncoder.Encode("4408810820 深圳-广州 小江"); //System.Drawing.Image image = qrCodeEncoder.Encode("http://www.baidu.com"); //string filename = DateTime.Now.ToString("yyyymmddhhmmssfff").ToString() + ".jpg"; //string filepath = Server.MapPath(@"~\Upload") + "\\" + filename; //System.IO.FileStream fs = new System.IO.FileStream(filepath, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write); //image.Save(fs, System.Drawing.Imaging.ImageFormat.Jpeg); //fs.Close(); //image.Dispose(); //二维码解码 // string s = BaiDuHelper.TransLongUrlToTinyUrl("http://www.515.com/tg/?via=asdf"); string par = queryvalues.ContainsKey("par") ? queryvalues["par"].Trim(',') : ""; string type = queryvalues.ContainsKey("type") ? queryvalues["type"] : ""; string operType = queryvalues.ContainsKey("operType") ? queryvalues["operType"] : ""; if (par.Contains("'")) { return(Content("-4")); } switch (operType) { case "1": //说明是保存配置1,2,3 //type说明是保存的配置 string[] pars = par.Split('|'); List <WaterMargin> modelList = new List <WaterMargin>(); for (int i = 0; i < pars.Length - 1; i++) { WaterMargin m = new WaterMargin(); string[] ps = pars[i].Split(','); m.ColumnNO = i + 1; m.Type = Convert.ToInt32(type); m.Hatchet = Convert.ToInt32(ps[0]); m.Gun = Convert.ToInt32(ps[1]); m.Knife = Convert.ToInt32(ps[2]); m.Lu = Convert.ToInt32(ps[3]); m.Lin = Convert.ToInt32(ps[4]); m.Song = Convert.ToInt32(ps[5]); m.God = Convert.ToInt32(ps[6]); m.Hall = Convert.ToInt32(ps[7]); m.Outlaws = Convert.ToInt32(ps[8]); m.Wine = Convert.ToInt64(Convert.ToDouble(pars[pars.Length - 1]) * 1000); m.CreateTime = DateTime.Now; modelList.Add(m); } int res = WaterMarginBLL.UpdateWatermargin(modelList); if (res > 0) { //修改成功 // return Content("1"); int callback = MessageSlot(); return(Content(callback.ToString())); } else { return(Content("-3")); } case "2": //说明是修改小玛丽 Int64 uplimit = queryvalues.ContainsKey("uplimit") ? Convert.ToInt64(queryvalues["uplimit"]) : 0; Int64 downlimit = queryvalues.ContainsKey("downlimit") ? Convert.ToInt64(queryvalues["downlimit"]) : 0; Int64 bibei1 = queryvalues.ContainsKey("bibei1") ? Convert.ToInt64(queryvalues["bibei1"]) : 0; Int64 bibei2 = queryvalues.ContainsKey("bibei2") ? Convert.ToInt64(queryvalues["bibei2"]) : 0; Int64 bibei3 = queryvalues.ContainsKey("bibei3") ? Convert.ToInt64(queryvalues["bibei3"]) : 0; Int64 bibei4 = queryvalues.ContainsKey("bibei4") ? Convert.ToInt64(queryvalues["bibei4"]) : 0; Int64 bibei5 = queryvalues.ContainsKey("bibei5") ? Convert.ToInt64(queryvalues["bibei5"]) : 0; Int64 bibein = queryvalues.ContainsKey("bibein") ? Convert.ToInt64(queryvalues["bibein"]) : 0; int marryRes = WaterMarginBLL.UpdateMary(1, uplimit, downlimit, bibei1, bibei2, bibei3, bibei4, bibei5, bibein); if (marryRes > 0) { //修改成功 // return Content("1"); int marryCallback = MessageSlot(); return(Content(marryCallback.ToString())); } else { return(Content("-3")); } case "3": //修改奖池 string[] parsPot = par.Split('|'); List <SSwitch> modelListPot = new List <SSwitch>(); string potStr = ""; IEnumerable <SSwitch> potDBData = WaterMarginBLL.GetSSwitchList("'7001','7002','7003','7004','7005','7006'"); for (int i = 0; i <= parsPot.Length - 1; i++) { string[] ite = parsPot[i].Split(','); SSwitch m = new SSwitch(); m.ID = Convert.ToInt32(ite[0]); m.ISOpen = ite[1] == "1"?true:false; m.para1 = Convert.ToInt32(Convert.ToDouble(ite[2]) * 1000); m.para2 = Convert.ToInt64(ite[3]); m.para6 = Convert.ToInt64(ite[4]); SSwitch exist = potDBData.Where(k => k.ID == m.ID && k.para2 != m.para2).FirstOrDefault(); if (exist != null) //说明奖池被修改了 { potStr = potStr + m.ID + "," + m.para2 + "|"; } modelListPot.Add(m); } int resPot = WaterMarginBLL.UpdateSSwitch(modelListPot); if (resPot > 0) { int callback = MessagePot(potStr); return(Content(callback.ToString())); } else { return(Content("-3")); } case "4": //作弊 string[] parsZuobi = par.Split('|'); List <ArcadeGameStock> modelListArcade = new List <ArcadeGameStock>(); IEnumerable <ArcadeGameStock> zuobiDBData = WaterMarginBLL.GetArcadeGameStockList("'1','2','3','4','5','6'"); string zuobiStr = ""; for (int i = 0; i <= parsZuobi.Length - 1; i++) { string[] ite = parsZuobi[i].Split(','); ArcadeGameStock m = new ArcadeGameStock(); m.ID = Convert.ToInt32(ite[0]); m.StockValue = Convert.ToInt64(ite[1]); m.StockCordon = Convert.ToInt64(ite[2]); m.StockIsOpen = Convert.ToInt32(ite[3]); m.Param1 = Convert.ToInt64(ite[4]); //个人盈利控制开关 m.Param2 = Convert.ToInt64(ite[5]); //充值玩家增益开关 m.Param3 = Convert.ToInt64(ite[6]); //新手玩家增益开关 m.Param4 = Convert.ToInt64(Convert .ToDouble(ite[7]) * 1000); //小玛丽触发概率 m.Param5 = Convert.ToInt64(ite[8]); //小玛丽开关 m.Param6 = Convert.ToInt64(ite[9]); //连输局数 m.Param7 = Convert.ToInt64(ite[10]); //全盘奖开关 m.CreateTime = DateTime.Now; modelListArcade.Add(m); ArcadeGameStock zuobidbData = zuobiDBData.Where(k => k.ID == m.ID).FirstOrDefault(); if (zuobidbData != null) { zuobiStr = zuobiStr + m.ID + "," + m.StockValue + "|"; } } int resZuobi = WaterMarginBLL.UpdateArcadeGameStock(modelListArcade); if (resZuobi > 0) { int callback = MessageZuobi(zuobiStr); return(Content(callback.ToString())); } else { return(Content("-3")); } } //slot配置 IEnumerable <WaterMargin> data = WaterMarginBLL.GetWaterMarginList(); //小玛丽 MarryConfig maryConfig = WaterMarginBLL.GetMarryConfig(1); //比倍配置 IEnumerable <BiBeiConfig> bibeiConfig = WaterMarginBLL.GetBiBeiConfig(); //彩池配置 IEnumerable <SSwitch> potData = WaterMarginBLL.GetSSwitchList("'7001','7002','7003','7004','7005','7006'"); IEnumerable <ArcadeGameStock> zuobiData = WaterMarginBLL.GetArcadeGameStockList("'1','2','3','4','5','6'"); WaterMarginView model = new WaterMarginView(); model.DataOne = data; model.DataTwo = maryConfig; model.DataTwo2 = bibeiConfig; model.DataThree = potData; model.DataFour = zuobiData; return(View(model)); }