コード例 #1
0
 public static int LoadConfig(bool isReload = true)
 {
     try
     {
         List <CaiShuZiConfig> _CaiShuZiCfgList;
         BoCaiConfigMgr.LoadCaiShuZi(out _CaiShuZiCfgList);
         List <CaiDaXiaoConfig> _CaiDaXiaoCfgList;
         BoCaiConfigMgr.LoadCaiDaXiao(out _CaiDaXiaoCfgList);
         List <BoCaiConfigMgr.DaiBiShiYongData> _DaiBiShiYongCfgList;
         BoCaiConfigMgr.LoadDaiBiShiYong(out _DaiBiShiYongCfgList);
         List <DuiHuanShangChengConfig> _DuiHuanShangChengCgfList;
         BoCaiConfigMgr.Load_DuiHuanShangCheng(out _DuiHuanShangChengCgfList);
         lock (BoCaiConfigMgr.CaiShuZiCfgList)
         {
             BoCaiConfigMgr.CaiShuZiCfgList = _CaiShuZiCfgList;
         }
         lock (BoCaiConfigMgr.CaiDaXiaoCfgList)
         {
             BoCaiConfigMgr.CaiDaXiaoCfgList = _CaiDaXiaoCfgList;
         }
         lock (BoCaiConfigMgr.DaiBiShiYongCfgList)
         {
             BoCaiConfigMgr.DaiBiShiYongCfgList = _DaiBiShiYongCfgList;
         }
         lock (BoCaiConfigMgr.DuiHuanShangChengCgfList)
         {
             BoCaiConfigMgr.DuiHuanShangChengCgfList = _DuiHuanShangChengCgfList;
         }
         if (isReload)
         {
             BoCaiCaiDaXiao.GetInstance().BigTimeUpData(true);
             BoCaiCaiShuZi.GetInstance().BigTimeUpData(true);
         }
         return(1);
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
     return(0);
 }
コード例 #2
0
        private string BuyItem(GameClient client, int nID, string[] cmdParams)
        {
            string msgInfo = "";

            try
            {
                if (GameManager.systemParamsList.GetParamValueIntByName("HuanLeDuiHuan", -1) < 1L)
                {
                    return(string.Format("{0}{1}", msgInfo, 7));
                }
                int    ID      = Convert.ToInt32(cmdParams[1]);
                int    BuyNum  = Convert.ToInt32(cmdParams[2]);
                string WuPinID = cmdParams[3];
                msgInfo = string.Format("{0}:{1}:{2}:", cmdParams[1], cmdParams[2], cmdParams[3]);
                DuiHuanShangChengConfig cfg = BoCaiConfigMgr.GetBoCaiShopConfig(ID, WuPinID);
                if (null == cfg)
                {
                    return(string.Format("{0}{1}", msgInfo, 14));
                }
                int       useItemNum = cfg.DaiBiJiaGe * BuyNum;
                GoodsData Goods      = GlobalNew.ParseGoodsData(WuPinID);
                if (null == Goods)
                {
                    return(string.Format("{0}{1}", msgInfo, 14));
                }
                if (!HuanLeDaiBiManager.GetInstance().HuanledaibiEnough(client, useItemNum))
                {
                    return(string.Format("{0}{1}", msgInfo, 4));
                }
                if (!Global.CanAddGoods3(client, Goods.GoodsID, BuyNum, Goods.Binding, "1900-01-01 12:00:00", true))
                {
                    return(string.Format("{0}{1}", msgInfo, 13));
                }
                KFBoCaiShopDB item = new KFBoCaiShopDB();
                item.BuyNum  = BuyNum;
                item.ID      = ID;
                item.WuPinID = WuPinID;
                item.RoleID  = client.ClientData.RoleID;
                item.Periods = Convert.ToInt32(TimeUtil.NowDataTimeString("yyMMdd"));
                if (cfg.MeiRiShangXianDan > -1)
                {
                    if (BuyNum > cfg.MeiRiShangXianDan)
                    {
                        return(string.Format("{0}{1}", msgInfo, 17));
                    }
                    if (!BoCaiShopManager.GetInstance().CanBuyItem(item, cfg.MeiRiShangXianDan))
                    {
                        return(string.Format("{0}{1}", msgInfo, 18));
                    }
                }
                if (!HuanLeDaiBiManager.GetInstance().UseHuanledaibi(client, useItemNum))
                {
                    return(string.Format("{0}{1}", msgInfo, 4));
                }
                int ret = Global.AddGoodsDBCommand(Global._TCPManager.TcpOutPacketPool, client, Goods.GoodsID, BuyNum, Goods.Quality, Goods.Props, Goods.Forge_level, Goods.Binding, Goods.Site, Goods.Jewellist, true, 1, "博彩商店购买", "1900-01-01 12:00:00", 0, 0, 0, 0, 0, 0, 0, null, null, 0, true);
                LogManager.WriteLog(LogTypes.Info, string.Format("[ljl_博彩] 博彩商店购买 放在背包ret={1},RoleID={0},WuPinID={2},name={3}", new object[]
                {
                    client.ClientData.RoleID,
                    ret,
                    WuPinID,
                    client.ClientData.RoleName
                }), null, true);
                return(string.Format("{0}{1}", msgInfo, 0));
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl_博彩]{0}", ex.ToString()), null, true);
            }
            return(string.Format("{0}{1}", msgInfo, 100));
        }