From bf91d3780b1e0ebb2d2bdf8ab7b7d9e82c4f1c6e Mon Sep 17 00:00:00 2001 From: Him188 Date: Mon, 10 Feb 2020 16:53:29 +0800 Subject: [PATCH] Move "Received commandName" log --- .../qqandroid/network/protocol/packet/PacketFactory.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt index 768e9afbc..7af45776b 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/PacketFactory.kt @@ -229,6 +229,7 @@ internal object KnownPacketFactories { }?.let { // 处理内层真实的包 if (it.packetFactory == null) { + bot.logger.debug("Received commandName: ${it.commandName}") PacketLogger.warning { "找不到 PacketFactory" } PacketLogger.verbose { "传递给 PacketFactory 的数据 = ${it.data.useBytes { data, length -> data.toUHexString(length = length) }}" } return @@ -270,7 +271,8 @@ internal object KnownPacketFactories { class IncomingPacket( val packetFactory: PacketFactory<*>?, val sequenceId: Int, - val data: ByteReadPacket + val data: ByteReadPacket, + val commandName: String ) /** @@ -340,8 +342,8 @@ internal object KnownPacketFactories { // body val packetFactory = findPacketFactory(commandName) - bot.logger.debug("Received commandName: $commandName") - return IncomingPacket(packetFactory, ssoSequenceId, packet) + + return IncomingPacket(packetFactory, ssoSequenceId, packet, commandName) } private suspend fun ByteReadPacket.parseOicqResponse(