Skip to content

Commit

Permalink
fix: ignore sync requests when multichannel is not active
Browse files Browse the repository at this point in the history
Fixes players stuck in infinite loading in some cases
  • Loading branch information
ishland committed Dec 9, 2023
1 parent 5581784 commit a2f5121
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down

0 comments on commit a2f5121

Please sign in to comment.