コード例 #1
0
 public static bool Copy2AuctionItemS2C(AuctionItemS2C sData, out AuctionItemS2C rData, GoldAuctionItem AuctionItem)
 {
     rData = new AuctionItemS2C();
     try
     {
         CopyData.Copy <AuctionItemS2C>(sData, ref rData);
         rData.Goods = new GoodsData();
         if (null != AuctionItem)
         {
             rData.LastTime = TimeUtil.GetDiffTimeSeconds(DateTime.Parse(AuctionItem.AuctionTime).AddHours((double)AuctionItem.LifeTime), TimeUtil.NowDateTime(), false);
         }
         CopyData.Copy <GoodsData>(sData.Goods, ref rData.Goods);
         return(true);
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
     return(false);
 }
コード例 #2
0
 public static bool Copy2AuctionItemS2C(GoldAuctionItem sData, out AuctionItemS2C rData, string Seach, int Color)
 {
     rData = new AuctionItemS2C();
     try
     {
         rData.Goods = GlobalNew.ParseGoodsData(sData.StrGoods);
         int goodsID = rData.Goods.GoodsID;
         if (!string.IsNullOrEmpty(Seach))
         {
             List <int> goodsIDs = Global.StringToIntList(Seach, '#');
             if (goodsIDs.Find((int x) => x == goodsID) < 1)
             {
                 return(false);
             }
         }
         int color = Global.GetEquipColor(rData.Goods);
         if (Color > 0 && (1 << color - 1 & Color) == 0)
         {
             return(false);
         }
         rData.BuyRoleId      = sData.BuyerData.m_RoleID;
         rData.Price          = sData.BuyerData.Value;
         rData.AuctionItemKey = string.Format("{0}|{1}", sData.ProductionTime.Replace(':', ','), sData.AuctionSource);
         AuctionConfig cfg = GoldAuctionConfigModel.GetAuctionConfig(sData.AuctionSource);
         if (null != cfg)
         {
             rData.MaxPrice  = (long)cfg.MaxPrice;
             rData.UnitPrice = (long)cfg.UnitPrice;
         }
         rData.LastTime = TimeUtil.GetDiffTimeSeconds(DateTime.Parse(sData.AuctionTime).AddHours((double)sData.LifeTime), TimeUtil.NowDateTime(), false);
         return(true);
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
     return(false);
 }