//查询广播道具 public static void GetItems(int type, ulong characterId, int level, int count, StoreBroadcastList sbList) { mImpl.GetItems(type, characterId, level, count, sbList); }
//缓存商店可看到的其他玩家 public void ChechTemp(StoreBroadcastList temp) { mImpl.ChechTemp(this, temp); }
//查询广播道具 public void GetItems(int type, ulong characterId, int level, int count, StoreBroadcastList sbList) { ExchangeBroadcast findEB = null; var beginlevel = ExchangeManager.FindLevel[level]; var beginIndex = ExchangeManager.FindIndex[level]; var isEnd = false; //ExchangeManager.mBroadcasts.TryGetValue(characterId, out findEB); if (!ExchangeManager.mBroadcasts.TryGetValue(characterId, out findEB)) { findEB = new ExchangeBroadcast(characterId); ExchangeManager.mBroadcasts[characterId] = findEB; } sbList.CacheOverTime = TeamServerControl.tm.GetNextTime(findEB.trigger).ToBinary(); if (type != 0) { findEB.LookList.Clear(); for (var i = 0; i != count; ++i) { var item = GetNextItem(level, beginlevel, beginIndex, ref isEnd); if (item == null) { break; } foreach (var one in sbList.Items) { if (one.Id == item.Id) { item = null; break; } } if (item == null) { break; } if (item.SellCharacterId != characterId) //是否要过滤自己的东西 { findEB.LookList.Add(item); sbList.Items.Add(GetConverNetData(item)); } else { i--; } if (isEnd) { break; } } return; } var nowCount = 0; foreach (var l in findEB.LookList) { sbList.Items.Add(GetConverNetData(l)); nowCount++; } for (var i = nowCount; i < count; ++i) { var item = GetNextItem(level, beginlevel, beginIndex, ref isEnd); if (item == null) { break; } foreach (var one in sbList.Items) { if (one.Id == item.Id) { item = null; break; } } if (item == null) { break; } if (item.SellCharacterId != characterId) //是否要过滤自己的东西 { if (findEB.IsHave(item.Id) == null) { findEB.LookList.Add(item); sbList.Items.Add(GetConverNetData(item)); } } else { i--; } if (isEnd) { break; } } }
//缓存商店可看到的其他玩家 public void ChechTemp(Exchange _this, StoreBroadcastList temp) { _this.ChechTempList = temp; _this.ChechOverTime = DateTime.FromBinary(temp.CacheOverTime); //DateTime.Now.AddMinutes(Exchange.RefreshCDTime); }