RemoteScreenService

class RemoteScreenService<Player : Any, Owner : Any>(endpoint: RemoteEndpoint, send: (Player, ByteArray) -> Unit, report: (Throwable) -> Unit, dispatchClose: (() -> Unit) -> Unit = { it() }, notify: (Player, RemoteLifecycleEvent<Owner>) -> Unit = { _, _ -> }) : AutoCloseable(source)

Owns authenticated player transports and declarations under one adapter execution owner. Network callbacks only enqueue bounded bytes; handlers never run in messaging callbacks.

Constructors

Link copied to clipboard
constructor(endpoint: RemoteEndpoint, send: (Player, ByteArray) -> Unit, report: (Throwable) -> Unit, dispatchClose: (() -> Unit) -> Unit = { it() }, notify: (Player, RemoteLifecycleEvent<Owner>) -> Unit = { _, _ -> })

Functions

Link copied to clipboard

Returns the successful capability handshake for one current player connection.

Link copied to clipboard
open override fun close()
Link copied to clipboard

Invalidates the current screen generation when Minecraft replaces or closes its native container. Subsequent messages still carry the retired session identity and cannot target a replacement screen.

Link copied to clipboard
fun disconnect(player: Player)

Removes all queues and state belonging to one disconnected player.

Link copied to clipboard
fun enqueue(player: Player, bytes: ByteArray)

Copies inbound authenticated payloads without executing server-owned behavior.

Link copied to clipboard
fun join(player: Player)

Creates a fresh protocol endpoint for a joined player.

Link copied to clipboard
fun open(owner: Owner, player: Player, definition: ScreenDefinition): RemoteScreenSession

Compatibility entry sharing the common definition and session path.

fun open(owner: Owner, player: Player, definition: UiDefinition): RemoteScreenSession

Consumes the definition and opens a screen only after successful peer negotiation.

Link copied to clipboard
fun ownerDisabled(owner: Owner)

Ends every screen owned by a plugin before that plugin can be unloaded.

Link copied to clipboard
fun register(owner: Owner, type: ProjectionType)

Admits one exact plugin-owned schema for subsequent connections.

Link copied to clipboard
fun tick()

Processes a bounded number of frames, then commits state and flushes bounded output for each player.