diff --git a/nise-backend/src/main/kotlin/com/nisemoe/nise/replays/Wtc.kt b/nise-backend/src/main/kotlin/com/nisemoe/nise/replays/Wtc.kt index fde0f29..5247d60 100644 --- a/nise-backend/src/main/kotlin/com/nisemoe/nise/replays/Wtc.kt +++ b/nise-backend/src/main/kotlin/com/nisemoe/nise/replays/Wtc.kt @@ -44,7 +44,7 @@ fun wtcCompress(stream: String): ByteArray { return byteStream.toByteArray() } -fun wtcDecompress(data: ByteArray): String { +fun wtcDecompress(data: ByteArray, hasVersionHeader: Boolean = true): String { val buffer = ByteBuffer.wrap(data).order(ByteOrder.LITTLE_ENDIAN) fun unpackBytes(): ByteArray { @@ -56,7 +56,10 @@ fun wtcDecompress(data: ByteArray): String { return bytes } - buffer.getShort() // Version - may be used in the future + if (hasVersionHeader) { + buffer.getShort() // Version - may be used in the future + } + val xs = unpackBytes() val ys = unpackBytes() val zs = unpackBytes()