mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-08 23:17:21 +08:00
Fix bytecode analyze
This commit is contained in:
parent
42510d7c1c
commit
cf2b4a193c
@ -18,6 +18,7 @@ import kotlinx.io.charsets.Charset
|
||||
import kotlinx.io.core.*
|
||||
import java.io.File
|
||||
import kotlin.text.String
|
||||
import java.nio.Buffer as JNioBuffer
|
||||
|
||||
public val EMPTY_BYTE_ARRAY: ByteArray = ByteArray(0)
|
||||
|
||||
@ -37,6 +38,12 @@ public inline fun ByteReadPacket.readPacketExact(
|
||||
n: Int = remaining.toInt()//not that safe but adequate
|
||||
): ByteReadPacket = this.readBytes(n).toReadPacket()
|
||||
|
||||
public inline var JNioBuffer.pos: Int
|
||||
get() = position()
|
||||
set(value) {
|
||||
position(value)
|
||||
}
|
||||
|
||||
|
||||
public typealias TlvMap = MutableMap<Int, ByteArray>
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
package net.mamoe.mirai.internal.network.protocol.data.richstatus
|
||||
|
||||
import net.mamoe.mirai.utils.pos
|
||||
import net.mamoe.mirai.utils.toIntUnsigned
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
@ -81,7 +82,7 @@ internal class RichStatus(
|
||||
if (dataType in 1..127) {
|
||||
val dataContent = String(rawData, dataStartPosition, dataLength)
|
||||
lastPosition = dataStartPosition + dataLength
|
||||
byteBuffer.position(lastPosition)
|
||||
byteBuffer.pos = lastPosition
|
||||
|
||||
when (dataType) {
|
||||
1 -> rsp.actionText = dataContent
|
||||
@ -157,7 +158,7 @@ internal class RichStatus(
|
||||
val var11 = ByteArray(dataLength)
|
||||
byteBuffer.get(var11)
|
||||
*/
|
||||
byteBuffer.position(byteBuffer.position() + dataLength)
|
||||
byteBuffer.pos += dataLength
|
||||
// Parse richstatus_sticker$RichStatus_Sticker
|
||||
}
|
||||
162 -> {
|
||||
@ -170,7 +171,7 @@ internal class RichStatus(
|
||||
}
|
||||
}
|
||||
lastPosition = dataStartPosition + dataLength
|
||||
byteBuffer.position(lastPosition)
|
||||
byteBuffer.pos = lastPosition
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user