Package com.ngt.jopenmetaverse.shared.types

Examples of com.ngt.jopenmetaverse.shared.types.UUID


      int i = 0;

      try
      {
        // UUID
        UUID FullID = new UUID(block.Data, 0);
        i += 16;
        // Local ID
        //uint
        long LocalID = Utils.bytesToUIntLit(block.Data, i); i += 4;
        //                            (uint)(block.Data[i++] + (block.Data[i++] << 8) +
        //                            (block.Data[i++] << 16) + (block.Data[i++] << 24));

        // PCode
        PCode pcode = PCode.get(block.Data[i++]);

        //region Relevance check

        if (!Client.settings.ALWAYS_DECODE_OBJECTS)
        {
          switch (pcode)
          {
          case Grass:
          case Tree:
          case NewTree:
          case Prim:
            if (onObjectUpdate == null) continue;
            break;
          }
        }

        //endregion Relevance check

        boolean isNew;
        //                        lock (simulator.ObjectsPrimitives.Dictionary)
        isNew = simulator.ObjectsPrimitives.containsKey(LocalID);

        Primitive prim = GetPrimitive(simulator, LocalID, FullID);

        prim.LocalID = LocalID;
        prim.ID = FullID;
        prim.Flags = block.UpdateFlags;
        prim.PrimData.PCode = pcode;

        //region Decode block and update Prim

        // State
        prim.PrimData.State = block.Data[i++];
        // CRC
        i += 4;
        // Material
        prim.PrimData.Material = Material.get(block.Data[i++]);
        // Click action
        prim.ClickAction = ClickAction.get(block.Data[i++]);
        // Scale
        prim.Scale = new Vector3(block.Data, i);
        i += 12;
        // Position
        prim.Position = new Vector3(block.Data, i);
        i += 12;
        // Rotation
        prim.Rotation = new Quaternion(block.Data, i, true);
        i += 12;
        // Compressed flags
        //EnumSet<CompressedFlags>
        long flags = Utils.bytesToUIntLit(block.Data, i);
        i += 4;

        prim.OwnerID = new UUID(block.Data, i);
        i += 16;

        // Angular velocity
        if ((flags & CompressedFlags.HasAngularVelocity.getIndex()) != 0)
        {
          prim.AngularVelocity = new Vector3(block.Data, i);
          i += 12;
        }

        // Parent ID
        if ((flags & CompressedFlags.HasParent.getIndex()) != 0)
        {
          //                            prim.ParentID = (uint)(block.Data[i++] + (block.Data[i++] << 8) +
          //                            (block.Data[i++] << 16) + (block.Data[i++] << 24));
          prim.ParentID = Utils.bytesToUIntLit(block.Data, i); i += 4;
        }
        else
        {
          prim.ParentID = 0;
        }

        // Tree data
        if ((flags & CompressedFlags.Tree.getIndex()) != 0)
        {
          prim.TreeSpecies = Tree.get(block.Data[i++]);
          //prim.ScratchPad = Utils.EmptyBytes;
        }
        // Scratch pad
        else if ((flags & CompressedFlags.ScratchPad.getIndex()) != 0)
        {
          prim.TreeSpecies = Tree.get((byte)0);

          int size = block.Data[i++];
          //prim.ScratchPad = new byte[size];
          //Buffer.BlockCopy(block.Data, i, prim.ScratchPad, 0, size);
          i += size;
        }
        prim.ScratchPad = Utils.EmptyBytes;

        // Floating text
        if ((flags & CompressedFlags.HasText.getIndex())  != 0)
        {
          String text = "";
          while (block.Data[i] != 0)
          {
            text += (char)block.Data[i];
            i++;
          }
          i++;

          // Floating text
          prim.Text = text;

          // Text color
          prim.TextColor = new Color4(block.Data, i, false);
          i += 4;
        }
        else
        {
          prim.Text = "";
        }

        // Media URL
        if ((flags & CompressedFlags.MediaURL.getIndex())  != 0)
        {
          String text = "";
          while (block.Data[i] != 0)
          {
            text += (char)block.Data[i];
            i++;
          }
          i++;

          prim.MediaURL = text;
        }

        // Particle system
        if ((flags & CompressedFlags.HasParticles.getIndex())  != 0)
        {
          prim.ParticleSys = new ParticleSystem(block.Data, i);
          i += 86;
        }

        // Extra parameters
        i += prim.SetExtraParamsFromBytes(block.Data, i);

        //Sound data
        if ((flags & CompressedFlags.HasSound.getIndex())  != 0)
        {
          prim.Sound = new UUID(block.Data, i);
          i += 16;

          prim.SoundGain = Utils.bytesToFloatLit(block.Data, i);
          i += 4;
          prim.SoundFlags = block.Data[i++];
View Full Code Here


      props.TouchName = Utils.bytesWithTrailingNullByteToString(objectData.TouchName);

      int numTextures = objectData.TextureID.length / 16;
      props.TextureIDs = new UUID[numTextures];
      for (int j = 0; j < numTextures; ++j)
        props.TextureIDs[j] = new UUID(objectData.TextureID, j * 16);

      if (Client.settings.OBJECT_TRACKING)
      {
        //                        Primitive findPrim = simulator.ObjectsPrimitives.Find(
        //                            delegate(Primitive prim) { return prim.ID == props.ObjectID; });
View Full Code Here

    {
      Packet packet = e.getPacket();
      Simulator simulator = e.getSimulator();

      PayPriceReplyPacket p = (PayPriceReplyPacket)packet;
      UUID objectID = p.ObjectData.ObjectID;
      int defaultPrice = p.ObjectData.DefaultPayPrice;
      int[] buttonPrices = new int[p.ButtonData.length];

      for (int i = 0; i < p.ButtonData.length; i++)
      {
View Full Code Here

      for (ScriptDialogPacket.ButtonsBlock button : dialog.Buttons)
      {
        buttons.add(Utils.bytesWithTrailingNullByteToString(button.ButtonLabel));
      }

      UUID ownerID = UUID.Zero;

      if (dialog.OwnerData != null && dialog.OwnerData.length > 0)
      {
        ownerID = dialog.OwnerData[0].OwnerID;
      }
View Full Code Here

        // Reset the signaled animation list
        SignaledAnimations.getDictionary().clear();

        for (int i = 0; i < animation.AnimationList.length; i++)
        {
          UUID animID = animation.AnimationList[i].AnimID;
          int sequenceID = animation.AnimationList[i].AnimSequenceID;

          // Add this animation to the list of currently signaled animations
          SignaledAnimations.add(animID,  sequenceID);
View Full Code Here

                    Matcher m;
                    if ((m = pattern.matcher(line)).find())
                    {
                      MuteEntry me = new MuteEntry();
                      me.Type = MuteType.get(Integer.parseInt(m.group(0)));
                      me.ID = new UUID(m.group(1));
                      me.Name = m.group(2);
                      int[] flags = new int[1];
                      Utils.tryParseInt(m.group(3), flags);
//                      Integer.parseInt(m.Groups["Flags"].Value;
                      me.Flags = MuteFlags.get(flags[0]);
View Full Code Here

                        case Animation:
                            {
                                GestureStepAnimation step = new GestureStepAnimation();
                                step.Name = lines[i++];
                                step.ID = new UUID(lines[i++]);
                                int flags = Integer.parseInt(lines[i++]);

                                if (flags == 0)
                                {
                                    step.AnimationStart = true;
                                }
                                else
                                {
                                    step.AnimationStart = false;
                                }

                                Sequence.add(step);
                                break;
                            }

                        case Sound:
                            {
                                GestureStepSound step = new GestureStepSound();
                                step.Name = lines[i++].replace("\r", "");
                                step.ID = new UUID(lines[i++]);
                                int flags = Integer.parseInt(lines[i++]);

                                Sequence.add(step);
                                break;
                            }
View Full Code Here

  {
    OSD osd;
    if (((osd = reply.get(key)) != null))
      return osd.asUUID();
    else
      return new UUID();
  }
View Full Code Here

    return folders.toArray(new InventoryFolder[0]);
  }

  public InventoryFolder[] ParseInventorySkeleton(String key, Map reply)
  {
    UUID ownerID;
    if (key.equals("inventory-skel-lib"))
      ownerID = LibraryOwner;
    else
      ownerID = AgentID;
View Full Code Here

                    assetPath, ArchiveConstants.ASSET_EXTENSION_SEPARATOR));
                return false;
            }

            String extension = filename.substring(i);
            UUID uuid;
            uuid = UUID.Parse(filename.substring(0, filename.length() - extension.length()));

            if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.containsKey(extension))
            {
                AssetType assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE.get(extension);
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.types.UUID

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.