Example usage for io.netty.buffer ByteBuf readBoolean

List of usage examples for io.netty.buffer ByteBuf readBoolean

Introduction

In this page you can find the example usage for io.netty.buffer ByteBuf readBoolean.

Prototype

public abstract boolean readBoolean();

Source Link

Document

Gets a boolean at the current readerIndex and increases the readerIndex by 1 in this buffer.

Usage

From source file:de.sanandrew.mods.turretmod.tileentity.assembly.TileEntityTurretAssembly.java

License:Creative Commons License

@Override
public void fromBytes(ByteBuf buf) {
    this.energyStorage.fluxAmount = buf.readInt();
    this.fluxConsumption = buf.readInt();
    this.isActive = buf.readBoolean();
    this.ticksCrafted = buf.readInt();
    this.maxTicksCrafted = buf.readInt();
    this.automate = buf.readBoolean();
    this.isActiveClient = buf.readBoolean();
    ItemStack crfStack = ByteBufUtils.readItemStack(buf);
    if (ItemStackUtils.isValid(crfStack)) {
        this.currCrafting = new Tuple(UUID.fromString(ByteBufUtils.readUTF8String(buf)), crfStack);
    } else {/* w w w. j a va2  s . com*/
        this.currCrafting = null;
    }
}

From source file:de.sanandrew.mods.turretmod.tileentity.electrolytegen.TileEntityElectrolyteGenerator.java

License:Creative Commons License

@Override
public void fromBytes(ByteBuf buf) {
    this.energyStorage.fluxAmount = buf.readInt();
    this.effectiveness = buf.readFloat();
    for (int i = 0, max = this.processes.length; i < max; i++) {
        if (buf.readBoolean()) {
            this.processes[i] = new ElectrolyteProcess(buf);
        } else {//from  w w w.ja  v a  2  s .c o m
            this.processes[i] = null;
        }
    }
}

From source file:eu.xworlds.util.raknet.protocol.ConnectionRequest.java

License:Open Source License

@Override
protected void parseMessage(ByteBuf buf) {
    this.clientGuid = readGuid(buf);
    this.time = readTime(buf);
    this.doSecurity = buf.readBoolean();
    if (this.doSecurity) {
        this.proof = new byte[32]; // TODO have a constant value of the size
        buf.readBytes(this.proof);
        this.doIdentity = buf.readBoolean();
        if (this.doIdentity) {
            this.identity = new byte[EASYHANDSHAKE_IDENTITY_BYTES];
            buf.readBytes(this.identity);
        }/* ww w.j a  va 2  s  .  c o  m*/
    }
}

From source file:eu.xworlds.util.raknet.protocol.OpenConnectionReply1.java

License:Open Source License

@Override
protected void parseMessage(ByteBuf buf) {
    this.magic = new byte[MAGIC_BYTES];
    buf.readBytes(this.magic);
    this.serverGuid = readGuid(buf);
    this.hasSecurity = buf.readBoolean();
    if (this.hasSecurity) {
        this.securityCookie = buf.readInt();
        this.publicKey = new byte[EASYHANDSHAKE_PUBLIC_KEY_BYTES];
        buf.readBytes(this.publicKey);
    }//from  w  w  w  . j av  a  2  s.  c o  m
    this.mtuSize = buf.readUnsignedShort();
}

From source file:eu.xworlds.util.raknet.protocol.OpenConnectionReply2.java

License:Open Source License

@Override
protected void parseMessage(ByteBuf buf) {
    this.magic = new byte[MAGIC_BYTES];
    buf.readBytes(this.magic);
    this.serverGuid = readGuid(buf);
    this.port = buf.readUnsignedShort();
    this.mtuSize = buf.readUnsignedShort();
    this.doSecurity = buf.readBoolean();
    if (this.doSecurity) {
        this.securityAnswer = new byte[EASYHANDSHAKE_ANSWER_BYTES];
        buf.readBytes(this.securityAnswer);
    }//w  w  w  . j  a v  a  2  s .  c o  m
}

From source file:eu.xworlds.util.raknet.protocol.OpenConnectionRequest2.java

License:Open Source License

@Override
protected void parseMessage(ByteBuf buf) {
    this.magic = new byte[MAGIC_BYTES];
    buf.readBytes(this.magic);
    // TODO how to get the security flag?
    if (this.useSecurity) {
        this.cookie = buf.readInt();
        this.clientWroteChallenge = buf.readBoolean();
        if (this.clientWroteChallenge) {
            this.clientChallenge = new byte[EASYHANDSHAKE_CHALLENGE_BYTES];
            buf.readBytes(this.clientChallenge);
        }/*from  w  w  w  .  jav a 2 s  .  com*/
    }
    this.bindingAddress = readIPv4Address(buf);
    this.mtuSize = buf.readUnsignedShort();
    this.guid = readGuid(buf);
}

From source file:eureka.networking.MessageResearch.java

License:GNU General Public License

@Override
public void fromBytes(ByteBuf buf) {
    for (IEurekaInfo info : EurekaAPI.API.getAllKeys()) {
        progress.put(info.getName(), buf.readInt());
        finished.put(info.getName(), buf.readBoolean());
    }// w ww  .ja  va 2 s .co  m
}

From source file:gravestone.packets.GraveDeathMessageToServer.java

License:LGPL

@Override
public void fromBytes(ByteBuf buf) {
    this.dimensionID = buf.readInt();
    this.x = buf.readInt();
    this.y = buf.readInt();
    this.z = buf.readInt();
    this.text = ByteBufUtils.readUTF8String(buf);
    this.randomText = buf.readBoolean();
}

From source file:growthcraft.milk.common.struct.CheeseCurd.java

License:Open Source License

@Override
public boolean readFromStream(ByteBuf stream) {
    this.cheese = EnumCheeseType.loadFromStream(stream);
    this.dried = stream.readBoolean();
    this.age = stream.readInt();
    return false;
}

From source file:hellfirepvp.astralsorcery.common.integrations.mods.crafttweaker.network.BaseAltarRecipe.java

License:Open Source License

@Override
public void read(ByteBuf buf) {
    this.starlightRequired = buf.readInt();
    this.craftingTickTime = buf.readInt();
    this.output = ByteBufUtils.readItemStack(buf);
    int size = buf.readInt();
    this.inputs = new ItemHandle[size];
    for (int i = 0; i < size; i++) {
        boolean defined = buf.readBoolean();
        if (defined) {
            this.inputs[i] = ItemHandle.deserialize(buf);
        }/* w  w w.  ja  v a2 s.  co m*/
    }
}