From 87544f54a3c62f5fba7edf5252bb31d5fb5bae8f Mon Sep 17 00:00:00 2001 From: Him188 Date: Tue, 3 Dec 2019 12:27:08 +0800 Subject: [PATCH] Add debugging output --- .../protocol/tim/packet/login/Captcha.kt | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/Captcha.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/Captcha.kt index 54d0f6bac..bf3fe5379 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/Captcha.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/network/protocol/tim/packet/login/Captcha.kt @@ -6,10 +6,7 @@ import kotlinx.io.core.* import net.mamoe.mirai.network.BotNetworkHandler import net.mamoe.mirai.network.protocol.tim.TIMProtocol import net.mamoe.mirai.network.protocol.tim.packet.* -import net.mamoe.mirai.utils.io.encryptAndWrite -import net.mamoe.mirai.utils.io.readIoBuffer -import net.mamoe.mirai.utils.io.writeHex -import net.mamoe.mirai.utils.io.writeQQ +import net.mamoe.mirai.utils.io.* object CaptchaKey : DecrypterByteArray, DecrypterType { override val value: ByteArray = TIMProtocol.key00BA @@ -125,18 +122,20 @@ object CaptchaPacket : PacketFactory( } 0x13u -> { CaptchaResponse.Transmission().apply { - discardExact(9) - captchaToken = readIoBuffer(56) + with(debugPrint("验证码包")) { + discardExact(9) + captchaToken = readIoBuffer(56) - val length = readShort() - captchaSectionN = readIoBuffer(length) + val length = readShort() + captchaSectionN = readIoBuffer(length) - discardExact(1) - val byte = readByte().toInt() - transmissionCompleted = byte == 0 + discardExact(1) + val byte = readByte().toInt() + transmissionCompleted = byte == 0 - discardExact(remaining - 56 - 2) - token00BA = readBytes(40) + discardExact(remaining - 56 - 2) + token00BA = readBytes(40) + } } }