use of io.gomint.proxprox.network.tcp.protocol.SendPlayerToServerPacket in project ProxProx by GoMint.
the class Decoder method decode.
@Override
protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf buf, List<Object> objects) throws Exception {
if (buf instanceof EmptyByteBuf) {
// The Channel has disconnected and this is the last message we got. R.I.P. connection
return;
}
byte packetId = buf.readByte();
switch(packetId) {
case 1:
WrappedMCPEPacket wrappedMCPEPacket = new WrappedMCPEPacket();
wrappedMCPEPacket.read(buf);
objects.add(wrappedMCPEPacket);
break;
case 2:
UpdatePingPacket updatePingPacket = new UpdatePingPacket();
updatePingPacket.read(buf);
objects.add(updatePingPacket);
break;
case 3:
SendPlayerToServerPacket sendPlayerToServerPacket = new SendPlayerToServerPacket();
sendPlayerToServerPacket.read(buf);
objects.add(sendPlayerToServerPacket);
break;
default:
break;
}
}
Aggregations