Package com.ngt.jopenmetaverse.shared.protocol

Examples of com.ngt.jopenmetaverse.shared.protocol.DirPlacesReplyPacket$QueryRepliesBlock


  protected void DirPlacesReplyHandler(Object sender, PacketReceivedEventArgs e) throws UnsupportedEncodingException
  {
    if (OnDirPlaces != null)
    {
      Packet packet = e.getPacket();
      DirPlacesReplyPacket reply = (DirPlacesReplyPacket)packet;
      List<DirectoryParcel> result = new ArrayList<DirectoryParcel>();

      for (int i = 0; i < reply.QueryReplies.length; i++)
      {
        DirectoryParcel p = new DirectoryParcel();
View Full Code Here


  @Test
  public void ToBytesMultiple() throws MalformedDataException
  {
    UUID testID = UUID.Random();

    DirPlacesReplyPacket bigPacket = new DirPlacesReplyPacket();
    bigPacket.header.Zerocoded = false;
    bigPacket.header.Sequence = 42;
    bigPacket.header.AppendedAcks = true;
    //Unsigned int
    bigPacket.header.AckList = new long[50];
    for (int i = 0; i < bigPacket.header.AckList.length; i++) { bigPacket.header.AckList[i] = (long)i; }
    bigPacket.AgentData.AgentID = testID;
    bigPacket.QueryData = new DirPlacesReplyPacket.QueryDataBlock[100];
    for (int i = 0; i < bigPacket.QueryData.length; i++)
    {
      bigPacket.QueryData[i] = new DirPlacesReplyPacket.QueryDataBlock();
      bigPacket.QueryData[i].QueryID = testID;
    }
    bigPacket.QueryReplies = new DirPlacesReplyPacket.QueryRepliesBlock[100];
    for (int i = 0; i < bigPacket.QueryReplies.length; i++)
    {
      bigPacket.QueryReplies[i] = new DirPlacesReplyPacket.QueryRepliesBlock();
      bigPacket.QueryReplies[i].Auction = (i & 1) == 0;
      bigPacket.QueryReplies[i].Dwell = (float)i;
      bigPacket.QueryReplies[i].ForSale = (i & 1) == 0;
      bigPacket.QueryReplies[i].Name = Utils.stringToBytes("DirPlacesReply Test String");
      bigPacket.QueryReplies[i].ParcelID = testID;
    }
    bigPacket.StatusData = new DirPlacesReplyPacket.StatusDataBlock[100];
    for (int i = 0; i < bigPacket.StatusData.length; i++)
    {
      bigPacket.StatusData[i] = new DirPlacesReplyPacket.StatusDataBlock();
      bigPacket.StatusData[i].Status = (long)i;
    }
   
    byte[][] splitPackets = bigPacket.ToBytesMultiple();

    int queryDataCount = 0;
    int queryRepliesCount = 0;
    int statusDataCount = 0;
    for (int i = 0; i < splitPackets.length; i++)
    {
      byte[] packetData = splitPackets[i];
      int[] len = new int[]{packetData.length - 1};
      DirPlacesReplyPacket packet = (DirPlacesReplyPacket)Packet.BuildPacket(packetData, len, packetData);

      Assert.assertTrue(packet.AgentData.AgentID.equals(bigPacket.AgentData.AgentID));

      for (int j = 0; j < packet.QueryReplies.length; j++)
      {
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.protocol.DirPlacesReplyPacket$QueryRepliesBlock

Copyright © 2018 www.massapicom. 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.