Class PacketFilterQueue

java.lang.Object
com.comphenix.protocol.injector.netty.PacketFilterQueue

public class PacketFilterQueue extends Object
Stores packets that need to be sent without being handled by the listeners (filtered=false). When other packets sent after sending the packet are removed, the packet is removed as well to prevent a memory leak, assuming a consistent send order is in place.
Author:
bergerkiller
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add​(Object packet)
    Adds a packet to this queue, indicating further on that it should not be filtered.
    boolean
    contains​(Object packet)
    Checks whether a packet is contained inside this queue, indicating it should not be filtered.
    boolean
    remove​(Object packet)
    Checks whether a packet is contained inside this queue and removes it if so.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PacketFilterQueue

      public PacketFilterQueue()
  • Method Details

    • add

      public void add(Object packet)
      Adds a packet to this queue, indicating further on that it should not be filtered.
      Parameters:
      packet -
    • contains

      public boolean contains(Object packet)
      Checks whether a packet is contained inside this queue, indicating it should not be filtered.
      Parameters:
      packet -
      Returns:
      True if contained and packet should not be filtered (filtered=false)
    • remove

      public boolean remove(Object packet)
      Checks whether a packet is contained inside this queue and removes it if so. Other packets marked in this queue that were sent before this packet are removed from the queue also, avoiding memory leaks because of dropped packets.
      Parameters:
      packet -
      Returns:
      True if contained and packet should not be filtered (filtered=false)