public void AddFilter(int opcode, bool fromServer) { FilterItem fItem = new FilterItem(opcode, fromServer); if (this.filter.ContainsKey(fItem.GetHashCode())) { return; } this.filter.Add(fItem.GetHashCode(), fItem); this.applyFilter(); }
public void RemoveFilter(int opcode, bool fromServer) { FilterItem fItem = new FilterItem(opcode, fromServer); this.filter.Remove(fItem.GetHashCode()); this.applyFilter(); }
public void applyFilter() { // Clear the old list this.diplayedList.Clear(); // neue Größe schonmal festlegen this.diplayedList.Capacity = this.packetList.Count; FilterItem f; foreach (L2Packet p in this.packetList) { f = new FilterItem(p.OpCode, (p is GameServerPacket)); if (this.filter.ContainsKey(f.GetHashCode())) { continue; } this.diplayedList.Add(p); } }