diff --git a/mirai-core/src/main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt b/mirai-core/src/main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt index b4924785d..2f41251b6 100644 --- a/mirai-core/src/main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt +++ b/mirai-core/src/main/java/net/mamoe/mirai/network/RobotNetworkHandler.kt @@ -232,10 +232,14 @@ class RobotNetworkHandler(val number: Int, private val password: String) { //group message } - is ServerUnknownEventPacket -> { + is UnknownServerEventPacket -> { //unknown message event } + is UnknownServerPacket -> { + + } + is ServerVerificationCodePacketEncrypted -> onPacketReceived(packet.decrypt(this.token00BA)) is ServerLoginResponseVerificationCodePacketEncrypted -> onPacketReceived(packet.decrypt()) is ServerLoginResponseResendPacketEncrypted -> onPacketReceived(packet.decrypt(this.tgtgtKey!!)) diff --git a/mirai-core/src/main/java/net/mamoe/mirai/network/packet/MessageEvent.kt b/mirai-core/src/main/java/net/mamoe/mirai/network/packet/MessageEvent.kt index a106d54e2..da5a0af7a 100644 --- a/mirai-core/src/main/java/net/mamoe/mirai/network/packet/MessageEvent.kt +++ b/mirai-core/src/main/java/net/mamoe/mirai/network/packet/MessageEvent.kt @@ -29,7 +29,7 @@ open class ClientMessageResponsePacket( /** - * 群聊和好友消息分析 + * 群聊和好友消息分发 */ @PacketId("00 17") class ServerMessageEventPacketRaw( @@ -61,11 +61,11 @@ class ServerMessageEventPacketRaw( //"02 10", "00 12" -> ServerUnknownEventPacket(this.input, packetId, eventIdentity) - else -> ServerUnknownEventPacket(this.input, packetId, eventIdentity) + else -> UnknownServerEventPacket(this.input, packetId, eventIdentity) } } -class ServerUnknownEventPacket(input: DataInputStream, packetId: ByteArray, eventIdentity: ByteArray) : ServerEventPacket(input, packetId, eventIdentity) +class UnknownServerEventPacket(input: DataInputStream, packetId: ByteArray, eventIdentity: ByteArray) : ServerEventPacket(input, packetId, eventIdentity) @PacketId("00 17") class ServerMessageEventPacketRawEncoded(input: DataInputStream, val packetId: ByteArray) : ServerPacket(input) { 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 e25468692..a71885118 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 @@ -1,5 +1,6 @@ package net.mamoe.mirai.network.packet +import net.mamoe.mirai.util.toUHexString import net.mamoe.mirai.utils.MiraiLogger import java.io.ByteArrayOutputStream import java.io.DataInputStream @@ -55,6 +56,8 @@ class ServerGroupMessageEventPacket(input: DataInputStream, packetId: ByteArray, group = this.input.goto(51).readInt() qq = this.input.goto(56).readInt() val fontLength = this.input.goto(108).readShort() + println(this.input.goto(110 + fontLength).readNBytes(2).toUHexString()) + messageType = when (val id = this.input.goto(110 + fontLength + 2).readByte().toInt()) { 19 -> MessageType.NORMAL 14 -> MessageType.XML