public static void AddLiXianSaleGoodsItem(LiXianSaleGoodsItem liXianSaleGoodsItem)
 {
     SaleManager.AddLiXianSaleGoodsItem(liXianSaleGoodsItem);
     lock (LiXianBaiTanManager._LiXianSaleGoodsDict)
     {
         LiXianBaiTanManager._LiXianSaleGoodsDict[liXianSaleGoodsItem.GoodsDbID] = liXianSaleGoodsItem;
     }
 }
示例#2
0
        /// <summary>
        /// 将角色的所有出售的物品加入管理中
        /// </summary>
        /// <param name="dbRoleInfo"></param>
        public static void AddLiXianSaleGoodsItems(GameClient client, int fakeRoleID)
        {
            string           userID        = GameManager.OnlineUserSession.FindUserID(client.ClientSocket);
            List <GoodsData> goodsDataList = client.ClientData.SaleGoodsDataList;

            if (null != goodsDataList)
            {
                lock (goodsDataList)
                {
                    for (int i = 0; i < goodsDataList.Count; i++)
                    {
                        LiXianSaleGoodsItem liXianSaleGoodsItem = new LiXianSaleGoodsItem()
                        {
                            GoodsDbID       = goodsDataList[i].Id,
                            SalingGoodsData = goodsDataList[i],
                            ZoneID          = client.ClientData.ZoneID,
                            UserID          = userID,
                            RoleID          = client.ClientData.RoleID,
                            RoleName        = client.ClientData.RoleName,
                            RoleLevel       = client.ClientData.Level,
                        };

                        AddLiXianSaleGoodsItem(liXianSaleGoodsItem);
                    }
                }
            }

            int maxTicks;

            if (!Global.Flag_MUSale)
            {
                maxTicks = GameManager.ClientMgr.GetLiXianBaiTanTicksValue(client);
            }
            else
            {
                maxTicks = (int)SaleManager.MaxSaleGoodsTime;
            }
            maxTicks = (int)Math.Min(Global.ConstLiXianBaiTanTicks, maxTicks);
            GameManager.ClientMgr.ModifyLiXianBaiTanTicksValue(client, -maxTicks, true);

            lock (_LiXianRoleInfoDict)
            {
                _LiXianRoleInfoDict[client.ClientData.RoleID] = new LiXianSaleRoleItem()
                {
                    ZoneID               = client.ClientData.ZoneID,
                    UserID               = userID,
                    RoleID               = client.ClientData.RoleID,
                    RoleName             = client.ClientData.RoleName,
                    RoleLevel            = client.ClientData.Level,
                    CurrentGrid          = client.CurrentGrid,
                    LiXianBaiTanMaxTicks = maxTicks,
                    StartTicks           = TimeUtil.NOW(),
                    FakeRoleID           = fakeRoleID,
                };
            }
        }
示例#3
0
 /// <summary>
 /// 添加出售的物品项
 /// </summary>
 /// <param name="LiXianSaleGoodsItem"></param>
 public static void AddLiXianSaleGoodsItem(LiXianSaleGoodsItem liXianSaleGoodsItem)
 {
     if (Global.Flag_MUSale)
     {
         SaleManager.AddLiXianSaleGoodsItem(liXianSaleGoodsItem);
     }
     lock (_LiXianSaleGoodsDict)
     {
         _LiXianSaleGoodsDict[liXianSaleGoodsItem.GoodsDbID] = liXianSaleGoodsItem;
     }
 }
        public static LiXianSaleGoodsItem RemoveLiXianSaleGoodsItem(int goodsDbID)
        {
            SaleManager.RemoveSaleGoodsItem(goodsDbID);
            LiXianSaleGoodsItem result;

            lock (LiXianBaiTanManager._LiXianSaleGoodsDict)
            {
                LiXianSaleGoodsItem liXianSaleGoodsItem = null;
                if (LiXianBaiTanManager._LiXianSaleGoodsDict.TryGetValue(goodsDbID, out liXianSaleGoodsItem))
                {
                    LiXianBaiTanManager._LiXianSaleGoodsDict.Remove(goodsDbID);
                }
                result = liXianSaleGoodsItem;
            }
            return(result);
        }
示例#5
0
        /// <summary>
        /// 删除出售的物品项
        /// </summary>
        /// <param name="LiXianSaleGoodsItem"></param>
        public static LiXianSaleGoodsItem RemoveLiXianSaleGoodsItem(int goodsDbID)
        {
            if (Global.Flag_MUSale)
            {
                SaleManager.RemoveSaleGoodsItem(goodsDbID);
            }
            lock (_LiXianSaleGoodsDict)
            {
                LiXianSaleGoodsItem liXianSaleGoodsItem = null;
                if (_LiXianSaleGoodsDict.TryGetValue(goodsDbID, out liXianSaleGoodsItem))
                {
                    _LiXianSaleGoodsDict.Remove(goodsDbID);
                }

                return(liXianSaleGoodsItem);
            }
        }