Example usage for io.netty.buffer ByteBuf readInt

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

Introduction

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

Prototype

public abstract int readInt();

Source Link

Document

Gets a 32-bit integer at the current readerIndex and increases the readerIndex by 4 in this buffer.

Usage

From source file:cn.academy.ability.teleport.data.ClientModifyMsg.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    opcode = buf.readByte();/*from w w  w  .  ja  va 2  s  .  com*/
    if (opcode == ADD) {
        arg = new Location(buf);
    } else if (opcode == REMOVE) {
        arg = (Integer) buf.readInt();
    }
}

From source file:cn.academy.api.data.MsgResetAbilityData.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    entityID = buf.readInt();
    data = ByteBufUtils.readTag(buf);
}

From source file:cn.academy.api.data.MsgSimpleChange.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    entityID = buf.readInt();
    cp = buf.readFloat();//  ww w.  j  av  a 2s.c  o  m
    maxCP = buf.readFloat();

    skillCount = buf.readInt();
    skillExp = new float[skillCount];
    for (int i = 0; i < skillCount; ++i) {
        skillExp[i] = buf.readFloat();
    }
}

From source file:cn.academy.core.block.dev.MsgActionStart.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    x = buf.readInt();
    y = buf.readInt();
    z = buf.readInt();
    id = buf.readByte();
    par = buf.readByte();
}

From source file:cn.academy.core.block.dev.MsgDeveloper.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    x = buf.readInt();
    y = buf.readShort();//  ww  w .j  a v a  2 s  .  c  o m
    z = buf.readInt();
    energy = buf.readInt();
    isStimulating = buf.readBoolean();
    stimSuccess = buf.readByte();
    stimFailure = buf.readByte();
    nMagIncr = buf.readByte();
    userID = buf.readInt();
}

From source file:cn.academy.core.ctrl.ControlMessage.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    skillId = buf.readInt();
    eventType = SkillEventType.values()[buf.readInt()];
    time = buf.readInt();
}

From source file:cn.academy.core.ctrl.DimensionSkillStateMessage.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    dimension = buf.readInt();

    int count = buf.readInt();
    for (int i = 0; i < count; ++i) {
        SkillStateMessage msg = new SkillStateMessage();
        msg.fromBytes(buf);//www .j a v a  2  s  . co  m
    }
}

From source file:cn.academy.core.ctrl.SkillStateMessage.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    action = Action.values()[buf.readInt()];
    stateID = buf.readInt();/*from  www  .ja  v a2 s . co  m*/
    playerName = ByteBufUtils.readUTF8String(buf);
    className = ByteBufUtils.readUTF8String(buf);
    nbt = ByteBufUtils.readTag(buf);
}

From source file:cn.academy.energy.msg.fr.MsgFRAction.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    x = buf.readInt();
    y = buf.readInt();/*from   www . j ava  2 s  .c  om*/
    z = buf.readInt();
    type = buf.readBoolean() ? ActionType.REG : ActionType.UNREG;
    if (type == ActionType.REG) {
        coords = new int[] { buf.readInt(), buf.readInt(), buf.readInt() };
        pwd = ByteBufUtils.readUTF8String(buf);
    }
}

From source file:cn.academy.energy.msg.fr.MsgFRInit.java

License:Open Source License

@Override
public void fromBytes(ByteBuf buf) {
    curChannel = ByteBufUtils.readUTF8String(buf);
    if (curChannel == "")
        curChannel = null;//from   w w w  .j  a  v  a  2 s .  c o  m
    int n = buf.readInt();
    while (n-- > 0) {
        String str = ByteBufUtils.readUTF8String(buf);
        int[] arr = new int[] { buf.readInt(), buf.readInt(), buf.readInt() };
        cnMap.put(str, arr);
    }
}