private void GetGlodAuction(GameClient client, int nID, byte[] bytes, string[] cmdParams, ref GoldAuctionS2C msgData)
 {
     try
     {
         int    Auctiontype = Convert.ToInt32(cmdParams[1]);
         int    ordeType    = Convert.ToInt32(cmdParams[2]);
         int    sortNum     = Convert.ToInt32(cmdParams[3]);
         int    startPage   = Convert.ToInt32(cmdParams[4]);
         int    maxNum      = Convert.ToInt32(cmdParams[5]);
         string Seach       = cmdParams[6];
         int    Color       = Convert.ToInt32(cmdParams[7]);
         if (!GoldAuctionManager.IsOpenAuction((AuctionOrderEnum)Auctiontype))
         {
             msgData.Info = 2;
         }
         else if (Auctiontype == 1 && client.ClientData.Faction < 1)
         {
             msgData.Info = 1;
         }
         else
         {
             this.GoldAuctionMgr.GetGoldAuctionS2C(Auctiontype, ordeType, sortNum, startPage, maxNum, Seach, Color, ref msgData);
             msgData.Info = 0;
         }
     }
     catch (Exception ex)
     {
         msgData.Info = 100;
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
 }
Ejemplo n.º 2
0
        public int GetNextAuction(int Auction)
        {
            bool isFind = false;

            foreach (int item in this.OrderList)
            {
                if (Auction == item)
                {
                    isFind = true;
                }
                else if (GoldAuctionManager.IsOpenAuction((AuctionOrderEnum)item))
                {
                    if (isFind)
                    {
                        return(item);
                    }
                }
            }
            return(-1);
        }
 public void KillBossAddAuction(int KillBossRole, long BossLife, List <AuctionRoleData> PointInfoList, AuctionEnum AuctionSource)
 {
     try
     {
         lock (this.AuctionMsgMutex)
         {
             AuctionAwardConfig AuctionAwardCfg = GoldAuctionConfigModel.RandAuctionAwardConfig();
             if (null == AuctionAwardCfg)
             {
                 LogManager.WriteLog(LogTypes.Error, "[ljl]KillBossAddAuction RandAuctionAwardConfig null == config", null, true);
             }
             else
             {
                 AuctionConfig AuctionCfg = GoldAuctionConfigModel.GetAuctionConfig((int)AuctionSource);
                 if (null == AuctionCfg)
                 {
                     LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]GoldAuctionConfigModel.GetAuctionConfig({0}) null == config", AuctionSource), null, true);
                 }
                 else
                 {
                     GoldAuctionItem item = new GoldAuctionItem();
                     item.AuctionSource      = (int)AuctionSource;
                     item.KillBossRoleID     = KillBossRole;
                     item.UpDBWay            = 2;
                     item.ProductionTime     = TimeUtil.NowDataTimeString("yyyy-MM-dd HH:mm:ss.fff");
                     item.BuyerData          = new AuctionRoleData();
                     item.BuyerData.m_RoleID = 0;
                     item.BuyerData.Value    = (long)AuctionCfg.OriginPrice;
                     int index = Global.GetRandomNumber(AuctionAwardCfg.StartValues, AuctionAwardCfg.EndValues) - 1;
                     index         = Math.Min(index, AuctionAwardCfg.strGoodsList.Count - 1);
                     item.StrGoods = AuctionAwardCfg.strGoodsList[index];
                     if (null == GlobalNew.ParseGoodsData(AuctionAwardCfg.strGoodsList[index]))
                     {
                         LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]null == item.Goods index={0}  ,  GoodsList.Count = {1}", index, AuctionAwardCfg.strGoodsList.Count), null, true);
                     }
                     else
                     {
                         item.BossLife = 0L;
                         foreach (AuctionRoleData PointInfo in PointInfoList)
                         {
                             item.BossLife += PointInfo.Value;
                             if (PointInfo.Value >= GameManager.systemParamsList.GetParamValueIntByName("AngelTempleAuction", -1))
                             {
                                 AuctionRoleData RoleData = new AuctionRoleData();
                                 CopyData.Copy <AuctionRoleData>(PointInfo, ref RoleData);
                                 item.RoleList.Add(RoleData);
                             }
                         }
                         if (item.BossLife < 1L)
                         {
                             item.BossLife = BossLife;
                         }
                         bool addFlag = false;
                         for (int i = 0; i < AuctionCfg.OrderList.Count; i++)
                         {
                             if (GoldAuctionManager.IsOpenAuction((AuctionOrderEnum)AuctionCfg.OrderList[i]))
                             {
                                 item.AuctionType = AuctionCfg.OrderList[i];
                                 item.LifeTime    = AuctionCfg.TimeList[i];
                                 if (item.AuctionType > 0 && item.AuctionType < 3)
                                 {
                                     if (this.GoldAuctionMgr.SendUpdate2DB(item))
                                     {
                                         this.GoldAuctionMgr.AddNewAuctionItem(item);
                                     }
                                     else
                                     {
                                         LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]新拍卖物品存库失败 未加入 time={0},AuctionSource={1}", item.ProductionTime, AuctionSource), null, true);
                                     }
                                     addFlag = true;
                                     break;
                                 }
                                 LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]AuctionType ={1} err,AuctionSource={0}", AuctionSource, item.AuctionType), null, true);
                             }
                         }
                         if (!addFlag)
                         {
                             int roleID = item.GetMaxmDamageID();
                             this.GoldAuctionMgr.SendItem(roleID, item.RoleList.Find((AuctionRoleData x) => x.m_RoleID == roleID), item, AuctionCfg);
                             LogManager.WriteLog(LogTypes.Info, string.Format("[ljl]新拍卖物品未加入 直接邮件发送给玩家第一名 time={0},AuctionSource={1}", item.ProductionTime, AuctionSource), null, true);
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
 }