Ejemplo n.º 1
0
        public virtual bool PurgeFolder(InventoryFolderBase folder, bool onlyIfTrash)
        {
            if (!m_AllowDelete)
            {
                return(false);
            }

            if (onlyIfTrash && !ParentIsTrash(folder.ID))
            {
                return(false);
            }

            XInventoryFolder[] subFolders = m_Database.GetFolders(
                new string[] { "parentFolderID" },
                new string[] { folder.ID.ToString() });

            foreach (XInventoryFolder x in subFolders)
            {
                PurgeFolder(ConvertToOpenSim(x), onlyIfTrash);
                m_Database.DeleteFolders("folderID", x.folderID.ToString());
            }

            m_Database.DeleteItems("parentFolderID", folder.ID.ToString());

            return(true);
        }
        public virtual bool DeleteItems(UUID principalID, List <UUID> itemIDs)
        {
            if (!m_AllowDelete)
            {
                // We must still allow links and links to folders to be deleted, otherwise they will build up
                // in the player's inventory until they can no longer log in.  Deletions of links due to code bugs or
                // similar is inconvenient but on a par with accidental movement of items.  The original item is never
                // touched.
                foreach (UUID id in itemIDs)
                {
                    if (!m_Database.DeleteItems(
                            new string[] { "inventoryID", "assetType" },
                            new string[] { id.ToString(), ((sbyte)AssetType.Link).ToString() }))
                    {
                        m_Database.DeleteItems(
                            new string[] { "inventoryID", "assetType" },
                            new string[] { id.ToString(), ((sbyte)AssetType.LinkFolder).ToString() });
                    }
                }
            }
            else
            {
                // Just use the ID... *facepalms*
                //
                foreach (UUID id in itemIDs)
                {
                    m_Database.DeleteItems("inventoryID", id.ToString());
                }
            }

            return(true);
        }