mirror of
https://github.com/ViaVersion/ViaFabric.git
synced 2024-11-08 09:40:07 +01:00
it works
This commit is contained in:
parent
caf6ab22ce
commit
8735230d86
@ -94,13 +94,14 @@ public class VRDecodeHandler extends ByteToMessageDecoder {
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
|
||||
if (user.isActive()) {
|
||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
iterator.next().run();
|
||||
iterator.remove();
|
||||
if (PipelineUtil.containsCause(cause, CancelException.class)) {
|
||||
if (user.isActive()) {
|
||||
Runnable runnable;
|
||||
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
super.exceptionCaught(ctx, cause);
|
||||
}
|
||||
@ -109,13 +110,11 @@ public class VRDecodeHandler extends ByteToMessageDecoder {
|
||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||
super.channelRead(ctx, msg);
|
||||
if (user.isActive()) {
|
||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
iterator.next().run();
|
||||
iterator.remove();
|
||||
Runnable runnable;
|
||||
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
// todo implement to other platforms
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -104,13 +104,14 @@ public class VREncodeHandler extends MessageToByteEncoder {
|
||||
|
||||
@Override
|
||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
|
||||
if (user.isActive()) {
|
||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
iterator.next().run();
|
||||
iterator.remove();
|
||||
if (PipelineUtil.containsCause(cause, CancelException.class)) {
|
||||
if (user.isActive()) {
|
||||
Runnable runnable;
|
||||
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
super.exceptionCaught(ctx, cause);
|
||||
}
|
||||
@ -119,10 +120,9 @@ public class VREncodeHandler extends MessageToByteEncoder {
|
||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||
super.write(ctx, msg, promise);
|
||||
if (user.isActive()) {
|
||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
iterator.next().run();
|
||||
iterator.remove();
|
||||
Runnable runnable;
|
||||
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||
runnable.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class VRUserConnection extends UserConnection {
|
||||
|
||||
@Override
|
||||
public void sendRawPacketAfterProcessing(ByteBuf packet) {
|
||||
ByteBuf copy = packet.alloc().buffer();
|
||||
ByteBuf copy = Unpooled.buffer();
|
||||
try {
|
||||
Type.VAR_INT.write(copy, PacketWrapper.PASSTHROUGH_ID);
|
||||
} catch (Exception e) {
|
||||
|
Loading…
Reference in New Issue
Block a user