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

View File

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