List of usage examples for io.netty.buffer ByteBuf writeBoolean
public abstract ByteBuf writeBoolean(boolean value);
From source file:org.starnub.starbounddata.packets.entity.EntityDestroyPacket.java
License:Open Source License
/** * Recommended: For internal use with StarNub Player Sessions * <p>// www . ja v a 2 s . c o m * Uses: This method will write to a {@link io.netty.buffer.ByteBuf} using this packets fields * <p> * * @param out ByteBuf representing the space to write out the packet reason */ @Override public void write(ByteBuf out) { this.entityId.write(out); out.writeBoolean(death); }
From source file:org.starnub.starbounddata.packets.world.WorldStartPacket.java
License:Open Source License
/** * Recommended: For internal use with StarNub Player Sessions * <p>/*from w w w .j ava 2 s . co m*/ * Uses: This method will write to a {@link io.netty.buffer.ByteBuf} using this packets fields * <p> * * @param out ByteBuf representing the space to write out the packet reason */ @Override public void write(ByteBuf out) { this.templateData.write(out); writeVLQArray(out, this.skyData); writeVLQArray(out, this.weatherData); this.playerStart.write(out); // this.protectedDungeonIds.write(out); this.worldProperties.write(out); out.writeInt(this.clientId); out.writeBoolean(this.localInterpolationMode); }
From source file:org.starnub.starbounddata.types.damage.DamageNotification.java
License:Open Source License
@Override public void write(ByteBuf out) { sourceEntityId.write(out);/*from www . j av a 2s . c o m*/ targetEntityId.write(out); position.write(out); out.writeFloat(damage); writeStringVLQ(out, damageSourceKind); writeStringVLQ(out, targetMaterialKind); out.writeBoolean(killed); }
From source file:org.starnub.starbounddata.types.damage.EphemeralStatusEffect.java
License:Open Source License
@Override public void write(ByteBuf out) { writeStringVLQ(out, uniqueStatusEffect); if (duration == 0) { out.writeBoolean(false); } else {/* w ww . jav a2s . c o m*/ out.writeBoolean(true); out.writeFloat(duration); } }
From source file:org.starnub.starbounddata.types.variants.Variant.java
License:Open Source License
@Override public void write(ByteBuf out) { out.writeByte(variantType.ordinal()); switch (variantType) { case NIL: {/*from w ww .j av a 2 s. c om*/ break; } case DOUBLE: { out.writeDouble((Double) value); break; } case BOOLEAN: { out.writeBoolean((Boolean) value); break; } case INTEGER: { byte[] bytes = VLQ.writeUnsignedVLQNoObject((Long) value); out.writeBytes(bytes); break; } case STRING: { writeStringVLQ(out, (String) value); break; } case LIST: { ((VariantList) value).write(out); break; } case MAP: ((VariantMap) value).write(out); break; default: System.err.println("Unknown Variant Type: " + variantType); } }
From source file:org.starnub.starbounddata.types.warp.ClientShipWorld.java
License:Open Source License
@Override public void write(ByteBuf out) { if (uuid == null) { out.writeBoolean(false); } else {//from w w w. java 2 s . c o m out.writeBoolean(true); writeUUID(out, uuid); } }
From source file:org.starnub.starbounddata.types.warp.MissionWorld.java
License:Open Source License
@Override public void write(ByteBuf out) { writeStringVLQ(out, name);/*from ww w . j a va 2 s.c om*/ if (uuid == null) { out.writeBoolean(false); } else { out.writeBoolean(true); writeUUID(out, uuid); } }
From source file:pneumaticCraft.common.network.PacketPlaySound.java
License:LGPL
@Override public void toBytes(ByteBuf buffer) { super.toBytes(buffer); ByteBufUtils.writeUTF8String(buffer, sound); buffer.writeFloat(volume);//from w ww . j av a 2 s. c om buffer.writeFloat(pitch); buffer.writeBoolean(bool); }
From source file:portablejim.bbw.network.PacketWandActivate.java
License:Open Source License
@Override public void toBytes(ByteBuf buffer) { buffer.writeBoolean(keyActive); }
From source file:se.sics.caracaldb.flow.FlowMessageSerializer.java
License:Open Source License
private void chunkToBinary(Chunk chunk, ByteBuf buf) { boolean full = chunk.data.length == FlowManager.CHUNK_SIZE; MessageSerializationUtil.msgToBinary(chunk, buf, CHUNK.getValue0(), full); SpecialSerializers.UUIDSerializer.INSTANCE.toBinary(chunk.flowId, buf); buf.writeInt(chunk.clearId);/*from w ww. ja v a 2 s . c o m*/ buf.writeInt(chunk.chunkNo); buf.writeInt(chunk.bytes); ByteArrayRef data = chunk.data; if (!full) { buf.writeInt(data.length); buf.writeBoolean(chunk.isFinal); } buf.writeBytes(data.getBackingArray(), data.begin, data.length); }