Support ping bedrock

This commit is contained in:
2026-09-03 22:47:27 +08:00
parent b3583ba48d
commit 8eff6ff9a9
30 files changed
+736 -77

No files matched your search

@@ -9,7 +9,7 @@ package cn.rtast.mcping.platform
import io.ktor.utils.io.*
import kotlinx.coroutines.runBlocking
internal actual class PlatformReadChannel {
internal actual class ReadChannel {
private val _readChannel: ByteReadChannel
constructor(readChannel: ByteReadChannel) {
@@ -19,9 +19,10 @@ internal actual class PlatformReadChannel {
actual fun readByte(): Byte = runBlocking { _readChannel.readByte() }
actual fun readBytes(length: Int): ByteArray = runBlocking { _readChannel.readByteArray(length) }
actual fun readFully(out: ByteArray, start: Int, end: Int) = runBlocking { _readChannel.readFully(out, start, end) }
actual fun readLong(): Long = runBlocking { _readChannel.readLong() }
}
internal actual class PlatformWriteChannel {
internal actual class WriteChannel {
private val _writeChannel: ByteWriteChannel
constructor(writeChannel: ByteWriteChannel) {