少年修仙传客户端代码仓库
client_linchunjie
2019-04-01 3bc0b933b0bbcd7e8672ca6888ec1a090f52e277
3335 拍卖行修改
3个文件已修改
112 ■■■■ 已修改文件
System/Auction/AuctionLogicUtil.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/AuctionModel.cs 90 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/FamilyAuctionWin.cs 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/Auction/AuctionLogicUtil.cs
@@ -50,6 +50,7 @@
            {
                var endTime = item.putAwayTime.AddTicks(TimeSpan.TicksPerMinute * config.NoticeSaleMinutes);
                var seconds = Mathf.CeilToInt((float)(endTime - TimeUtility.ServerNow).TotalSeconds);
                seconds = Mathf.Max(0, seconds);
                return Language.Get("PMH_03", TimeUtility.SecondsToHMS(seconds));
            }
@@ -61,11 +62,13 @@
            if (isExtraTime)
            {
                var seconds = Mathf.CeilToInt((float)(extraEndTime - TimeUtility.ServerNow).TotalSeconds);
                seconds = Mathf.Max(0, seconds);
                return Language.Get("PMH_18", TimeUtility.SecondsToHMS(seconds));
            }
            else
            {
                var seconds = Mathf.CeilToInt((float)(normalEndTime - TimeUtility.ServerNow).TotalSeconds);
                seconds = Mathf.Max(0, seconds);
                return Language.Get("PMH_04", TimeUtility.SecondsToHMS(seconds));
            }
        }
System/Auction/AuctionModel.cs
@@ -55,7 +55,6 @@
        public event Action myFocusAuctionRefresh;//拍卖行关注中的拍品信息变更(信息每次重置)
        public event Action auctionItemRefresh;//拍卖行数据刷新(仅用于数据刷新)
        public event Action onAuctionRemove;//拍卖行物品清除
        public event Action onFairyAuctionRemove;//清除仙盟物品
        public event Action AddAuctionItemInfoUpdate;
        AuctionHelpModel auctionHelpModel { get { return ModelCenter.Instance.GetModel<AuctionHelpModel>(); } }
@@ -114,9 +113,9 @@
            if (PlayerDatas.Instance.baseData.FamilyId == 0)
            {
                m_FairyAuctionItemGuids.Clear();
                if (onFairyAuctionRemove != null)
                if (fairyAuctionRefresh != null)
                {
                    onFairyAuctionRemove();
                    fairyAuctionRefresh();
                }
            }
        }
@@ -343,11 +342,8 @@
                item.itemId = (int)data.ItemID;
                item.itemCount = (int)data.ItemCount;
                item.putAwayTime = DateTime.Parse(data.AddTime);
                var str = UIHelper.ServerStringTrim(data.BiddingTime);
                if (!str.Equals(string.Empty))
                {
                    item.biddingTime = DateTime.Parse(str);
                }
                var biddingTimeLabel = UIHelper.ServerStringTrim(data.BiddingTime);
                item.biddingTime = string.IsNullOrEmpty(biddingTimeLabel) ? DateTime.MinValue : DateTime.Parse(biddingTimeLabel);
                item.biddingPrice = data.BidderPrice;
                item.customData = data.UserData;
@@ -400,11 +396,8 @@
                item.itemId = (int)data.ItemID;
                item.itemCount = (int)data.ItemCount;
                item.putAwayTime = DateTime.Parse(data.AddTime);
                var str = UIHelper.ServerStringTrim(data.BiddingTime);
                if (!str.Equals(string.Empty))
                {
                    item.biddingTime = DateTime.Parse(str);
                }
                var biddingTimeLabel = UIHelper.ServerStringTrim(data.BiddingTime);
                item.biddingTime = string.IsNullOrEmpty(biddingTimeLabel) ? DateTime.MinValue : DateTime.Parse(biddingTimeLabel);
                item.biddingPrice = data.BidderPrice;
                item.customData = data.UserData;
@@ -496,11 +489,8 @@
                item.itemId = (int)data.ItemID;
                item.itemCount = (int)data.ItemCount;
                item.putAwayTime = DateTime.Parse(data.AddTime);
                var str = UIHelper.ServerStringTrim(data.BiddingTime);
                if (!str.Equals(string.Empty))
                {
                    item.biddingTime = DateTime.Parse(str);
                }
                var biddingTimeLabel = UIHelper.ServerStringTrim(data.BiddingTime);
                item.biddingTime = string.IsNullOrEmpty(biddingTimeLabel) ? DateTime.MinValue : DateTime.Parse(biddingTimeLabel);
                item.biddingPrice = data.BidderPrice;
                item.customData = data.UserData;
                item.familyPlayers = new List<int>();
@@ -538,11 +528,8 @@
                item.itemId = (int)data.ItemID;
                item.itemCount = (int)data.ItemCount;
                item.putAwayTime = DateTime.Parse(data.AddTime);
                var str = UIHelper.ServerStringTrim(data.BiddingTime);
                if (!str.Equals(string.Empty))
                {
                    item.biddingTime = DateTime.Parse(str);
                }
                var biddingTimeLabel = UIHelper.ServerStringTrim(data.BiddingTime);
                item.biddingTime = string.IsNullOrEmpty(biddingTimeLabel) ? DateTime.MinValue : DateTime.Parse(biddingTimeLabel);
                item.biddingPrice = data.BidderPrice;
                item.customData = data.UserData;
@@ -577,6 +564,8 @@
        public void ReceivePackage(HB508_tagGCRefreshAuctionItemInfo package)//拍卖行刷新拍品(只进行刷新)
        {
            var refreshFairyAuction = false;
            for (int i = 0; i < package.RefreshCount; i++)
            {
                var data = package.RefreshAuctionItemList[i];
@@ -586,37 +575,43 @@
                AuctionItem item;
                if (!TryGetAuctionItem(guid, out item))
                {
                    continue;
                    item = new AuctionItem(guid);
                    PushAuctionItem(item);
                }
                var _autionType = item.auctionType;
                item.auctionType = data.AuctionType;
                item.putAwayTime = DateTime.Parse(data.AddTime);
                item.biddingTime = DateTime.Parse(data.BiddingTime);
                var biddingTimeLabel = UIHelper.ServerStringTrim(data.BiddingTime);
                item.biddingTime = string.IsNullOrEmpty(biddingTimeLabel) ? DateTime.MinValue : DateTime.Parse(biddingTimeLabel);
                item.biddingPlayer = (int)data.BidderID;
                item.biddingPrice = (int)data.BidderPrice;
                var str = UIHelper.ServerStringTrim(data.BiddingTime);
                if (!str.Equals(string.Empty))
                {
                    item.biddingTime = DateTime.Parse(str);
                }
                if (m_FairyAuctionItemGuids.Contains(guid) && item.auctionType != 1)// 拍卖行仙盟拍卖中的物品信息
                if (_autionType == 1 && item.auctionType != 1)// 拍卖行仙盟拍卖中的物品信息
                {
                    m_FairyAuctionItemGuids.Remove(guid);
                    if (onFairyAuctionRemove != null)
                    {
                        onFairyAuctionRemove();
                    }
                    refreshFairyAuction = true;
                }
                if (auctionItemRefresh != null)
            }
            if (refreshFairyAuction)
            {
                if (fairyAuctionRefresh != null)
                {
                    auctionItemRefresh();
                    fairyAuctionRefresh();
                }
            }
            if (auctionItemRefresh != null)
            {
                auctionItemRefresh();
            }
        }
        public void ReceivePackage(HB509_tagGCClearAuctionItemInfo package)//拍卖行清除拍品 
        {
            var refreshFairyAuction = false;
            for (int i = 0; i < package.ClearCount; i++)
            {
                var ItemGUIDList = package.ClearAuctionItemList[i];
@@ -629,10 +624,7 @@
                if (m_FairyAuctionItemGuids.Contains(guid))// 清除拍卖行仙盟拍卖中的物品信息
                {
                    m_FairyAuctionItemGuids.Remove(guid);
                    if (onFairyAuctionRemove != null)
                    {
                        onFairyAuctionRemove();
                    }
                    refreshFairyAuction = true;
                }
                var index = m_ServerAuctionItemGuids.IndexOf(guid);
                if (index != -1)//清除全服拍品的某一件物品
@@ -649,6 +641,13 @@
                }
                RemoveAuctionItem(guid);
            }
            if (refreshFairyAuction)
            {
                if (fairyAuctionRefresh != null)
                {
                    fairyAuctionRefresh();
                }
            }
            if (onAuctionRemove != null)
            {
@@ -675,11 +674,8 @@
                item.itemCount = data.ItemCount;
                item.familyId = (int)data.FamilyID;
                item.putAwayTime = DateTime.Parse(data.AddTime);
                var str = UIHelper.ServerStringTrim(data.BiddingTime);
                if (!str.Equals(string.Empty))
                {
                    item.biddingTime = DateTime.Parse(str);
                }
                var biddingTimeLabel = UIHelper.ServerStringTrim(data.BiddingTime);
                item.biddingTime = string.IsNullOrEmpty(biddingTimeLabel) ? DateTime.MinValue : DateTime.Parse(biddingTimeLabel);
                item.biddingPrice = data.BidderPrice;//竞拍玩家出价
                item.biddingPlayer = (int)data.BidderID;//竞拍玩家ID,也就是当前最高竞价玩家ID
                item.customData = data.UserData;
System/Auction/FamilyAuctionWin.cs
@@ -19,7 +19,7 @@
        AuctionModel model { get { return ModelCenter.Instance.GetModel<AuctionModel>(); } }
        AuctionHelpModel auctionHelpModel { get { return ModelCenter.Instance.GetModel<AuctionHelpModel>(); } }
        List<string> fairyAuctionItems = new List<string>();
        List<string> itemGuids = new List<string>();
        #region Built-in
        protected override void BindController()
        {
@@ -37,7 +37,7 @@
            OnCreateGridCellItem(m_ScrollerControllerItem);
            var index = fairyAuctionItems.FindIndex((x) =>
            var index = itemGuids.FindIndex((x) =>
             {
                 return x.Equals(model.locationGuid);
             });
@@ -53,7 +53,6 @@
        protected override void OnAfterOpen()
        {
            model.fairyAuctionRefresh += FamilyAuctionReset;
            model.onFairyAuctionRemove += FamilyAuctionReset;
            model.auctionItemRefresh += RefreshAuctionItemUpdate;
            model.myBiddingAuctionRefresh += RefreshAuctionItemUpdate;
        }
@@ -61,13 +60,9 @@
        protected override void OnPreClose()
        {
            model.fairyAuctionRefresh -= FamilyAuctionReset;
            model.onFairyAuctionRemove -= FamilyAuctionReset;
            model.myBiddingAuctionRefresh -= RefreshAuctionItemUpdate;
            model.auctionItemRefresh -= RefreshAuctionItemUpdate;
        }
        protected override void OnAfterClose()
        {
@@ -90,7 +85,7 @@
        {
            gridCtrl.Refresh();
            for (int i = 0; i < fairyAuctionItems.Count; i++)
            for (int i = 0; i < itemGuids.Count; i++)
            {
                gridCtrl.AddCell(ScrollerDataType.Header, i);
            }
@@ -101,14 +96,14 @@
        {
            int index = cell.index;
            FamilyAuctioncell familyAuctionCell = cell.GetComponent<FamilyAuctioncell>();
            familyAuctionCell.GetFamilyAuctionGUID(fairyAuctionItems[index]);
            familyAuctionCell.GetFamilyAuctionGUID(itemGuids[index]);
        }
        private void GetFamilyAuctionItemList()
        {
            fairyAuctionItems.Clear();
            this.itemGuids.Clear();
            var itemGuids = model.GetFairyAuctionItems();
            foreach (var guid in itemGuids)
            {
@@ -117,7 +112,7 @@
                {
                    if (item.auctionType == 1)
                    {
                        fairyAuctionItems.Add(guid);
                        this.itemGuids.Add(guid);
                    }
                }
            }
@@ -125,7 +120,7 @@
        private void ListSotr()
        {
            fairyAuctionItems.Sort(Compare);
            itemGuids.Sort(Compare);
        }
        int Compare(string x, string y)//数组排列