Skip to content

Commit a32e5bc

Browse files
committed
InternalsHandler: Fix incorrect user message decoding
1 parent f9a8631 commit a32e5bc

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
kotlin.code.style=official
22

33
group=org.golem
4-
version=0.5.3
4+
version=0.5.4

src/jvmMain/kotlin/org/golem/raknet/connection/InternalsHandler.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,11 @@ class InternalsHandler(
176176
MessageType.CONNECTION_REQUEST -> ConnectionRequest.from(body)
177177
MessageType.DISCONNECTION_NOTIFICATION -> DisconnectionNotification()
178178
MessageType.NEW_INCOMING_CONNECTION -> NewIncomingConnection.from(body)
179-
else -> buildUserMessage(frame)
179+
else -> {
180+
// reset body index before passing it to the builder
181+
body.resetReaderIndex()
182+
buildUserMessage(frame)
183+
}
180184
}
181185
body.release()
182186
if(message != null && connection.state != ConnectionState.DISCONNECTED) {

0 commit comments

Comments
 (0)