Class PacketTracker

  • public class PacketTracker
    extends java.lang.Object
    • Constructor Detail

    • Method Detail

      • incrementSent

        public void incrementSent()
        Used for incrementing the number of packets sent to the client.
      • incrementReceived

        public boolean incrementReceived()
        Used for incrementing the number of packets received from the client.
        true if the interval has reset and can now be checked for the packets sent
      • exceedsMaxPPS

        public boolean exceedsMaxPPS()
        Checks for packet flood with the packets sent in the last second. ALWAYS check for incrementReceived() before using this method.
        true if the packet should be cancelled
        See Also:
      • getSentPackets

        public long getSentPackets()
      • setSentPackets

        public void setSentPackets​(long sentPackets)
      • getReceivedPackets

        public long getReceivedPackets()
      • setReceivedPackets

        public void setReceivedPackets​(long receivedPackets)
      • getStartTime

        public long getStartTime()
      • setStartTime

        public void setStartTime​(long startTime)
      • getIntervalPackets

        public long getIntervalPackets()
      • setIntervalPackets

        public void setIntervalPackets​(long intervalPackets)
      • getPacketsPerSecond

        public long getPacketsPerSecond()
      • setPacketsPerSecond

        public void setPacketsPerSecond​(long packetsPerSecond)
      • getSecondsObserved

        public int getSecondsObserved()
      • setSecondsObserved

        public void setSecondsObserved​(int secondsObserved)
      • getWarnings

        public int getWarnings()
      • setWarnings

        public void setWarnings​(int warnings)