예제 #1
0
    @Override
    public void fromBytes(ByteBuf dataStream) {
      packetType = SecurityPacketType.values()[dataStream.readInt()];

      if (packetType == SecurityPacketType.BLOCK) {
        coord4D = Coord4D.read(dataStream);
      } else {
        currentHand = EnumHand.values()[dataStream.readInt()];
      }

      value = SecurityMode.values()[dataStream.readInt()];
    }
예제 #2
0
    @Override
    public void toBytes(ByteBuf dataStream) {
      dataStream.writeInt(packetType.ordinal());

      if (packetType == SecurityPacketType.BLOCK) {
        coord4D.write(dataStream);
      } else {
        dataStream.writeInt(currentHand.ordinal());
      }

      dataStream.writeInt(value.ordinal());
    }