| System/Auction/AuctionHelpModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Auction/AuctionInquiry.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Auction/AuctionModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Auction/FullServiceAuctionWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Auction/FullServiceAuctioncell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/Auction/AuctionHelpModel.cs
@@ -45,14 +45,6 @@ get { return itemModel; } set { itemModel = value; } } private bool wait = true; public bool Wait { get { return wait; } set { wait = value; } } public bool isOpenPanel = true; public override void Init() { @@ -71,28 +63,15 @@ public void OnBeforePlayerDataInitialize() { GlobalTimeEvent.Instance.secondEvent -= secondEvent; } public void OnPlayerLoginOk() { wait = true; GlobalTimeEvent.Instance.secondEvent += secondEvent; } public override void UnInit() { } private void secondEvent() { if (!wait) { wait = true; } } private void GetAuctionList()//全服获取拍卖列表 System/Auction/AuctionInquiry.cs
@@ -62,13 +62,6 @@ CB516_tagCGQueryAttentionAuctionItem cb516 = new CB516_tagCGQueryAttentionAuctionItem(); GameNetSystem.Instance.SendInfo(cb516); } public void SendQueryTagAuctionItem(string guid)//拍卖行查询定位目标拍品 { var pak = new CB517_tagCGQueryTagAuctionItem(); pak.ItemGUID = guid; GameNetSystem.Instance.SendInfo(pak); } public void SendSellAuctionItem(int itemIndex)//拍卖行上架拍品 { System/Auction/AuctionModel.cs
@@ -10,12 +10,6 @@ namespace Snxxz.UI { public class QueryRemainingClass { public bool UpBool; public bool DownBool; } public class AuctionModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk { Dictionary<string, AuctionItem> m_AuctionItems = new Dictionary<string, AuctionItem>(); @@ -30,15 +24,17 @@ List<int> m_MyFocusItemIds = new List<int>();//关注的物品ID public QueryRemainingClass QueryRemaining = new QueryRemainingClass(); public const int REDPOINT_BASE = 217; public readonly Redpoint redpoint = new Redpoint(2, REDPOINT_BASE);//拍卖行红点 public bool isLocationQuery { get; set; } public string locationGuid { get; set; } public bool isServerPrepare { get; private set; } public bool isAuctionWindowOpen { get; set; } public bool isQueryFront { get; set; } public bool queryFowardAble { get; set; } public bool queryAfterwardAble { get; set; } public DateTime queryTime = DateTime.Now; public event Action myAuctionRefresh; public event Action serverAuctionRefresh;//全服拍品数据请求 @@ -125,8 +121,9 @@ { m_ServerAuctionItemGuids.Clear(); } QueryRemaining.UpBool = isLocationQuery; QueryRemaining.DownBool = true; queryFowardAble = isLocationQuery; queryAfterwardAble = true; queryTime = DateTime.Now; } void RemoveAuctionItems(List<string> itemGuids) @@ -373,12 +370,12 @@ if (package.QueryDir == 1)//往后查询 { QueryRemaining.DownBool = package.QueryRemainlCount != 0; queryAfterwardAble = package.QueryRemainlCount != 0; m_ServerAuctionItemGuids.AddRange(fullServiceAuctionList); } else if (package.QueryDir == 2)//往前查询 { QueryRemaining.UpBool = package.QueryRemainlCount != 0; queryFowardAble = package.QueryRemainlCount != 0; m_ServerAuctionItemGuids.InsertRange(0, fullServiceAuctionList); if (WindowCenter.Instance.IsOpen<FullServiceAuctionWin>()) { @@ -783,6 +780,8 @@ } } queryTime = DateTime.Now; var pak = new CB510_tagCGQueryAuctionItem(); pak.Job = (byte)inquiryConfig.Job; pak.ItemTypeCount = itemTypes == null ? (byte)0 : (byte)itemTypes.Length; @@ -861,6 +860,20 @@ return true; } public bool SatisfyQueryAuction(int direction) { var seconds = (DateTime.Now - queryTime).TotalSeconds; if (direction == 1) { return isAuctionWindowOpen && queryAfterwardAble && seconds >= 1f; } else if (direction == 2) { return isAuctionWindowOpen && queryFowardAble && seconds >= 1f; } return true; } static List<int> ParseFairyPlayers(string familyPlayerIdStr) { List<int> list = new List<int>(); System/Auction/FullServiceAuctionWin.cs
@@ -30,12 +30,11 @@ List<string> itemGuids = new List<string>();//全服拍品列表 int emptyCount = 0; bool queryDirty = true; AuctionModel model { get { return ModelCenter.Instance.GetModel<AuctionModel>(); } } AuctionHelpModel auctionHelpModel { get { return ModelCenter.Instance.GetModel<AuctionHelpModel>(); } } private bool IsSendBool = true; private int Times = 0; protected override void BindController() { m_ScrollerController.OnRefreshCell += OnRefreshGridCell; @@ -53,17 +52,20 @@ protected override void OnPreOpen() { Times = 0; auctionHelpModel.isOpenPanel = true; IsSendBool = false; GlobalTimeEvent.Instance.secondEvent += secondEvent; model.isAuctionWindowOpen = false; queryDirty = false; GlobalTimeEvent.Instance.secondEvent += PerSecond; model.serverAuctionRefresh += FullServiceAuctionUpdate;//数据请求刷新 model.auctionItemRefresh += RefreshAuctionItemUpdate;//刷新 model.onAuctionRemove += ClearAuctionUpdate;//清除 model.myBiddingAuctionRefresh += BiddingItemInfoUpdate;//竞价物品信息刷新 m_ScrollerControllerItem.onValueChange += OnValueChange; m_ScrollerControllerItem.onValueChange += OnValueChange; CloseChildClassify(); ResetServerAuctionInquiry(); CloseTip(); OnCreateGridLineCell(m_ScrollerController); OnCreateGridLineCellJob(m_ScrollerControllerJob); @@ -82,6 +84,12 @@ SetTipText(); } protected override void OnActived() { base.OnActived(); StartCoroutine(Co_Open()); } protected override void OnAfterOpen() { @@ -94,21 +102,28 @@ model.auctionItemRefresh -= RefreshAuctionItemUpdate; model.onAuctionRemove -= ClearAuctionUpdate; model.myBiddingAuctionRefresh -= BiddingItemInfoUpdate;//竞价物品信息刷新 GlobalTimeEvent.Instance.secondEvent -= secondEvent; GlobalTimeEvent.Instance.secondEvent -= PerSecond; m_ScrollerControllerItem.onValueChange -= OnValueChange; StopAllCoroutines(); } IEnumerator Co_Open() { yield return WaitingForSecondConst.WaitMS2000; model.isAuctionWindowOpen = true; } private void OnValueChange(Vector2 delta) { if (delta.y >= 1) { if (!auctionHelpModel.isOpenPanel && auctionHelpModel.Wait && model.QueryRemaining.UpBool) if (model.SatisfyQueryAuction(2)) { var inquiryIndex = AuctionInquiry.Instance.GetInquiryIndex(); if (itemGuids.Count > 0) { model.SendInquiryServerAcution(inquiryIndex, itemGuids[0], 2); auctionHelpModel.Wait = false; } } } @@ -119,16 +134,11 @@ } #endregion private void secondEvent() private void PerSecond() { Times += 1; if (Times >= 3 && auctionHelpModel.isOpenPanel) if (queryDirty) { auctionHelpModel.isOpenPanel = false; } if (IsSendBool) { IsSendBool = false; queryDirty = false; ResetServerAuctionInquiry(); } } @@ -196,9 +206,9 @@ { if (fullServiceAuction.Id != auctionHelpModel.SelectedGenreNow) { CloseTip(); CloseChildClassify(); auctionHelpModel.SelectedGenreNow = fullServiceAuction.Id; IsSendBool = true; queryDirty = true; m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见 OnCreateGridLineCellJob(m_ScrollerControllerJob); OnCreateGridLineCellType(m_ScrollerControllerType); @@ -246,7 +256,7 @@ if (index != config.JobEntry) { auctionHelpModel.FullServiceAuctionDic[selectedGenreNow].JobEntry = index; IsSendBool = true; queryDirty = true; SetTipText(); } }); @@ -291,7 +301,7 @@ if (index != config.TypeEntry) { auctionHelpModel.FullServiceAuctionDic[selectedGenreNow].TypeEntry = index; IsSendBool = true; queryDirty = true; SetTipText(); } }); @@ -304,7 +314,7 @@ var firstGuid = itemGuids.Count > 0 ? itemGuids[0] : string.Empty; itemGuids.Clear(); if (!model.isLocationQuery && !model.QueryRemaining.UpBool) if (!model.isLocationQuery && !model.queryFowardAble) { PushMyBiddingItems(); } @@ -361,21 +371,19 @@ private void ResetServerAuctionInquiry()//重置查询 { model.ResetServerAuctionInquiry(); var inquiryIndex = AuctionInquiry.Instance.GetInquiryIndex(); if (inquiryIndex != 0) if (!model.isLocationQuery) { if (!model.isLocationQuery) { model.SendInquiryServerAcution(inquiryIndex, string.Empty, 1); } var inquiryIndex = AuctionInquiry.Instance.GetInquiryIndex(); model.SendInquiryServerAcution(inquiryIndex, string.Empty, 1); } } private void CloseTip() private void CloseChildClassify() { m_JobTip.SetActive(false); m_TypeTip.SetActive(false); } private void SetTipText() { var selectedGenreNow = auctionHelpModel.SelectedGenreNow; System/Auction/FullServiceAuctioncell.cs
@@ -76,18 +76,16 @@ var inquiryIndex = AuctionInquiry.Instance.GetInquiryIndex(); if (index < 2) { if (inquiryIndex != 0 && auctionHelpModel.Wait && model.QueryRemaining.UpBool && !auctionHelpModel.isOpenPanel) if (model.SatisfyQueryAuction(2)) { model.SendInquiryServerAcution(inquiryIndex, auctionItem.itemGuid, 2); auctionHelpModel.Wait = false; } } else if (index >= totalCount - 5) { if (inquiryIndex != 0 && auctionHelpModel.Wait && model.QueryRemaining.DownBool && !auctionHelpModel.isOpenPanel) if (model.SatisfyQueryAuction(1)) { model.SendInquiryServerAcution(inquiryIndex, auctionItem.itemGuid, 1); auctionHelpModel.Wait = false; } } #endregion