public InventoryFolderBase GetFolder(UUID folderId) { IInventoryProviderSelector selector = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); ICheckedInventoryStorage provider = selector.GetCheckedProvider(m_userProfile.ID); return(provider.GetFolder(m_userProfile.ID, folderId)); }
public void ModifyAndMoveItem(InventoryItemBase item, UUID folderID) { IInventoryProviderSelector selector = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); ICheckedInventoryStorage provider = selector.GetCheckedProvider(m_userProfile.ID); provider.ModifyAndMoveItem(m_userProfile.ID, item, folderID); }
public InventoryFolderBase GetFolderAttributesChecked(UUID folderId) { IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); InventoryFolderBase folderInfo = inventorySelect.GetCheckedProvider(m_userProfile.ID).GetFolderAttributes(m_userProfile.ID, folderId); return(folderInfo); }
public void CheckedDeleteItem(UUID userId, UUID inventoryID) { IInventoryProviderSelector selector = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); ICheckedInventoryStorage provider = selector.GetCheckedProvider(userId); provider.PurgeItem(userId, inventoryID); }
public virtual void DeactivateGesture(IClientAPI client, List<UUID> gestureIds) { IInventoryProviderSelector selector = ProviderRegistry.Instance.Get<IInventoryProviderSelector>(); ICheckedInventoryStorage provider = selector.GetCheckedProvider(client.AgentId); provider.DeactivateGestures(client.AgentId, gestureIds); }
/// <summary> /// Handle an inventory folder move request from the client. /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// </summary> /// /// <param name="folderID"></param> /// <param name="parentID"></param> /// <returns> /// true if the delete was successful, or if it was queued pending folder receipt /// false if the folder to be deleted did not exist. /// </returns> public bool MoveFolder(UUID folderID, UUID parentID) { try { IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); inventorySelect.GetCheckedProvider(m_userProfile.ID).MoveFolder(m_userProfile.ID, folderID, parentID); return(true); } catch (InventoryStorageException) { } return(false); }
public InventoryItemBase FindItem(UUID itemId) { try { IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); InventoryItemBase itemInfo = inventorySelect.GetCheckedProvider(m_userProfile.ID).GetItem(m_userProfile.ID, itemId, UUID.Zero); return(itemInfo); } catch (InventoryStorageException e) { m_log.ErrorFormat("[INVENTORY] Could not find requested item {0}: {1}", itemId, e); } return(null); }
/// <summary> /// Create a folder in this agent's inventory. /// </summary> /// /// If the inventory service has not yet delievered the inventory /// for this user then the request will be queued. /// /// <param name="parentID"></param> /// <returns></returns> public InventoryFolderBase CreateFolder(string folderName, UUID folderID, short folderType, UUID parentID) { InventoryFolderBase createdBaseFolder = new InventoryFolderBase(); createdBaseFolder.Owner = UserProfile.ID; createdBaseFolder.ID = folderID; createdBaseFolder.Name = folderName; createdBaseFolder.ParentID = parentID; createdBaseFolder.Type = (short)folderType; createdBaseFolder.Version = 1; IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); inventorySelect.GetCheckedProvider(m_userProfile.ID).CreateFolder(UserProfile.ID, createdBaseFolder); return(createdBaseFolder); }
// Load additional items that other regions have put into the database // The item will be added tot he local cache. Returns true if the item // was found and can be sent to the client // public bool QueryItem(UUID itemId) { try { IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); InventoryItemBase itemInfo = inventorySelect.GetCheckedProvider(m_userProfile.ID).GetItem(m_userProfile.ID, itemId, UUID.Zero); if (itemInfo != null) { ItemReceive(itemInfo, null); return(true); } } catch (InventoryStorageException) { } return(false); }
public InventoryItemBase FindItem(UUID itemId, bool quiet = false) { try { IInventoryProviderSelector inventorySelect = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); InventoryItemBase itemInfo = inventorySelect.GetCheckedProvider(m_userProfile.ID).GetItem(m_userProfile.ID, itemId, UUID.Zero); return(itemInfo); } catch (InventoryStorageException e) { if ((!quiet) || !e.ErrorDetails.Contains("Item was not found")) // don't report "not found" when quiet == true { m_log.ErrorFormat("[INVENTORY] Could not find requested item {0}: {1}", itemId, e); } } return(null); }
/// <summary> /// Send details of the inventory items and/or folders in a given folder to the client. /// </summary> /// <param name="client"></param> /// <param name="folderID"></param> /// <param name="fetchFolders"></param> /// <param name="fetchItems"></param> /// <returns>true if the request was queued or successfully processed, false otherwise</returns> public bool SendInventoryDecendents(IClientAPI client, UUID folderID, bool fetchFolders, bool fetchItems) { IInventoryProviderSelector selector = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); InventoryFolderBase folder = selector.GetCheckedProvider(client.AgentId).GetFolder(client.AgentId, folderID); List <InventoryFolderBase> subFolders = new List <InventoryFolderBase>(); List <InventoryItemBase> items = new List <InventoryItemBase>(); //sort into items and folders foreach (InventorySubFolderBase subFolder in folder.SubFolders) { subFolders.Add(new InventoryFolderBase { ID = subFolder.ID, ParentID = folderID, Name = subFolder.Name, Owner = subFolder.Owner, Type = subFolder.Type }); } items.AddRange(folder.Items); client.SendInventoryFolderDetails(client.AgentId, folder, items, subFolders, fetchFolders, fetchItems); return(true); }
/// <summary> /// Add an item to the user's inventory. /// </summary> /// If the item has no folder set (i.e. it is UUID.Zero), then it is placed in the most appropriate folder /// for that type. /// <param name="itemInfo"></param> public void AddItem(InventoryItemBase item) { if (item.Folder == UUID.Zero) { InventoryFolderBase f = FindFolderForType(item.AssetType); if (f != null) { item.Folder = f.ID; } else { InventoryFolderBase folder = FindFolderForType((int)FolderType.Root); item.Folder = folder.ID; } } IInventoryProviderSelector selector = ProviderRegistry.Instance.Get <IInventoryProviderSelector>(); selector.GetCheckedProvider(m_userProfile.ID).CreateItem(m_userProfile.ID, item); ItemReceive(item, null); }
public InventoryCapsHandler(Scene scene, UUID agentID, Caps caps) { m_agentID = agentID; m_Caps = caps; m_Scene = scene; m_httpServer = m_Caps.HttpListener; m_regionName = m_Scene.RegionInfo.RegionName; m_assetCache = m_Scene.CommsManager.AssetCache; m_inventoryProviderSelector = ProviderRegistry.Instance.Get<IInventoryProviderSelector>(); m_checkedStorageProvider = m_inventoryProviderSelector.GetCheckedProvider(m_Caps.AgentID); m_libraryFolder = m_Scene.CommsManager.LibraryRoot; m_inventoryPool.Name = "Inventory Caps " + agentID; }