mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-26 07:20:09 +08:00
Improve input
This commit is contained in:
parent
846280db50
commit
56a267dfa3
mirai-core-timpc/src/commonMain/kotlin/net.mamoe.mirai.timpc/network
mirai-core/src/commonMain/kotlin/net.mamoe.mirai/utils/io
@ -55,6 +55,7 @@ internal class TIMPCBotNetworkHandler internal constructor(coroutineContext: Cor
|
||||
|
||||
private var heartbeatJob: Job? = null
|
||||
|
||||
@MiraiInternalAPI
|
||||
override suspend fun login() {
|
||||
|
||||
TIMProtocol.SERVER_IP.shuffled().forEach { ip ->
|
||||
|
@ -54,6 +54,10 @@ fun ByteReadPacket.readIoBuffer(
|
||||
n: Int = remaining.toInt()//not that safe but adequate
|
||||
): IoBuffer = IoBuffer.Pool.borrow().also { this.readFully(it, n) }
|
||||
|
||||
fun ByteReadPacket.readPacket(
|
||||
n: Int = remaining.toInt()//not that safe but adequate
|
||||
): ByteReadPacket = this.readBytes(n).toReadPacket()
|
||||
|
||||
fun ByteReadPacket.readIoBuffer(n: Short) = this.readIoBuffer(n.toInt())
|
||||
|
||||
fun Input.readIP(): String = buildString(4 + 3) {
|
||||
|
Loading…
Reference in New Issue
Block a user