GameMessageCounter

An interface for tracking incoming game messages, in order to avoid decoding and consuming too many messages if the client is flooding us with them. This implementation must be thread safe in the sense that the increment and reset functions could be called concurrently from different threads. The default implementation uses an array for tracking the counts and thus does not need such thread safety here.

Inheritors

Functions

Link copied to clipboard
abstract fun increment(clientProtCategory: ClientProtCategory)

Increments the message counter for the provided client prot category.

Link copied to clipboard
abstract fun isFull(): Boolean

Whether any of the message categories have reached their limit for maximum number of decoded messages.

Link copied to clipboard
abstract fun reset()

Resets the tracked counts for the messages.