public class PacketTracker
extends java.lang.Object
Constructor and Description |
---|
PacketTracker(UserConnection connection) |
Modifier and Type | Method and Description |
---|---|
boolean |
exceedsMaxPPS()
Checks for packet flood with the packets sent in the last second.
|
long |
getIntervalPackets() |
long |
getPacketsPerSecond() |
long |
getReceivedPackets() |
int |
getSecondsObserved() |
long |
getSentPackets() |
long |
getStartTime() |
int |
getWarnings() |
boolean |
incrementReceived()
Used for incrementing the number of packets received from the client.
|
void |
incrementSent()
Used for incrementing the number of packets sent to the client.
|
void |
setIntervalPackets(long intervalPackets) |
void |
setPacketsPerSecond(long packetsPerSecond) |
void |
setReceivedPackets(long receivedPackets) |
void |
setSecondsObserved(int secondsObserved) |
void |
setSentPackets(long sentPackets) |
void |
setStartTime(long startTime) |
void |
setWarnings(int warnings) |
public PacketTracker(UserConnection connection)
public void incrementSent()
public boolean incrementReceived()
public boolean exceedsMaxPPS()
incrementReceived()
before using this method.incrementReceived()
public long getSentPackets()
public void setSentPackets(long sentPackets)
public long getReceivedPackets()
public void setReceivedPackets(long receivedPackets)
public long getStartTime()
public void setStartTime(long startTime)
public long getIntervalPackets()
public void setIntervalPackets(long intervalPackets)
public long getPacketsPerSecond()
public void setPacketsPerSecond(long packetsPerSecond)
public int getSecondsObserved()
public void setSecondsObserved(int secondsObserved)
public int getWarnings()
public void setWarnings(int warnings)