Package org.jboss.netty.buffer

Examples of org.jboss.netty.buffer.ChannelBuffer.writeByte()


  @Override
  public ChannelBuffer encode(AnimateEntityMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(5);
    buffer.writeInt(message.getId());
    buffer.writeByte(message.getAnimation());
    return buffer;
  }

}
View Full Code Here


  public ChannelBuffer encode(MapDataMessage message) {
    byte[] data = message.getData();
    ChannelBuffer buffer = ChannelBuffers.buffer(5 + data.length);
    buffer.writeShort(0); //FIXME
    buffer.writeShort(message.getId());
    buffer.writeByte(data.length);
    buffer.writeBytes(data, 0, data.length);
    return buffer;
  }

}
View Full Code Here

  @Override
  public ChannelBuffer encode(SpawnItemMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(22);
    buffer.writeInt(message.getId());
    buffer.writeShort(message.getItem().getId());
    buffer.writeByte(message.getItem().getCount());
    buffer.writeShort(message.getItem().getDamage());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getRotation());
View Full Code Here

    buffer.writeByte(message.getItem().getCount());
    buffer.writeShort(message.getItem().getDamage());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getRotation());
    buffer.writeByte(message.getPitch());
    buffer.writeByte(message.getRoll());
    return buffer;
  }
View Full Code Here

    buffer.writeShort(message.getItem().getDamage());
    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getRotation());
    buffer.writeByte(message.getPitch());
    buffer.writeByte(message.getRoll());
    return buffer;
  }

}
View Full Code Here

    buffer.writeInt(message.getX());
    buffer.writeInt(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeByte(message.getRotation());
    buffer.writeByte(message.getPitch());
    buffer.writeByte(message.getRoll());
    return buffer;
  }

}
View Full Code Here

  }

  @Override
  public ChannelBuffer encode(DiggingMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(11);
    buffer.writeByte(message.getState());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeInt(message.getFace());
    return buffer;
View Full Code Here

  @Override
  public ChannelBuffer encode(DiggingMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(11);
    buffer.writeByte(message.getState());
    buffer.writeInt(message.getX());
    buffer.writeByte(message.getY());
    buffer.writeInt(message.getZ());
    buffer.writeInt(message.getFace());
    return buffer;
  }
View Full Code Here

  @Override
  public ChannelBuffer encode(EntityActionMessage message) throws IOException {
    ChannelBuffer buffer = ChannelBuffers.buffer(5);
    buffer.writeInt(message.getId());
    buffer.writeByte(message.getAction());
    return buffer;
  }

}
View Full Code Here

    buffer.writeDouble(message.getY());
    buffer.writeDouble(message.getStance());
    buffer.writeDouble(message.getZ());
    buffer.writeFloat(message.getRotation());
    buffer.writeFloat(message.getPitch());
    buffer.writeByte(message.isOnGround() ? 1 : 0);
    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.