Examples of MessageBlock


Examples of jNab.core.protocol.MessageBlock

      return;
  }

  // Playing recorded sound
  Packet p = new Packet();
  MessageBlock mb = new MessageBlock(600);
  mb.addPlayLocalSoundCommand("echo" + this.bunny.getSerialNumber() + ".wav");
  mb.addWaitPreviousEndCommand();
  p.addBlock(mb);
  p.addBlock(new PingIntervalBlock(1));
  this.bunny.addPacket(p);
    }
View Full Code Here

Examples of jNab.core.protocol.MessageBlock

  }

  // Sending the message to the buddy bunny
  try
  {
      MessageBlock mb = new MessageBlock(600);
      mb.addPlayLocalSoundCommand("message" + receiver + ".wav");
      mb.addWaitPreviousEndCommand();
      Packet p = new Packet();
      p.addBlock(mb);
      p.addBlock(new PingIntervalBlock(1));

      this.bunny.getBurrow().getBunny(receiver).addPacket(p);
View Full Code Here

Examples of jNab.core.protocol.MessageBlock

  // Preparing a new packet
  Packet p = new Packet();
 
  // Asking the bunny to ping 20s later (i.e. when the choreography has finished playing)
  p.addBlock(new PingIntervalBlock(20));
  MessageBlock mb = new MessageBlock(12345);
 
  // Playing the choreography associated to current level.
  mb.addPlayChoreographyFromLibraryCommand(this.getChoreography());
  mb.addWaitPreviousEndCommand();
  p.addBlock(mb);
  this.bunny.addPacket(p);
 
  // Switching level if needed
  if (System.currentTimeMillis() - this.lastSwitchingTime > 60000)
View Full Code Here

Examples of jNab.core.protocol.MessageBlock

  // A choreography is sent to raise both ears and bunny is asked to ping immediately after (to be able to send
  // packets generated by single-click event handling)
  this.bunny.handleEvent(Bunny.SINGLE_CLICK_EVENT, null);
  Packet p = new Packet();
  p.addBlock(new PingIntervalBlock(1));
  MessageBlock mb = new MessageBlock(12345);
  mb.addPlayChoreographyFromLibraryCommand("raisedEars");
  p.addBlock(mb);
  this.bunny.forcePacket(p);
    }
View Full Code Here

Examples of jNab.core.protocol.MessageBlock

  // Generating a random number between 1 and 6
  Random rd = new Random();
  int n = rd.nextInt(6) + 1;

  // Playing the associated sound files
  MessageBlock mb = new MessageBlock(333);
  mb.addPlayLocalSoundCommand("files/sounds/dice/get.mp3");
  mb.addWaitPreviousEndCommand();
  mb.addPlayLocalSoundCommand("files/sounds/dice/" + n + ".mp3");
  mb.addWaitPreviousEndCommand();
  p.addBlock(mb);
  p.addBlock(new PingIntervalBlock(1));
  this.bunny.addPacket(p);
    }
View Full Code Here

Examples of jNab.core.protocol.MessageBlock

  int n2 = rd.nextInt(6) + 1;

  Packet p = new Packet();

  // Playing the associated sound on the bunny
  MessageBlock mb = new MessageBlock(333);
  mb.addPlaySoundCommand("broadcast/files/sounds/dice/get.mp3");
  mb.addWaitPreviousEndCommand();
  mb.addPlaySoundCommand("broadcast/files/sounds/dice/" + n1 + ".mp3");
  mb.addWaitPreviousEndCommand();
  mb.addPlaySoundCommand("broadcast/files/sounds/dice/" + n2 + ".mp3");
  mb.addWaitPreviousEndCommand();
  p.addBlock(mb);
  p.addBlock(new PingIntervalBlock(1));
  this.bunny.addPacket(p);
    }
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.