diff --git a/mirai-core/src/main/java/net/mamoe/mirai/network/packet/ServerEvent.kt b/mirai-core/src/main/java/net/mamoe/mirai/network/packet/ServerEvent.kt index a71885118..514700c56 100644 --- a/mirai-core/src/main/java/net/mamoe/mirai/network/packet/ServerEvent.kt +++ b/mirai-core/src/main/java/net/mamoe/mirai/network/packet/ServerEvent.kt @@ -133,7 +133,21 @@ class ServerFriendMessageEventPacket(input: DataInputStream, packetId: ByteArray var qq: Int = 0 lateinit var message: String + + @ExperimentalUnsignedTypes override fun decode() { - TODO("FRIEND 解析") + //start at Sep1.0:27 + qq = input.readInt() + val msgLength = input.readShort(22) + val fontLength = input.readShort(93+msgLength) + val offset = msgLength+fontLength + message = if(input.readByte(97+offset).toUHexString() == "02"){ + "[face" + input.goto(103+offset).readVarString(1) + ".gif]" + //.gif + }else { + val offset2 = input.readShort(101 + offset) + input.goto(103 + offset).readVarString(offset2.toInt()) + } + // TODO("FRIEND 解析") } } \ No newline at end of file