Do not catch exception in sendRawPacket

This commit is contained in:
creeper123123321 2018-08-23 14:50:56 -03:00
parent 20d3f9080b
commit 83166f6b17
2 changed files with 6 additions and 19 deletions

View File

@ -52,18 +52,10 @@ public class VRUserConnection extends UserConnection {
packet.release(); packet.release();
final Channel channel = this.getChannel(); final Channel channel = this.getChannel();
if (currentThread) { if (currentThread) {
try { PipelineUtil.getPreviousContext("decoder", channel.pipeline()).fireChannelRead(copy);
PipelineUtil.getPreviousContext("decoder", channel.pipeline()).fireChannelRead(copy);
} catch (Exception e) {
e.printStackTrace();
}
} else { } else {
channel.eventLoop().submit(() -> { channel.eventLoop().submit(() -> {
try { PipelineUtil.getPreviousContext("decoder", channel.pipeline()).fireChannelRead(copy);
PipelineUtil.getPreviousContext("decoder", channel.pipeline()).fireChannelRead(copy);
} catch (Exception e) {
e.printStackTrace();
}
}); });
} }
} }
@ -79,12 +71,7 @@ public class VRUserConnection extends UserConnection {
copy.writeBytes(packet); copy.writeBytes(packet);
packet.release(); packet.release();
final Channel channel = this.getChannel(); final Channel channel = this.getChannel();
try { PipelineUtil.getPreviousContext("decoder", channel.pipeline()).fireChannelRead(copy);
PipelineUtil.getPreviousContext("decoder", channel.pipeline()).fireChannelRead(copy); return channel.newSucceededFuture();
return channel.newSucceededFuture();
} catch (Exception e) {
e.printStackTrace();
return channel.newFailedFuture(e);
}
} }
} }

View File

@ -41,7 +41,7 @@ import java.util.UUID;
public class VRViaAPI implements ViaAPI<Void> { public class VRViaAPI implements ViaAPI<Void> {
@Override @Override
public int getPlayerVersion(Void o) { public int getPlayerVersion(Void o) {
throw new UnsupportedOperationException("WHAT??? A INSTANCE OF VOID???"); throw new UnsupportedOperationException();
} }
@Override @Override
@ -68,7 +68,7 @@ public class VRViaAPI implements ViaAPI<Void> {
@Override @Override
public void sendRawPacket(Void o, ByteBuf byteBuf) throws IllegalArgumentException { public void sendRawPacket(Void o, ByteBuf byteBuf) throws IllegalArgumentException {
throw new UnsupportedOperationException("WHAT??? A INSTANCE OF VOID???"); throw new UnsupportedOperationException();
} }
@Override @Override