@Override public void serialize(Buffer buf) { buf.writeString(name); buf.writeShort(worldX); buf.writeShort(worldY); buf.writeString(ownername); }
private void writeHeader() { // Write the Gzip header directly into the buffer for the sink to avoid handling IOException. Buffer buffer = this.sink.buffer(); buffer.writeShort(0x1f8b); // Two-byte Gzip ID. buffer.writeByte(0x08); // 8 == Deflate compression method. buffer.writeByte(0x00); // No flags. buffer.writeInt(0x00); // No modification time. buffer.writeByte(0x00); // No extra flags. buffer.writeByte(0x00); // No OS. }
@Override public void serialize(Buffer buf) { short flag1 = 0; flag1 = BooleanByteWrapper.setFlag(flag1, 0, isOnSale); flag1 = BooleanByteWrapper.setFlag(flag1, 1, isSaleLocked); buf.writeUByte(flag1); buf.writeInt(houseId); buf.writeUShort(doorsOnMap.length); for (int entry : doorsOnMap) { buf.writeInt(entry); } buf.writeString(ownerName); buf.writeShort(modelId); }
@Override public void serialize(Buffer buf) { buf.writeInt(objectUID); buf.writeInt(foodUID); buf.writeShort(foodQuantity); }