Package com.ngt.jopenmetaverse.shared.sim.inventory

Examples of com.ngt.jopenmetaverse.shared.sim.inventory.InventoryItem


    }

    // Remove from store if the item is no copy
    if (_Store.Items.containsKey(itemID) && _Store.get(itemID) instanceof InventoryItem)
    {
      InventoryItem invItem = (InventoryItem)_Store.get(itemID);
      if ((PermissionMask.getIndex(invItem.Permissions.OwnerMask) & PermissionMask.Copy.getIndex()) == PermissionMask.None.getIndex())
      {
        _Store.RemoveNodeFor(invItem);
      }
    }
View Full Code Here


    {

      if (_Store.Items.containsKey(folderContents.get(i).UUID)
          && _Store.get(folderContents.get(i).UUID) instanceof InventoryItem)
      {
        InventoryItem invItem = (InventoryItem)_Store.get(folderContents.get(i).UUID);
        if ((PermissionMask.getIndex(invItem.Permissions.OwnerMask) & PermissionMask.Copy.getIndex()) == PermissionMask.None.getIndex())
        {
          _Store.RemoveNodeFor(invItem);
        }
      }
View Full Code Here

    case Snapshot: return new InventorySnapshot(id);
    case Attachment: return new InventoryAttachment(id);
    case Wearable: return new InventoryWearable(id);
    case Animation: return new InventoryAnimation(id);
    case Gesture: return new InventoryGesture(id);
    default: return new InventoryItem(type, id);
    }
  }
View Full Code Here

    }
  }

  private InventoryItem SafeCreateInventoryItem(InventoryType InvType, UUID ItemID)
  {
    InventoryItem ret = null;

    if (_Store.contains(ItemID))
      ret = (InventoryItem)_Store.get(ItemID);

    if (ret == null)
View Full Code Here

   
                items.add(folder);
              }
              else
              {
                InventoryItem item = new InventoryItem(itemID);
                item.Name = name;
                item.ParentUUID = parentID;
                item.AssetType = assetType;
   
                items.add(item);
              }
   
              //endregion inv_object
            }
            else if (key.equals("inv_item"))
            {
              //region inv_item
   
              // Any inventory item that links to an assetID, has permissions, etc
              UUID itemID = UUID.Zero;
              UUID assetID = UUID.Zero;
              UUID parentID = UUID.Zero;
              UUID creatorID = UUID.Zero;
              UUID ownerID = UUID.Zero;
              UUID lastOwnerID = UUID.Zero;
              UUID groupID = UUID.Zero;
              boolean groupOwned = false;
              String name = "";
              String desc = "";
              AssetType assetType = AssetType.Unknown;
              InventoryType inventoryType = InventoryType.Unknown;
              Date creationDate = Utils.Epoch;
              //uint
              long flags = 0;
              Permissions perms = Permissions.NoPermissions;
              SaleType saleType = SaleType.Not;
              int salePrice = 0;
   
              while (lineNum < lines.length)
              {
                if (ParseLine(lines[lineNum++], key, value))
                {
                  if (key[0].equals("{"))
                  {
                    continue;
                  }
                  else if (key[0].equals("}"))
                  {
                    break;
                  }
                  else if (key[0].equals("item_id"))
                  {
                    itemID = UUID.Parse(value[0]);
                  }
                  else if (key[0].equals("parent_id"))
                  {
                    parentID = UUID.Parse(value[0]);
                  }
                  else if (key[0].equals("permissions"))
                  {
                    //region permissions
   
                    while (lineNum < lines.length)
                    {
                      if (ParseLine(lines[lineNum++], key, value))
                      {
                        if (key[0].equals("{"))
                        {
                          continue;
                        }
                        else if (key[0].equals("}"))
                        {
                          break;
                        }
                        //TODO need to verify following
                        else if (key[0].equals("creator_mask"))
                        {
                          // Deprecated
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            perms.BaseMask = PermissionMask.get(val);
                        }
                        else if (key[0].equals("base_mask"))
                        {
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            perms.BaseMask = PermissionMask.get(val);
                        }
                        else if (key[0].equals("owner_mask"))
                        {
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            perms.OwnerMask = PermissionMask.get(val);
                        }
                        else if (key[0].equals("group_mask"))
                        {
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            perms.GroupMask = PermissionMask.get(val);
                        }
                        else if (key[0].equals("everyone_mask"))
                        {
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            perms.EveryoneMask = PermissionMask.get(val);
                        }
                        else if (key[0].equals("next_owner_mask"))
                        {
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            perms.NextOwnerMask = PermissionMask.get(val);
                        }
                        else if (key[0].equals("creator_id"))
                        {
   
                          creatorID = UUID.Parse(value[0]);
                        }
                        else if (key[0].equals("owner_id"))
                        {
                          ownerID = UUID.Parse(value[0]);
                        }
                        else if (key[0].equals("last_owner_id"))
                        {
                          lastOwnerID = UUID.Parse(value[0]);
                        }
                        else if (key[0].equals("group_id"))
                        {
                          groupID = UUID.Parse(value[0]);
                        }
                        else if (key[0].equals("group_owned"))
                        {
                          long val;
                          if ((val = Utils.hexStringToUInt(value[0], false)) >=0)
                            groupOwned = (val != 0);
                        }
                      }
                    }
   
                    //endregion permissions
                  }
                  else if (key[0].equals("sale_info"))
                  {
                    //region sale_info
   
                    while (lineNum < lines.length)
                    {
                      if (ParseLine(lines[lineNum++], key, value))
                      {
                        if (key[0].equals("{"))
                        {
                          continue;
                        }
                        else if (key[0].equals("}"))
                        {
                          break;
                        }
                        else if (key[0].equals("sale_type"))
                        {
                          saleType = Utils.StringToSaleType(value[0]);
                        }
                        else if (key[0].equals("sale_price"))
                        {
                          salePrice = (int)Utils.hexStringToUInt(value[0], false);
                        }
                      }
                    }
   
                    //endregion sale_info
                  }
                  else if (key[0].equals("shadow_id"))
                  {
                    UUID[] shadowID = new UUID[0];
                    if (Utils.tryParseUUID(value[0], shadowID))
                      assetID = DecryptShadowID(shadowID[0]);
                  }
                  else if (key[0].equals("asset_id"))
                  {
                    assetID = UUID.Parse(value[0]);
                  }
                  else if (key[0].equals("type"))
                  {
                    assetType = Utils.StringToAssetType(value[0]);
                  }
                  else if (key[0].equals("inv_type"))
                  {
                    inventoryType = Utils.StringToInventoryType(value[0]);
                  }
                  else if (key[0].equals("flags"))
                  {
                    long[] a = new long[1];
                    Utils.tryParseLong(value[0], a);
                    flags = a[1];
                  }
                  else if (key[0].equals("name"))
                  {
                    name = value[0].substring(0, value[0].indexOf('|'));
                  }
                  else if (key[0].equals("desc"))
                  {
                    desc = value[0].substring(0, value[0].indexOf('|'));
                  }
                  else if (key[0].equals("creation_date"))
                  {
                    long[] timestamp = new long[1];
                    if (Utils.tryParseLong(value[0], timestamp))
                      creationDate = Utils.unixTimeToDate(timestamp[0]);
                    else
                      JLogger.warn("Failed to parse creation_date " + value[0]);
                  }
                }
              }
   
              InventoryItem item = CreateInventoryItem(inventoryType, itemID);
              item.AssetUUID = assetID;
              item.AssetType = assetType;
              item.CreationDate = creationDate;
              item.CreatorID = creatorID;
              item.Description = desc;
View Full Code Here

        // Iterate items in this packet
        for (int i = 0; i < reply.ItemData.length; i++)
        {
          if (reply.ItemData[i].ItemID != UUID.Zero)
          {
            InventoryItem item;
            /*
             * Objects that have been attached in-world prior to being stored on the
             * asset server are stored with the InventoryType of 0 (Texture)
             * instead of 17 (Attachment)
             *
 
View Full Code Here

      {
        JLogger.error("Received InventoryFolder in an UpdateCreateInventoryItem packet, this should not happen!");
        continue;
      }

      InventoryItem item = CreateInventoryItem(InventoryType.get(dataBlock.InvType), dataBlock.ItemID);
      item.AssetType = AssetType.get(dataBlock.Type);
      item.AssetUUID = dataBlock.AssetID;
      item.CreationDate = Utils.unixTimeToDate(dataBlock.CreationDate);
      item.CreatorID = dataBlock.CreatorID;
      item.Description = Utils.bytesWithTrailingNullByteToString(dataBlock.Description);
View Full Code Here

        // If we are given a folder of items, the item information might arrive before the folder
        // (parent) is in the store
        if (!_Store.contains(dataBlock.ItemID))
          JLogger.warn("Received BulkUpdate for unknown item: " + dataBlock.ItemID);

        InventoryItem item = SafeCreateInventoryItem(InventoryType.get(dataBlock.InvType), dataBlock.ItemID);

        item.AssetType = AssetType.get(dataBlock.Type);
        if (dataBlock.AssetID != UUID.Zero) item.AssetUUID = dataBlock.AssetID;
        item.CreationDate = Utils.unixTimeToDate(dataBlock.CreationDate);
        item.CreatorID = dataBlock.CreatorID;
View Full Code Here

        JLogger.error("Received FetchInventoryReply for an inventory folder, this should not happen!"
            );
        continue;
      }

      InventoryItem item = CreateInventoryItem(InventoryType.get(dataBlock.InvType), dataBlock.ItemID);
      item.AssetType = AssetType.get(dataBlock.Type);
      item.AssetUUID = dataBlock.AssetID;
      item.CreationDate = Utils.unixTimeToDate(dataBlock.CreationDate);
      item.CreatorID = dataBlock.CreatorID;
      item.Description = Utils.bytesWithTrailingNullByteToString(dataBlock.Description);
View Full Code Here

TOP

Related Classes of com.ngt.jopenmetaverse.shared.sim.inventory.InventoryItem

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.