From 509ec2637bd178c270106725297da7f6a1180096 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 4 May 2009 15:02:14 +0000 Subject: [PATCH] * Refactor: Simplify InventoryFolderImpl. No functional change. --- .../Cache/InventoryFolderImpl.cs | 4 +- OpenSim/Framework/InventoryItemBase.cs | 247 +++++------------- .../Agent/TextureSender/J2KDecoderModule.cs | 6 +- .../Archiver/InventoryArchiveWriteRequest.cs | 6 +- 4 files changed, 76 insertions(+), 187 deletions(-) diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs index a625c7ea4b..bc8437c459 100644 --- a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs +++ b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs @@ -396,7 +396,7 @@ namespace OpenSim.Framework.Communications.Cache } /// - /// Return a copy of the list of child items in this folder + /// Return a copy of the list of child items in this folder. The items themselves are the originals. /// public List RequestListOfItems() { @@ -416,7 +416,7 @@ namespace OpenSim.Framework.Communications.Cache } /// - /// Return a copy of the list of child folders in this folder. + /// Return a copy of the list of child folders in this folder. The folders themselves are the originals. /// public List RequestListOfFolders() { diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index ae3777c580..ce3dc63dae 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -34,111 +34,19 @@ namespace OpenSim.Framework /// Inventory Item - contains all the properties associated with an individual inventory piece. /// public class InventoryItemBase : InventoryNodeBase - { + { /// - /// The UUID of the associated asset on the asset server - /// - private UUID _assetID; - - /// - /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) - /// - private int _assetType; - - /// - /// - /// - private uint _basePermissions; - - /// - /// The creator of this item - /// - private string m_creatorId = String.Empty; - - /// - /// The creator of this item expressed as a UUID - /// - private UUID m_creatorIdAsUuid = UUID.Zero; - - /// - /// + /// The inventory type of the item. This is slightly different from the asset type in some situations. /// - private uint _nextPermissions; - - /// - /// A mask containing permissions for the current owner (cannot be enforced) - /// - private uint _currentPermissions; - - /// - /// The description of the inventory item (must be less than 64 characters) - /// - private string _description = string.Empty; - - /// - /// - /// - private uint _everyOnePermissions; - - /// - /// - /// - private uint _groupPermissions; + public int InvType; /// /// The folder this item is contained in - /// - private UUID _folder; - - /// - /// The inventory type of the item. This is slightly different from the asset type in some situations. - /// - private int _invType; - - /// - /// - /// - private UUID _groupID; - - /// - /// - /// - private bool _groupOwned; - - /// - /// - /// - private int _salePrice; - - /// - /// - /// - private byte _saleType; - - /// - /// - /// - private uint _flags; - - /// - /// - /// - private int _creationDate; - - public int InvType - { - get { return _invType; } - set { _invType = value; } - } - - public UUID Folder - { - get { return _folder; } - set { _folder = value; } - } + /// + public UUID Folder; /// - /// The creator ID + /// The creator of this item /// public string CreatorId { @@ -146,107 +54,94 @@ namespace OpenSim.Framework set { m_creatorId = value; + UUID creatorIdAsUuid; // For now, all IDs are UUIDs - UUID.TryParse(m_creatorId, out m_creatorIdAsUuid); + UUID.TryParse(m_creatorId, out creatorIdAsUuid); + CreatorIdAsUuid = creatorIdAsUuid; } } + + private string m_creatorId = String.Empty; /// - /// The creator ID expressed as a UUID + /// The creator of this item expressed as a UUID /// - public UUID CreatorIdAsUuid - { - get { return m_creatorIdAsUuid; } - } + public UUID CreatorIdAsUuid { get; private set; } - public string Description - { - get { return _description; } - set { _description = value; } - } + /// + /// The description of the inventory item (must be less than 64 characters) + /// + public string Description = String.Empty; - public uint NextPermissions - { - get { return _nextPermissions; } - set { _nextPermissions = value; } - } + /// + /// + /// + public uint NextPermissions; - public uint CurrentPermissions - { - get { return _currentPermissions; } - set { _currentPermissions = value; } - } + /// + /// A mask containing permissions for the current owner (cannot be enforced) + /// + public uint CurrentPermissions; - public uint BasePermissions - { - get { return _basePermissions; } - set { _basePermissions = value; } - } + /// + /// + /// + public uint BasePermissions; - public uint EveryOnePermissions - { - get { return _everyOnePermissions; } - set { _everyOnePermissions = value; } - } + /// + /// + /// + public uint EveryOnePermissions; + + /// + /// + /// + public uint GroupPermissions; - public uint GroupPermissions - { - get { return _groupPermissions; } - set { _groupPermissions = value; } - } + /// + /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) + /// + public int AssetType; - public int AssetType - { - get { return _assetType; } - set { _assetType = value; } - } + /// + /// The UUID of the associated asset on the asset server + /// + public UUID AssetID; - public UUID AssetID - { - get { return _assetID; } - set { _assetID = value; } - } + /// + /// + /// + public UUID GroupID; - public UUID GroupID - { - get { return _groupID; } - set { _groupID = value; } - } + /// + /// + /// + public bool GroupOwned; - public bool GroupOwned - { - get { return _groupOwned; } - set { _groupOwned = value; } - } + /// + /// + /// + public int SalePrice; - public int SalePrice - { - get { return _salePrice; } - set { _salePrice = value; } - } + /// + /// + /// + public byte SaleType; - public byte SaleType - { - get { return _saleType; } - set { _saleType = value; } - } + /// + /// + /// + public uint Flags; - public uint Flags - { - get { return _flags; } - set { _flags = value; } - } - - public int CreationDate - { - get { return _creationDate; } - set { _creationDate = value; } - } + /// + /// + /// + public int CreationDate; public InventoryItemBase() { - _creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; + CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; } } } diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs index cf9a24001a..99c0f610d6 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs @@ -325,16 +325,13 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender } - // Cache Decoded layers lock (m_cacheddecode) { if (!m_cacheddecode.ContainsKey(AssetId)) m_cacheddecode.Add(AssetId, layers); - } - - + } // Notify Interested Parties lock (m_notifyList) @@ -371,7 +368,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender { Createj2KCacheFolder(pFolder); } - } /// diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs index 833b64a2eb..9c45fd2170 100644 --- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveWriteRequest.cs @@ -126,11 +126,9 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver string filename = string.Format("{0}{1}_{2}.xml", path, inventoryItem.Name, inventoryItem.ID); string serialization = UserInventoryItemSerializer.Serialize(inventoryItem); m_archive.WriteFile(filename, serialization); - - UUID creatorId = inventoryItem.CreatorIdAsUuid; - // Record the creator of this item - m_userUuids[creatorId] = 1; + // Record the creator of this item for user record purposes (which might go away soon) + m_userUuids[inventoryItem.CreatorIdAsUuid] = 1; m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (AssetType)inventoryItem.AssetType, m_assetUuids); }