public void CleanWebEnts() { AuthenticatedCache.Clear(); IgnoreCache.Clear(); foreach (var info in ProtectedEntCache) { if (_tick - info.Value.LastTick > 180) { ProtectCache cache; if (ProtectedEntCache.TryRemove(info.Key, out cache)) { Session.Instance.EntRefreshQueue.Enqueue(info.Key); Session.Instance.ProtectCachePool.Return(cache); Session.Instance.FastRefresh = true; } } } foreach (var webent in WebEnts) { if (_tick - webent.Value.LastTick > 180) { EntIntersectInfo removedEnt; WebEnts.TryRemove(webent.Key, out removedEnt); Session.Instance.EntIntersectInfoPool.Return(removedEnt); EnemyShields.Remove(webent.Key); } } }
public void CleanWebEnts() { AuthenticatedCache.Clear(); IgnoreCache.Clear(); _protectEntsTmp.Clear(); _protectEntsTmp.AddRange(ProtectedEntCache.Where(info => _tick - info.Value.LastTick > 180)); foreach (var protectedEnt in _protectEntsTmp) { ProtectedEntCache.Remove(protectedEnt.Key); } _webEntsTmp.Clear(); _webEntsTmp.AddRange(WebEnts.Where(info => _tick - info.Value.LastTick > 180)); foreach (var webent in _webEntsTmp) { EntIntersectInfo removedEnt; WebEnts.TryRemove(webent.Key, out removedEnt); EnemyShields.Remove(webent.Key); } }