private void getBoCaiOpenList(GameServerClient client, int nID, string cmdData) { GetOpenList msgData = new GetOpenList(); msgData.Flag = false; try { string[] files = cmdData.Split(new char[] { ',' }); int type = Convert.ToInt32(files[1]); long DataPeriods = Convert.ToInt64(files[1]); msgData.MaxDataPeriods = BoCaiDBOperator.GetMaxData(type); BoCaiDBOperator.SelectOpenLottery(type, out msgData.ItemList); if (msgData.MaxDataPeriods >= 0L && null != msgData.ItemList) { msgData.Flag = true; } } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true); } client.sendCmd <GetOpenList>(nID, msgData); }
private void setShopData(GameServerClient client, int nID, byte[] cmdParams, int count) { string msgStr = "false"; try { BoCaiShopDB Data = DataHelper.BytesToObject <BoCaiShopDB>(cmdParams, 0, count); msgStr = BoCaiDBOperator.ReplaceBoCaiShop(Data).ToString(); } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, ex.ToString(), null, true); } client.sendCmd(nID, msgStr); }
private void updateBuy(GameServerClient client, int nID, byte[] cmdParams, int count) { string msgStr = "false"; try { BuyBoCai2SDB Data = DataHelper.BytesToObject <BuyBoCai2SDB>(cmdParams, 0, count); msgStr = BoCaiDBOperator.ReplaceBuyBoCai(Data).ToString(); } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true); } client.sendCmd(nID, msgStr); }
private void getShopList(GameServerClient client, int nID, byte[] cmdParams, int count) { BoCaiShopDBData msgData = new BoCaiShopDBData(); try { DateTime time = TimeUtil.NowDateTime(); string Periods = TimeUtil.DataTimeToString(time, "yyMMdd"); BoCaiDBOperator.SelectBoCaiShop(Periods, out msgData.ItemList); msgData.Flag = (null != msgData.ItemList); } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, ex.ToString(), null, true); } client.sendCmd <BoCaiShopDBData>(nID, msgData); }
public void LoadDataFromDB(DBManager DBMgr) { try { DateTime time = TimeUtil.NowDateTime(); string Periods = TimeUtil.DataTimeToString(time, "yyMMdd"); BoCaiDBOperator.DelData("t_bocai_shop", string.Format("Periods!='{0}'", Periods)); for (int i = 1; i < 3; i++) { long DataPeriods = this.GetNowPeriods(time, i); BoCaiDBOperator.DelData("t_bocai_open_lottery", string.Format("IsAward=1 AND BocaiType={1} AND DataPeriods < {0}", DataPeriods, i)); BoCaiDBOperator.DelData("t_bocai_buy_history", string.Format("IsSend=1 AND BocaiType={1} AND DataPeriods < {0}", DataPeriods, i)); } } catch (Exception ex) { LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true); } }