mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-15 13:00:12 +08:00
Fix build
This commit is contained in:
parent
ac52cbb47e
commit
aca71d0c96
@ -302,7 +302,9 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
|
|||||||
return
|
return
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
bot.logger.error("Caught unexpected exceptions", e)
|
bot.logger.error("Caught unexpected exceptions", e)
|
||||||
continue
|
dispose()
|
||||||
|
bot.tryReinitializeNetworkHandler(e)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
launch(context = PacketReceiveDispatcher + CoroutineName("Incoming Packet handler"), start = CoroutineStart.ATOMIC) {
|
launch(context = PacketReceiveDispatcher + CoroutineName("Incoming Packet handler"), start = CoroutineStart.ATOMIC) {
|
||||||
processPacket(rawInput)
|
processPacket(rawInput)
|
||||||
|
@ -17,7 +17,10 @@ import kotlin.jvm.JvmSynthetic
|
|||||||
@Suppress("DuplicatedCode") // false positive. foreach is not common to UByteArray and ByteArray
|
@Suppress("DuplicatedCode") // false positive. foreach is not common to UByteArray and ByteArray
|
||||||
@UseExperimental(ExperimentalUnsignedTypes::class)
|
@UseExperimental(ExperimentalUnsignedTypes::class)
|
||||||
fun List<Byte>.toUHexString(separator: String = " ", offset: Int = 0, length: Int = this.size - offset): String {
|
fun List<Byte>.toUHexString(separator: String = " ", offset: Int = 0, length: Int = this.size - offset): String {
|
||||||
this.checkOffsetAndLength(offset, length)
|
require(offset >= 0) { "offset shouldn't be negative: $offset" }
|
||||||
|
require(length >= 0) { "length shouldn't be negative: $length" }
|
||||||
|
require(offset + length <= this.size) { "offset ($offset) + length ($length) > array.size (${this.size})" }
|
||||||
|
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user