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
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
|
if (PipelineUtil.containsCause(cause, CancelException.class)) {
|
||||||
if (user.isActive()) {
|
if (user.isActive()) {
|
||||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
Runnable runnable;
|
||||||
while (iterator.hasNext()) {
|
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||||
iterator.next().run();
|
runnable.run();
|
||||||
iterator.remove();
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
super.exceptionCaught(ctx, cause);
|
super.exceptionCaught(ctx, cause);
|
||||||
}
|
}
|
||||||
@ -109,13 +110,11 @@ public class VRDecodeHandler extends ByteToMessageDecoder {
|
|||||||
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
|
||||||
super.channelRead(ctx, msg);
|
super.channelRead(ctx, msg);
|
||||||
if (user.isActive()) {
|
if (user.isActive()) {
|
||||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
Runnable runnable;
|
||||||
while (iterator.hasNext()) {
|
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||||
iterator.next().run();
|
runnable.run();
|
||||||
iterator.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// todo implement to other platforms
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -104,13 +104,14 @@ public class VREncodeHandler extends MessageToByteEncoder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception {
|
||||||
if (PipelineUtil.containsCause(cause, CancelException.class)) return;
|
if (PipelineUtil.containsCause(cause, CancelException.class)) {
|
||||||
if (user.isActive()) {
|
if (user.isActive()) {
|
||||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
Runnable runnable;
|
||||||
while (iterator.hasNext()) {
|
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||||
iterator.next().run();
|
runnable.run();
|
||||||
iterator.remove();
|
}
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
super.exceptionCaught(ctx, cause);
|
super.exceptionCaught(ctx, cause);
|
||||||
}
|
}
|
||||||
@ -119,10 +120,9 @@ public class VREncodeHandler extends MessageToByteEncoder {
|
|||||||
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception {
|
||||||
super.write(ctx, msg, promise);
|
super.write(ctx, msg, promise);
|
||||||
if (user.isActive()) {
|
if (user.isActive()) {
|
||||||
Iterator<Runnable> iterator = user.getPostProcessingTasks().iterator();
|
Runnable runnable;
|
||||||
while (iterator.hasNext()) {
|
while ((runnable = user.getPostProcessingTasks().poll()) != null) {
|
||||||
iterator.next().run();
|
runnable.run();
|
||||||
iterator.remove();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ public class VRUserConnection extends UserConnection {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void sendRawPacketAfterProcessing(ByteBuf packet) {
|
public void sendRawPacketAfterProcessing(ByteBuf packet) {
|
||||||
ByteBuf copy = packet.alloc().buffer();
|
ByteBuf copy = Unpooled.buffer();
|
||||||
try {
|
try {
|
||||||
Type.VAR_INT.write(copy, PacketWrapper.PASSTHROUGH_ID);
|
Type.VAR_INT.write(copy, PacketWrapper.PASSTHROUGH_ID);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user