GameMessageConsumerRepositoryBuilder

Message consumer repository is a repository of listeners that the server will register for various incoming messages. As there can be multiple clients, these cannot directly be stored with the respective decoders.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard

Adds a listener for any type of IncomingGameMessage. These listeners are always invoked after listeners registered for specific message types with addListener.

Link copied to clipboard
inline fun <T : IncomingGameMessage> addListener(crossinline listener: R.(message: T) -> Unit): GameMessageConsumerRepositoryBuilder<R>

Adds a listener for the provided T; this function is an overload of the addListener, intended to make registering listeners from Kotlin easier

Adds a listener for the provided clazz.

Link copied to clipboard