[core] Implement correct TlvMap dump for unrecognized login errors

This commit is contained in:
Him188 2022-12-27 16:29:34 +00:00
parent 0a60535d46
commit 2accabef9e
No known key found for this signature in database
GPG Key ID: BA439CDDCF652375

View File

@ -238,11 +238,17 @@ internal class WtLogin {
// 1, 15 -> onErrorMessage(tlvMap) ?: error("Cannot find error message")
else -> {
onErrorMessage(type.toInt(), tlvMap, bot)
?: error("Cannot find error message, unknown login result type: $type, TLVMap = ${tlvMap.structureToString()}")
?: error(
"Cannot find error message, unknown login result type: $type, TLVMap = ${dumpTlvMap(tlvMap)}"
)
}
}
}
private fun dumpTlvMap(tlvMap: TlvMap) {
tlvMap.entries.joinToString { "${it.key}=${it.value.toUHexString()}" }
}
private fun onDevLockLogin(
tlvMap: TlvMap,
bot: QQAndroidBot