mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 15:00:38 +08:00
Fix map skipping, close #145
This commit is contained in:
parent
702d8d9fa9
commit
f48e27d743
@ -126,17 +126,23 @@ internal class JceInput(
|
||||
Jce.STRING1 -> this.input.discardExact(this.input.readUByte().toInt())
|
||||
Jce.STRING4 -> this.input.discardExact(this.input.readInt())
|
||||
Jce.MAP -> { // map
|
||||
repeat(skipToHeadAndUseIfPossibleOrFail(0) {
|
||||
nextHead()
|
||||
repeat(skipToHeadAndUseIfPossibleOrFail(0, message = { "tag 0 not found when skipping map" }) {
|
||||
readJceIntValue(it)
|
||||
} * 2) {
|
||||
useHead { skipField(it.type) }
|
||||
val currentHead = currentHead
|
||||
prepareNextHead()
|
||||
skipField(currentHead.type)
|
||||
}
|
||||
}
|
||||
Jce.LIST -> { // list
|
||||
repeat(skipToHeadAndUseIfPossibleOrFail(0) {
|
||||
nextHead()
|
||||
repeat(skipToHeadAndUseIfPossibleOrFail(0, message = { "tag 0 not found when skipping list" }) {
|
||||
readJceIntValue(it)
|
||||
}) {
|
||||
useHead { skipField(it.type) }
|
||||
val currentHead = currentHead
|
||||
prepareNextHead()
|
||||
skipField(currentHead.type)
|
||||
}
|
||||
}
|
||||
Jce.STRUCT_BEGIN -> {
|
||||
|
Loading…
Reference in New Issue
Block a user