Game Message Consumer Repository Builder
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.
Functions
Link copied to clipboard
fun addGlobalListener(consumer: MessageConsumer<R, IncomingGameMessage>): GameMessageConsumerRepositoryBuilder<R>
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
fun <T : IncomingGameMessage> addListener(clazz: Class<out T>, consumer: MessageConsumer<R, T>): GameMessageConsumerRepositoryBuilder<R>
Adds a listener for the provided clazz.
Link copied to clipboard