kotlin
object ClientScriptPlayNetworkingSend and receive script Play packets on the client. Register receivers from client entrypoints.
ClientScriptPlayNetworking.registerReceiver
kotlin
@JvmStatic
@JvmStatic fun registerReceiver(channel: Identifier, handler: (ByteArray) -> Unit)Register a receiver for a logical channel. Katton removes the script-owned receiver on reload.
ClientScriptPlayNetworking.sendToServer
kotlin
@JvmStatic
@JvmStatic fun sendToServer(channel: Identifier, data: ByteArray): BooleanSend up to 16 KiB to the server. Returns false if the peer cannot receive Katton packets. True does not confirm processing.
ClientScriptPlayNetworking.receive
kotlin
@JvmStatic
@JvmStatic fun receive(packet: ScriptPayloadPacket)Dispatch a received packet to script handlers. This host entrypoint is not for scripts to call.
