From 509ec2637bd178c270106725297da7f6a1180096 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Mon, 4 May 2009 15:02:14 +0000
Subject: * Refactor: Simplify InventoryFolderImpl. No functional change.
---
.../Communications/Cache/InventoryFolderImpl.cs | 4 +-
OpenSim/Framework/InventoryItemBase.cs | 231 ++++++---------------
.../Agent/TextureSender/J2KDecoderModule.cs | 6 +-
.../Archiver/InventoryArchiveWriteRequest.cs | 6 +-
4 files changed, 68 insertions(+), 179 deletions(-)
diff --git a/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs b/OpenSim/Framework/Communications/Cache/InventoryFolderImpl.cs
index a625c7e..bc8437c 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 ae3777c..ce3dc63 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -34,219 +34,114 @@ 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;
+ /// The inventory type of the item. This is slightly different from the asset type in some situations.
+ ///
+ public int InvType;
///
- ///
- ///
- private uint _basePermissions;
+ /// The folder this item is contained in
+ ///
+ public UUID Folder;
- ///
+ ///
/// The creator of this item
- ///
- private string m_creatorId = String.Empty;
+ ///
+ public string CreatorId
+ {
+ get { return m_creatorId; }
+ set
+ {
+ m_creatorId = value;
+ UUID creatorIdAsUuid;
+
+ // For now, all IDs are UUIDs
+ UUID.TryParse(m_creatorId, out creatorIdAsUuid);
+ CreatorIdAsUuid = creatorIdAsUuid;
+ }
+ }
+
+ private string m_creatorId = String.Empty;
- ///
+ ///
/// The creator of this item expressed as a UUID
- ///
- private UUID m_creatorIdAsUuid = UUID.Zero;
+ ///
+ public UUID CreatorIdAsUuid { get; private set; }
///
+ /// The description of the inventory item (must be less than 64 characters)
+ ///
+ public string Description = String.Empty;
+
+ ///
///
- ///
- private uint _nextPermissions;
+ ///
+ public uint NextPermissions;
///
/// A mask containing permissions for the current owner (cannot be enforced)
- ///
- private uint _currentPermissions;
+ ///
+ public uint CurrentPermissions;
///
- /// The description of the inventory item (must be less than 64 characters)
- ///
- private string _description = string.Empty;
+ ///
+ ///
+ public uint BasePermissions;
///
///
- ///
- private uint _everyOnePermissions;
-
+ ///
+ public uint EveryOnePermissions;
+
///
///
- ///
- private uint _groupPermissions;
+ ///
+ public uint GroupPermissions;
///
- /// The folder this item is contained in
- ///
- private UUID _folder;
+ /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
+ ///
+ public int AssetType;
///
- /// The inventory type of the item. This is slightly different from the asset type in some situations.
- ///
- private int _invType;
+ /// The UUID of the associated asset on the asset server
+ ///
+ public UUID AssetID;
///
///
- ///
- private UUID _groupID;
+ ///
+ public UUID GroupID;
///
///
- ///
- private bool _groupOwned;
+ ///
+ public bool GroupOwned;
///
///
- ///
- private int _salePrice;
+ ///
+ public int SalePrice;
///
///
- ///
- private byte _saleType;
+ ///
+ public byte SaleType;
///
///
- ///
- private uint _flags;
+ ///
+ public uint Flags;
///
///
- ///
- private int _creationDate;
-
- public int InvType
- {
- get { return _invType; }
- set { _invType = value; }
- }
-
- public UUID Folder
- {
- get { return _folder; }
- set { _folder = value; }
- }
-
- ///
- /// The creator ID
- ///
- public string CreatorId
- {
- get { return m_creatorId; }
- set
- {
- m_creatorId = value;
-
- // For now, all IDs are UUIDs
- UUID.TryParse(m_creatorId, out m_creatorIdAsUuid);
- }
- }
-
- ///
- /// The creator ID expressed as a UUID
- ///
- public UUID CreatorIdAsUuid
- {
- get { return m_creatorIdAsUuid; }
- }
-
- public string Description
- {
- get { return _description; }
- set { _description = value; }
- }
-
- public uint NextPermissions
- {
- get { return _nextPermissions; }
- set { _nextPermissions = value; }
- }
-
- public uint CurrentPermissions
- {
- get { return _currentPermissions; }
- set { _currentPermissions = value; }
- }
-
- public uint BasePermissions
- {
- get { return _basePermissions; }
- set { _basePermissions = value; }
- }
-
- public uint EveryOnePermissions
- {
- get { return _everyOnePermissions; }
- set { _everyOnePermissions = value; }
- }
-
- public uint GroupPermissions
- {
- get { return _groupPermissions; }
- set { _groupPermissions = value; }
- }
-
- public int AssetType
- {
- get { return _assetType; }
- set { _assetType = value; }
- }
-
- public UUID AssetID
- {
- get { return _assetID; }
- set { _assetID = value; }
- }
-
- public UUID GroupID
- {
- get { return _groupID; }
- set { _groupID = value; }
- }
-
- public bool GroupOwned
- {
- get { return _groupOwned; }
- set { _groupOwned = value; }
- }
-
- public int SalePrice
- {
- get { return _salePrice; }
- set { _salePrice = value; }
- }
-
- public byte SaleType
- {
- get { return _saleType; }
- set { _saleType = value; }
- }
-
- 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 cf9a240..99c0f61 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 833b64a..9c45fd2 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);
}
--
cgit v1.1