Package io.netty.buffer

Examples of io.netty.buffer.ByteBuf.writeShort()


    if (message.isContiguous()) {
      uncompressedSize += message.getBiomeData().length;
    }

    buffer.writeShort(sectionsSentBitmap);
    buffer.writeShort(additionalDataBitMap);
    byte[] uncompressedData = new byte[uncompressedSize];
    int index = 0;

    // TODO - fix this total hack
View Full Code Here


    ByteBuf buffer = Unpooled.buffer();
    VanillaByteBufUtils.writeString(buffer, message.getSessionId());
    byte[] publicKey = message.getSecretArray();
    buffer.writeShort((short) publicKey.length);
    buffer.writeBytes(publicKey);
    buffer.writeShort((short) message.getVerifyTokenArray().length);
    buffer.writeBytes(message.getVerifyTokenArray());
    return buffer;
  }
}
View Full Code Here

    if (message.isContiguous()) {
      uncompressedSize += message.getBiomeData().length;
    }

    buffer.writeShort(sectionsSentBitmap);
    buffer.writeShort(additionalDataBitMap);
    byte[] uncompressedData = new byte[uncompressedSize];
    int index = 0;

    // TODO - fix this total hack
    index = writeSectionData(data, 0, uncompressedData, index, 4096);
View Full Code Here

  }

  @Override
  public ByteBuf encode(EncryptionKeyResponseMessage message) {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeShort((short) message.getSecretArray().length);
    buffer.writeBytes(message.getSecretArray());
    buffer.writeShort((short) message.getVerifyTokenArray().length);
    buffer.writeBytes(message.getVerifyTokenArray());
    return buffer;
  }
View Full Code Here

  @Override
  public ByteBuf encode(EncryptionKeyResponseMessage message) {
    ByteBuf buffer = Unpooled.buffer();
    buffer.writeShort((short) message.getSecretArray().length);
    buffer.writeBytes(message.getSecretArray());
    buffer.writeShort((short) message.getVerifyTokenArray().length);
    buffer.writeBytes(message.getVerifyTokenArray());
    return buffer;
  }
}
View Full Code Here

  @Override
  public ByteBuf encode(BlockActionMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer(14);
    buffer.writeInt(message.getX());
    buffer.writeShort(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getFirstByte());
    buffer.writeByte(message.getSecondByte());
    buffer.writeShort(message.getBlockId());
    return buffer;
View Full Code Here

  @Override
  public ByteBuf encode(PlayerListMessage message) throws IOException {
    ByteBuf buffer = Unpooled.buffer();
    VanillaByteBufUtils.writeString(buffer, message.getPlayerName());
    buffer.writeByte(message.playerIsOnline() ? 1 : 0);
    buffer.writeShort(message.getPing());
    return buffer;
  }
}
View Full Code Here

    buffer.writeInt(message.getX());
    buffer.writeShort(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getFirstByte());
    buffer.writeByte(message.getSecondByte());
    buffer.writeShort(message.getBlockId());
    return buffer;
  }
}
View Full Code Here

    buffer.writeByte(message.getYaw());
    buffer.writeByte(message.getPitch());
    int throwerId = message.getThrowerId();
    buffer.writeInt(throwerId);
    if (throwerId > 0) {
      buffer.writeShort(message.getSpeedX());
      buffer.writeShort(message.getSpeedY());
      buffer.writeShort(message.getSpeedZ());
    }
    return buffer;
  }
View Full Code Here

    buffer.writeByte(message.getPitch());
    int throwerId = message.getThrowerId();
    buffer.writeInt(throwerId);
    if (throwerId > 0) {
      buffer.writeShort(message.getSpeedX());
      buffer.writeShort(message.getSpeedY());
      buffer.writeShort(message.getSpeedZ());
    }
    return buffer;
  }
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.