Examples of SpoutInputStream


Examples of org.getspout.spoutapi.io.SpoutInputStream

        }
      } else {
        byte[] data = new byte[length];
        input.readFully(data);

        SpoutInputStream stream = new SpoutInputStream(ByteBuffer.wrap(data));
        packet.readData(stream);

        success = true;
      }
    } catch (IOException ignore) {
View Full Code Here

Examples of org.getspout.spoutapi.io.SpoutInputStream

  }

  @Override
  public void run(int playerId) {
    if (packet != null) {
      SpoutInputStream stream = new SpoutInputStream(ByteBuffer.wrap(data));
      try {
        packet.read(stream);
        SpoutPlayer player = SpoutManager.getPlayerFromId(playerId);
        if (player != null) {
          packet.run(player);
View Full Code Here

Examples of org.getspout.spoutapi.io.SpoutInputStream

    long lsb = input.readLong();

    int size = input.readInt();
    byte[] widgetData = new byte[size];
    input.read(widgetData);
    SpoutInputStream data = new SpoutInputStream(ByteBuffer.wrap(widgetData));

    int version = input.readShort();
    screen = new UUID(msb, lsb);
    WidgetType widgetType = WidgetType.getWidgetFromId(id);
    if (widgetType != null) {
View Full Code Here

Examples of org.spoutcraft.api.io.SpoutInputStream

      final MappedByteBuffer buffer = read.map(FileChannel.MapMode.READ_ONLY, 0, read.size());
      stream.close();
      customId = buffer.getShort();
      data = buffer.get();
      design = new GenericBlockDesign();
      design.read(new SpoutInputStream(buffer));

    } catch (IOException e) {
      e.printStackTrace();
    } finally {
      if (design != null && design.isReset()) {
View Full Code Here

Examples of org.spoutcraft.api.io.SpoutInputStream

  public void run(int playerId) {
    try {
      if (allWidgets.containsKey(widgetId)) {
        widget = allWidgets.get(widgetId);
        if (widget.getVersion() == version) {
          widget.readData(new SpoutInputStream(widgetData));
        }
      } else {
        widget = widgetType.getWidgetClass().newInstance();

        // Hackish way to set the ID without a setter
        ((GenericWidget) widget).setId(widgetId);
        if (widget.getVersion() == version) {
          widget.readData(new SpoutInputStream(widgetData));
        } else {
          if (nags[widgetType.getId()]-- > 0) {
            System.out.println("Received invalid widget: " + widgetType.getWidgetClass().getSimpleName() + " v: " + version + " current v: " + widget.getVersion());
          }
          widget = null;
View Full Code Here

Examples of org.spoutcraft.api.io.SpoutInputStream

        outdated = outdated || version > packet.getVersion();
      } else {
        byte[] data = new byte[length];
        var1.readFully(data);

        SpoutInputStream stream = new SpoutInputStream(ByteBuffer.wrap(data));
        packet.readData(stream);
        success = true;
      }
    } catch (Exception e) {
      System.out.println("------------------------");
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.