Example #1
0
 private void SendMoney(GoldAuctionItem AuctionItem, long averageNum, AuctionConfig AuctionCfg)
 {
     try
     {
         Dictionary <AuctionRoleData, long> sendMsg = new Dictionary <AuctionRoleData, long>();
         if (averageNum >= 1L)
         {
             foreach (AuctionRoleData temp in AuctionItem.RoleList)
             {
                 long num = averageNum;
                 if (AuctionItem.BuyerData.Value > 0L && AuctionItem.BossLife > 0L && temp.Value <= AuctionItem.BossLife)
                 {
                     num += (long)((double)temp.Value / (double)AuctionItem.BossLife * (double)AuctionItem.BuyerData.Value);
                 }
                 sendMsg.Add(temp, num);
             }
             foreach (KeyValuePair <AuctionRoleData, long> temp2 in sendMsg)
             {
                 AuctionRoleData roleData = temp2.Key;
                 int             sendNum  = (int)temp2.Value;
                 try
                 {
                     if (sendNum > 0)
                     {
                         if (!Global.UseMailGivePlayerAward3(roleData.m_RoleID, null, AuctionCfg.SuccessTitle, string.Format(AuctionCfg.SuccessIntro, this.GetItemName(AuctionItem.StrGoods), sendNum), sendNum, 0, 0))
                         {
                             GameManager.logDBCmdMgr.AddMessageLog(-1, "钻石", "邮件发放金团结算失败", roleData.m_RoleName, roleData.m_RoleName, "增加", sendNum, roleData.ZoneID, roleData.strUserID, -1, roleData.ServerId, "");
                             LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]邮件发放金团结算失败 send email roleid={0}, money={1}", roleData.m_RoleID, sendNum), null, true);
                         }
                         else
                         {
                             GameManager.logDBCmdMgr.AddDBLogInfo(-1, "钻石", "邮件发放金团结算", "系统", roleData.m_RoleName, "增加", sendNum, roleData.ZoneID, roleData.strUserID, -1, roleData.ServerId, null);
                         }
                     }
                 }
                 catch (Exception ex)
                 {
                     LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]发放奖励 send email roleid={0}, money={1}, {2}", roleData.m_RoleID, sendNum, ex.ToString()), null, true);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
 }
Example #2
0
        public static AuctionConfig GetAuctionConfig(int id)
        {
            AuctionConfig cfg = null;

            try
            {
                lock (GoldAuctionConfigModel.AuctionDict)
                {
                    GoldAuctionConfigModel.AuctionDict.TryGetValue(id, out cfg);
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
            }
            return(cfg);
        }
Example #3
0
 private bool SetOutTimeItem(GoldAuctionItem AuctionItem)
 {
     try
     {
         if (AuctionItem.Lock || DateTime.Parse(AuctionItem.AuctionTime).AddHours((double)AuctionItem.LifeTime) > TimeUtil.NowDateTime())
         {
             return(true);
         }
         if (AuctionItem.BuyerData.m_RoleID != 0)
         {
             return(this.DisposeAward(AuctionItem));
         }
         AuctionConfig AuctionCfg = GoldAuctionConfigModel.GetAuctionConfig(AuctionItem.AuctionSource);
         if (null == AuctionCfg)
         {
             LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]null == config AuctionSource = {0}", AuctionItem.AuctionSource), null, true);
             return(false);
         }
         int NextAuctiontype = AuctionCfg.GetNextAuction(AuctionItem.AuctionType);
         if (NextAuctiontype <= -1)
         {
             return(this.DisposeAward(AuctionItem));
         }
         AuctionItem.OldAuctionType = AuctionItem.AuctionType;
         AuctionItem.AuctionType    = NextAuctiontype;
         AuctionItem.AuctionTime    = TimeUtil.NowDataTimeString("yyyy-MM-dd HH:mm:ss");
         AuctionItem.UpDBWay        = 3;
         AuctionItem.LifeTime       = AuctionCfg.GetTimeByAuction(NextAuctiontype);
         this.S2CCache.Clear();
         if (this.SendUpdate2DB(AuctionItem))
         {
             LogManager.WriteLog(LogTypes.Info, string.Format("[ljl]超时换拍卖行ProductionTime = {0}, AuctionSource={1},AuctionType={2}", AuctionItem.ProductionTime, AuctionItem.AuctionSource, AuctionItem.AuctionType), null, true);
             return(true);
         }
         LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]超时换拍卖行 db失败 ProductionTime = {0}, AuctionSource={1}", AuctionItem.ProductionTime, AuctionItem.AuctionSource), null, true);
         if (AuctionItem.LifeTime == -1)
         {
             LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]GetTimeByAuction =-1 AuctionOrderEnum={0}", NextAuctiontype), null, true);
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
     return(false);
 }
Example #4
0
 private void InitFromDB()
 {
     try
     {
         for (int i = 1; i < 3; i++)
         {
             LogManager.WriteLog(LogTypes.Info, string.Format("[ljl]InitFromDB AuctionID={0}", i), null, true);
             GetAuctionDBData DBData = Global.sendToDB <GetAuctionDBData, string>(2080, i.ToString(), 0);
             if (DBData == null || !DBData.Flag)
             {
                 LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]GoldAuctionManager.InitFromDB DBData={0}, type={1}", null == DBData, i), null, true);
             }
             else
             {
                 foreach (GoldAuctionDBItem item in DBData.ItemList)
                 {
                     GoldAuctionItem temp = new GoldAuctionItem();
                     CopyData.CopyAuctionDB2Item(item, out temp);
                     AuctionConfig AuctionCfg = GoldAuctionConfigModel.GetAuctionConfig(item.AuctionSource);
                     if (null == AuctionCfg)
                     {
                         LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]GetAuctionConfig null == config AuctionSource ={0}", ((AuctionEnum)item.AuctionSource).ToString()), null, true);
                     }
                     else
                     {
                         temp.LifeTime = AuctionCfg.GetTimeByAuction(i);
                         if (temp.LifeTime == -1)
                         {
                             LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]GetTimeByAuction =-1 AuctionOrderEnum={0}", i), null, true);
                         }
                         else
                         {
                             this.AddNewAuctionItem(temp);
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
     }
 }
Example #5
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);
 }
Example #6
0
 private static bool LoadAuctionData(out Dictionary <int, AuctionConfig> _AuctionAwardDict)
 {
     _AuctionAwardDict = new Dictionary <int, AuctionConfig>();
     try
     {
         XElement xml = CheckHelper.LoadXml(Global.GameResPath("Config/Auction.xml"), true);
         if (null == xml)
         {
             LogManager.WriteLog(LogTypes.Fatal, string.Format("读取 {0} null == xml", "Config/Auction.xml"), null, true);
             return(false);
         }
         IEnumerable <XElement> xmlItems = xml.Elements();
         foreach (XElement xmlItem in xmlItems)
         {
             if (null != xmlItem)
             {
                 AuctionConfig myData = new AuctionConfig();
                 myData.ID           = (int)Global.GetSafeAttributeLong(xmlItem, "ID");
                 myData.Name         = Global.GetSafeAttributeStr(xmlItem, "Name");
                 myData.OriginPrice  = (int)Global.GetSafeAttributeLong(xmlItem, "OriginPrice");
                 myData.UnitPrice    = (int)Global.GetSafeAttributeLong(xmlItem, "UnitPrice");
                 myData.MaxPrice     = (int)Global.GetSafeAttributeLong(xmlItem, "MaxPrice");
                 myData.SuccessTitle = Global.GetSafeAttributeStr(xmlItem, "SuccessTitle");
                 myData.SuccessIntro = Global.GetSafeAttributeStr(xmlItem, "SuccessIntro");
                 myData.FailTitle    = Global.GetSafeAttributeStr(xmlItem, "FailTitle");
                 myData.FailIntro    = Global.GetSafeAttributeStr(xmlItem, "FailIntro");
                 string strTemp = Global.GetSafeAttributeStr(xmlItem, "List");
                 if (!string.IsNullOrEmpty(strTemp))
                 {
                     foreach (int item in Global.StringArray2IntArray(strTemp.Split(new char[]
                     {
                         '|'
                     })))
                     {
                         myData.OrderList.Add(item);
                     }
                 }
                 strTemp = Global.GetSafeAttributeStr(xmlItem, "Time");
                 if (!string.IsNullOrEmpty(strTemp))
                 {
                     foreach (int item in Global.StringArray2IntArray(strTemp.Split(new char[]
                     {
                         '|'
                     })))
                     {
                         myData.TimeList.Add(item);
                     }
                 }
                 if (myData.TimeList.Count != myData.OrderList.Count)
                 {
                     LogManager.WriteLog(LogTypes.Fatal, string.Format("{0}解析出现问题, 第{1} 条数据 进入拍卖行顺序 竞拍时间长度不同 ", "Config/Auction.xml", _AuctionAwardDict.Count + 1), null, true);
                 }
                 _AuctionAwardDict.Add(myData.ID, myData);
             }
         }
     }
     catch (Exception ex)
     {
         LogManager.WriteLog(LogTypes.Fatal, string.Format("{0}解析出现异常, {1}", "Config/Auction.xml", ex.Message), null, true);
         return(false);
     }
     return(true);
 }
 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);
     }
 }
        private void SetGlodAuction(GameClient client, int nID, byte[] bytes, string[] cmdParams, ref int Info)
        {
            GoldAuctionItem item = null;

            Info = 0;
            try
            {
                int      type    = Convert.ToInt32(cmdParams[1]);
                string[] itemKey = cmdParams[2].Split(new char[]
                {
                    '|'
                });
                int Price = Convert.ToInt32(cmdParams[3]);
                if (itemKey == null || itemKey.Length != 2)
                {
                    Info = 3;
                }
                else
                {
                    string ProductionTime = itemKey[0].Replace(',', ':');
                    int    AuctionSource  = Convert.ToInt32(itemKey[1]);
                    if (type == 1 && client.ClientData.Faction < 1)
                    {
                        Info = 1;
                    }
                    AuctionConfig AuctionCfg = GoldAuctionConfigModel.GetAuctionConfig(AuctionSource);
                    if (null == AuctionCfg)
                    {
                        LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]SetGlodAuction ({0}) null == config", AuctionSource), null, true);
                        Info = 4;
                    }
                    else
                    {
                        item = this.GoldAuctionMgr.GetGoldAuctionItem(type, ProductionTime, AuctionSource, true);
                        if (item == null || item.AuctionType != type)
                        {
                            Info = 9;
                        }
                        else if (client.ClientData.RoleID == item.BuyerData.m_RoleID)
                        {
                            Info = 11;
                        }
                        else if (item.BuyerData.m_RoleID == 0 && Price < AuctionCfg.OriginPrice)
                        {
                            Info = 5;
                        }
                        else if (Price < AuctionCfg.UnitPrice)
                        {
                            Info = 6;
                        }
                        else if ((long)Price <= item.BuyerData.Value)
                        {
                            Info = 10;
                        }
                        else if (!GameManager.ClientMgr.SubUserMoney(client, Price, "金团拍卖购买", false, false, false, false, DaiBiSySType.None))
                        {
                            Info = 7;
                        }
                        if (Info != 0)
                        {
                            this.GoldAuctionMgr.UnLock(item.ProductionTime, item.AuctionSource);
                        }
                        else
                        {
                            AuctionRoleData oldBuyerData = new AuctionRoleData();
                            CopyData.Copy <AuctionRoleData>(item.BuyerData, ref oldBuyerData);
                            bool upFlag   = false;
                            int  newBuyer = client.ClientData.RoleID;
                            item.BuyerData.Value      = (long)Price;
                            item.BuyerData.m_RoleID   = client.ClientData.RoleID;
                            item.BuyerData.m_RoleName = client.ClientData.RoleName;
                            item.BuyerData.ZoneID     = client.ClientData.ZoneID;
                            item.BuyerData.strUserID  = client.strUserID;
                            item.BuyerData.ServerId   = client.ServerId;
                            if (Price >= AuctionCfg.MaxPrice && AuctionCfg.MaxPrice > 0)
                            {
                                if (!this.GoldAuctionMgr.DisposeAward(item))
                                {
                                    Info = 8;
                                    LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]一口价 RoleId={0}, Price={1},itemKey={2} fail", newBuyer, Price, cmdParams[1]), null, true);
                                }
                                else
                                {
                                    this.GoldAuctionMgr.DelGoldAuction(item, "金团拍卖购买su");
                                    upFlag = true;
                                }
                            }
                            else if (!this.GoldAuctionMgr.UpdatePrice(item))
                            {
                                Info = 8;
                                LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]更新价格 RoleId={0}, Price={1},itemKey={2} fail", newBuyer, Price, cmdParams[1]), null, true);
                            }
                            else
                            {
                                upFlag = true;
                            }
                            if (upFlag)
                            {
                                this.GoldAuctionMgr.ReturnOldAuctionMoney(oldBuyerData, item.StrGoods);
                            }
                            else
                            {
                                this.GoldAuctionMgr.UnLock(item.ProductionTime, item.AuctionSource);
                                GameManager.logDBCmdMgr.AddMessageLog(-1, "钻石", "金团购买失败扣除钻石", client.ClientData.RoleName, client.ClientData.RoleName, "减少", Price, client.ClientData.ZoneID, client.strUserID, -1, client.ServerId, "");
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                if (null != item)
                {
                    this.GoldAuctionMgr.UnLock(item.ProductionTime, item.AuctionSource);
                }
                Info = 100;
                LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
            }
        }
Example #9
0
 public void SendItem(int roleID, AuctionRoleData roleData, GoldAuctionItem AuctionItem, AuctionConfig AuctionCfg)
 {
     lock (this.AuctionMutex)
     {
         try
         {
             if (roleID <= 0)
             {
                 LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]SendItem roleid=0,ProductionTime={0},AuctionSource={1}", AuctionItem.ProductionTime, AuctionItem.AuctionSource), null, true);
             }
             else
             {
                 List <GoodsData> goodsData = new List <GoodsData>();
                 GoodsData        goods     = GlobalNew.ParseGoodsData(AuctionItem.StrGoods);
                 if (null == goods)
                 {
                     LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]SendItem null == goods,ProductionTime={0},AuctionSource={1}", AuctionItem.ProductionTime, AuctionItem.AuctionSource), null, true);
                 }
                 else
                 {
                     goodsData.Add(goods);
                     string ItemName = this.GetItemName(AuctionItem.StrGoods);
                     if (null == roleData)
                     {
                         roleData = new AuctionRoleData();
                         GameClient client = GameManager.ClientMgr.FindClient(roleID);
                         if (client != null)
                         {
                             roleData.m_RoleID   = roleID;
                             roleData.strUserID  = client.strUserID;
                             roleData.m_RoleName = client.ClientData.RoleName;
                             roleData.ZoneID     = client.ClientData.ZoneID;
                             roleData.ServerId   = client.ServerId;
                         }
                     }
                     string strTitle;
                     string strIntro;
                     if (roleID == AuctionItem.BuyerData.m_RoleID)
                     {
                         strTitle = "购买成功";
                         strIntro = "在金团拍卖购买成功";
                     }
                     else
                     {
                         strTitle = AuctionCfg.FailTitle;
                         strIntro = string.Format(AuctionCfg.FailIntro, ItemName);
                     }
                     if (!Global.UseMailGivePlayerAward3(roleID, goodsData, strTitle, strIntro, 0, 0, 0))
                     {
                         GameManager.logDBCmdMgr.AddMessageLog(-1, ItemName, "邮件发放金团结算失败", roleData.m_RoleName, roleData.m_RoleName, "增加", goods.GCount, roleData.ZoneID, roleData.strUserID, -1, roleData.ServerId, AuctionItem.StrGoods);
                         LogManager.WriteLog(LogTypes.Error, string.Format("[ljl]SendItem 邮件发放金团结算失败 roleid={0}, item = {1}", roleID, AuctionItem.StrGoods), null, true);
                     }
                     else
                     {
                         GameManager.logDBCmdMgr.AddDBLogInfo(-1, ItemName, "邮件发放金团结算", "系统", roleData.m_RoleName, "增加", goods.GCount, roleData.ZoneID, roleData.strUserID, -1, roleData.ServerId, null);
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]SendItem send email roleid={0}, item = {1}", roleID, AuctionItem.StrGoods, ex.ToString()), null, true);
         }
     }
 }
Example #10
0
        public bool DisposeAward(GoldAuctionItem Item)
        {
            try
            {
                lock (this.AuctionMutex)
                {
                    if (null == Item)
                    {
                        return(false);
                    }

                    AuctionConfig AuctionCfg = GoldAuctionConfigModel.GetAuctionConfig(Item.AuctionSource);
                    if (null == AuctionCfg)
                    {
                        LogManager.WriteLog(LogTypes.Error,
                                            string.Format("[ljl]GoldAuctionConfigModel.GetAuctionConfig({0}) null == config",
                                                          (AuctionEnum)Item.AuctionSource), null, true);
                        return(false);
                    }

                    long averageNum = 0L;
                    int  minNum     = (int)GameManager.systemParamsList.GetParamValueIntByName("AngelTempleAuctionMin", 0);
                    if (minNum < 0)
                    {
                        LogManager.WriteLog(LogTypes.Error, "[ljl]AngelTempleAuctionMin < 0", null, true);
                        minNum = 1;
                    }

                    long delNum = 0L;
                    if (0 == Item.BuyerData.m_RoleID)
                    {
                        averageNum = 0L;
                        delNum     = Item.BuyerData.Value;
                    }
                    else if (Item.RoleList.Count < 1)
                    {
                        averageNum = 0L;
                    }
                    else if ((long)(minNum * Item.RoleList.Count) < Item.BuyerData.Value)
                    {
                        averageNum = (long)minNum;
                        delNum     = (long)Item.RoleList.Count * averageNum;
                    }
                    else if ((long)(minNum * Item.RoleList.Count) >= Item.BuyerData.Value)
                    {
                        averageNum = Item.BuyerData.Value / (long)Item.RoleList.Count;
                        delNum     = Item.BuyerData.Value;
                    }

                    Item.UpDBWay        = 1;
                    Item.OldAuctionType = Item.AuctionType;
                    this.S2CCache.Clear();
                    if (!this.SendUpdate2DB(Item))
                    {
                        Item.UpDBWay = 3;
                        return(false);
                    }

                    Item.BuyerData.Value -= delNum;
                    int AwardRole = Item.BuyerData.m_RoleID;
                    if (AwardRole > 0)
                    {
                        this.SendMoney(Item, averageNum, AuctionCfg);
                        this.SendItem(AwardRole, Item.BuyerData, Item, AuctionCfg);
                    }
                    else
                    {
                        AwardRole = Item.GetMaxmDamageID();
                        this.SendItem(AwardRole, Item.RoleList.Find((AuctionRoleData x) => x.m_RoleID == AwardRole),
                                      Item, AuctionCfg);
                    }
                }
            }
            catch (Exception ex)
            {
                LogManager.WriteLog(LogTypes.Exception, string.Format("[ljl]{0}", ex.ToString()), null, true);
                return(false);
            }
            return(true);
        }