private void GetBoCai(GameClient client, int nID, string[] cmdParams, ref GetBoCaiResult mgsData) { try { int BocaiType = Convert.ToInt32(cmdParams[1]); mgsData.Info = 0; mgsData.BocaiType = BocaiType; if (2 == BocaiType) { FunctionSendManager.GetInstance().AddFunction(FunctionType.CaiShuZi, client.ClientData.RoleID); BoCaiCaiShuZi.GetInstance().OpenGetBoCai(client.ClientData.RoleID, ref mgsData); } else if (1 == BocaiType) { FunctionSendManager.GetInstance().AddFunction(FunctionType.CaiDaXiao, client.ClientData.RoleID); BoCaiCaiDaXiao.GetInstance().OpenGetBoCai(client.ClientData.RoleID, ref mgsData); } else { mgsData.Info = 1; } } catch (Exception ex) { mgsData.Info = 100; LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_博彩]{0}", ex.ToString()), null, true); } }
public bool processCmdEx(GameClient client, int nID, byte[] bytes, string[] cmdParams) { try { if (nID == 2082) { BuyBoCaiResult mgsData = new BuyBoCaiResult(); int BocaiType = Convert.ToInt32(cmdParams[1]); int BuyNum = Convert.ToInt32(cmdParams[2]); string strBuyVal = cmdParams[3]; mgsData.BocaiType = BocaiType; if (2 == BocaiType) { this.BuyCaiShuzi(client, BuyNum, strBuyVal, ref mgsData); } else if (1 == BocaiType) { this.BuyCaiDaXiao(client, BuyNum, strBuyVal, ref mgsData); } else { mgsData.Info = 1; } client.sendCmd <BuyBoCaiResult>(nID, mgsData, false); } else if (nID == 2083) { GetBoCaiResult mgsData2 = new GetBoCaiResult(); this.GetBoCai(client, nID, cmdParams, ref mgsData2); client.sendCmd <GetBoCaiResult>(nID, mgsData2, false); } else if (nID == 2086) { client.sendCmd(nID, this.BuyItem(client, nID, cmdParams), false); } else if (nID == 2085) { this.GetShopInfo(client, nID, client.ClientData.RoleID); } } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_博彩]{0}", ex.ToString()), null, true); } return(true); }
public void OpenGetBoCai(int roleid, ref GetBoCaiResult mgsData) { try { lock (this.mutex) { if (null == this.OpenHistory.Find((OpenLottery x) => x.DataPeriods == this.ServerOpenData.DataPeriods)) { this.CopyBuyList(out mgsData.ItemList, roleid); } this.CopyBuyHistoryList(ref mgsData.ItemList, roleid); mgsData.NowPeriods = this.ServerOpenData.DataPeriods; mgsData.IsOpen = (this.StageData.Stage > 1); mgsData.Value1 = this.ServerOpenData.AllBalance.ToString(); mgsData.Stage = this.StageData.Stage; mgsData.OpenHistory = new List <BoCaiOpenHistory>(); if (this.StageData.isOpenDay) { mgsData.OpenTime = TimeUtil.GetDiffTimeSeconds(this.ServerData.GetStageDataTime.AddMilliseconds((double)this.StageData.OpenTime), TimeUtil.NowDateTime(), true); } else { mgsData.OpenTime = TimeUtil.GetDiffTimeSeconds(this.ServerData.GetStageDataTime.AddSeconds((double)this.StageData.OpenTime), TimeUtil.NowDateTime(), true); } BoCaiHelper.CopyHistoryData(this.WinHistory, out mgsData.WinLotteryRoleList); if (null != this.OpenHistory) { foreach (OpenLottery item in this.OpenHistory) { BoCaiOpenHistory data = new BoCaiOpenHistory(); data.DataPeriods = item.DataPeriods; data.OpenValue = item.strWinNum; mgsData.OpenHistory.Add(data); } } } } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_caidaxiao_猜数字]{0}", ex.ToString()), null, true); } }