Skip to content

Commit 2accabe

Browse files
committed
[core] Implement correct TlvMap dump for unrecognized login errors
1 parent 0a60535 commit 2accabe

File tree

1 file changed

+7
-1
lines changed
  • mirai-core/src/commonMain/kotlin/network/protocol/packet/login

1 file changed

+7
-1
lines changed

mirai-core/src/commonMain/kotlin/network/protocol/packet/login/WtLogin.kt

+7-1
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,17 @@ internal class WtLogin {
238238
// 1, 15 -> onErrorMessage(tlvMap) ?: error("Cannot find error message")
239239
else -> {
240240
onErrorMessage(type.toInt(), tlvMap, bot)
241-
?: error("Cannot find error message, unknown login result type: $type, TLVMap = ${tlvMap.structureToString()}")
241+
?: error(
242+
"Cannot find error message, unknown login result type: $type, TLVMap = ${dumpTlvMap(tlvMap)}"
243+
)
242244
}
243245
}
244246
}
245247

248+
private fun dumpTlvMap(tlvMap: TlvMap) {
249+
tlvMap.entries.joinToString { "${it.key}=${it.value.toUHexString()}" }
250+
}
251+
246252
private fun onDevLockLogin(
247253
tlvMap: TlvMap,
248254
bot: QQAndroidBot

0 commit comments

Comments
 (0)