diff --git a/common/src/main/java/com/ishland/raknetify/common/connection/RakNetSimpleMultiChannelCodec.java b/common/src/main/java/com/ishland/raknetify/common/connection/RakNetSimpleMultiChannelCodec.java index d4da804..7e23b3d 100644 --- a/common/src/main/java/com/ishland/raknetify/common/connection/RakNetSimpleMultiChannelCodec.java +++ b/common/src/main/java/com/ishland/raknetify/common/connection/RakNetSimpleMultiChannelCodec.java @@ -125,11 +125,13 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) promise.trySuccess(); return; } - if (msg == SynchronizationLayer.SYNC_REQUEST_OBJECT && this.isMultichannelEnabled) { - if (Constants.DEBUG) System.out.println("Raknetify: [MultiChannellingDataCodec] Stopped multichannel"); - this.isMultichannelEnabled = false; - super.write(ctx, msg, promise); - return; + if (msg == SynchronizationLayer.SYNC_REQUEST_OBJECT) { + if (this.isMultichannelEnabled) { + if (Constants.DEBUG) System.out.println("Raknetify: [MultiChannellingDataCodec] Stopped multichannel"); + this.isMultichannelEnabled = false; + super.write(ctx, msg, promise); + } + return; // discard sync request when multichannel is not active } if (msg instanceof ByteBuf buf && buf.isReadable()) {