diff --git a/protocol/src/main/kotlin/org/openrs2/protocol/Rs2Decoder.kt b/protocol/src/main/kotlin/org/openrs2/protocol/Rs2Decoder.kt index bef9ce51..e20a1353 100644 --- a/protocol/src/main/kotlin/org/openrs2/protocol/Rs2Decoder.kt +++ b/protocol/src/main/kotlin/org/openrs2/protocol/Rs2Decoder.kt @@ -63,8 +63,9 @@ public class Rs2Decoder(public var protocol: Protocol) : ByteToMessageDecoder() return } + val payload = input.readSlice(length) out += try { - decoder.decode(input.readSlice(length)) + decoder.decode(payload) } catch (ex: NotImplementedError) { // TODO(gpe): remove this catch block when every packet is implemented logger.warn { "Skipping unimplemented packet: ${decoder.javaClass}" }