Add debugging output

This commit is contained in:
Him188 2019-12-03 12:27:08 +08:00
parent 363c7a6eb1
commit 87544f54a3

View File

@ -6,10 +6,7 @@ import kotlinx.io.core.*
import net.mamoe.mirai.network.BotNetworkHandler import net.mamoe.mirai.network.BotNetworkHandler
import net.mamoe.mirai.network.protocol.tim.TIMProtocol import net.mamoe.mirai.network.protocol.tim.TIMProtocol
import net.mamoe.mirai.network.protocol.tim.packet.* import net.mamoe.mirai.network.protocol.tim.packet.*
import net.mamoe.mirai.utils.io.encryptAndWrite import net.mamoe.mirai.utils.io.*
import net.mamoe.mirai.utils.io.readIoBuffer
import net.mamoe.mirai.utils.io.writeHex
import net.mamoe.mirai.utils.io.writeQQ
object CaptchaKey : DecrypterByteArray, DecrypterType<CaptchaKey> { object CaptchaKey : DecrypterByteArray, DecrypterType<CaptchaKey> {
override val value: ByteArray = TIMProtocol.key00BA override val value: ByteArray = TIMProtocol.key00BA
@ -125,6 +122,7 @@ object CaptchaPacket : PacketFactory<CaptchaPacket.CaptchaResponse, CaptchaKey>(
} }
0x13u -> { 0x13u -> {
CaptchaResponse.Transmission().apply { CaptchaResponse.Transmission().apply {
with(debugPrint("验证码包")) {
discardExact(9) discardExact(9)
captchaToken = readIoBuffer(56) captchaToken = readIoBuffer(56)
@ -139,6 +137,7 @@ object CaptchaPacket : PacketFactory<CaptchaPacket.CaptchaResponse, CaptchaKey>(
token00BA = readBytes(40) token00BA = readBytes(40)
} }
} }
}
else -> error("Unable to analyze RequestCaptchaTransmissionPacket, unknown id: $flag") else -> error("Unable to analyze RequestCaptchaTransmissionPacket, unknown id: $flag")
} }