This commit is contained in:
Him188 2020-01-10 23:19:05 +08:00
parent 66fb009627
commit ab98206d18
3 changed files with 3 additions and 7 deletions

View File

@ -42,11 +42,7 @@ internal abstract class PacketFactory<out TPacket : Packet, TDecrypter : Decrypt
}
@JvmName("decode0")
private suspend inline fun <P : Packet> PacketFactory<P, *>.decode(bot: QQAndroidBot, packet: ByteReadPacket): P {
return this.run {
packet.decode(bot)
}
}
private suspend inline fun <P : Packet> PacketFactory<P, *>.decode(bot: QQAndroidBot, packet: ByteReadPacket): P = packet.decode(bot)
private val DECRYPTER_16_ZERO = ByteArray(16)

View File

@ -189,7 +189,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse, Log
val subCommand = readShort().toInt()
println("subCommand=$subCommand")
val type = readByte()
println("type=$subCommand")
println("type=$type")
debugDiscardExact(3)
val tlvMap: Map<Int, ByteArray> = this.readTLVMap()

View File

@ -103,7 +103,7 @@ fun Input.readTLVMap(expectingEOF: Boolean = true, tagSize: Int): MutableMap<Int
}
try {
map[type] = this.readUShortLVByteArray()
} catch (e: RuntimeException) { // BufferUnderflowException
} catch (e: Exception) { // BufferUnderflowException, java.io.EOFException
if (expectingEOF) {
return map
}