* Refactor: Simplify InventoryFolderImpl. No functional change.

0.6.5-rc1
Justin Clarke Casey 2009-05-04 15:02:14 +00:00
parent 36dd346a91
commit 509ec2637b
4 changed files with 76 additions and 187 deletions

View File

@ -396,7 +396,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
/// <summary> /// <summary>
/// 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.
/// </summary> /// </summary>
public List<InventoryItemBase> RequestListOfItems() public List<InventoryItemBase> RequestListOfItems()
{ {
@ -416,7 +416,7 @@ namespace OpenSim.Framework.Communications.Cache
} }
/// <summary> /// <summary>
/// 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.
/// </summary> /// </summary>
public List<InventoryFolderBase> RequestListOfFolders() public List<InventoryFolderBase> RequestListOfFolders()
{ {

View File

@ -36,109 +36,17 @@ namespace OpenSim.Framework
public class InventoryItemBase : InventoryNodeBase public class InventoryItemBase : InventoryNodeBase
{ {
/// <summary> /// <summary>
/// The UUID of the associated asset on the asset server /// The inventory type of the item. This is slightly different from the asset type in some situations.
/// </summary> /// </summary>
private UUID _assetID; public int InvType;
/// <summary>
/// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
/// </summary>
private int _assetType;
/// <summary>
///
/// </summary>
private uint _basePermissions;
/// <summary>
/// The creator of this item
/// </summary>
private string m_creatorId = String.Empty;
/// <summary>
/// The creator of this item expressed as a UUID
/// </summary>
private UUID m_creatorIdAsUuid = UUID.Zero;
/// <summary>
///
/// </summary>
private uint _nextPermissions;
/// <summary>
/// A mask containing permissions for the current owner (cannot be enforced)
/// </summary>
private uint _currentPermissions;
/// <summary>
/// The description of the inventory item (must be less than 64 characters)
/// </summary>
private string _description = string.Empty;
/// <summary>
///
/// </summary>
private uint _everyOnePermissions;
/// <summary>
///
/// </summary>
private uint _groupPermissions;
/// <summary> /// <summary>
/// The folder this item is contained in /// The folder this item is contained in
/// </summary> /// </summary>
private UUID _folder; public UUID Folder;
/// <summary>
/// The inventory type of the item. This is slightly different from the asset type in some situations.
/// </summary>
private int _invType;
/// <summary>
///
/// </summary>
private UUID _groupID;
/// <summary>
///
/// </summary>
private bool _groupOwned;
/// <summary>
///
/// </summary>
private int _salePrice;
/// <summary>
///
/// </summary>
private byte _saleType;
/// <summary>
///
/// </summary>
private uint _flags;
/// <summary>
///
/// </summary>
private int _creationDate;
public int InvType
{
get { return _invType; }
set { _invType = value; }
}
public UUID Folder
{
get { return _folder; }
set { _folder = value; }
}
/// <value> /// <value>
/// The creator ID /// The creator of this item
/// </value> /// </value>
public string CreatorId public string CreatorId
{ {
@ -146,107 +54,94 @@ namespace OpenSim.Framework
set set
{ {
m_creatorId = value; m_creatorId = value;
UUID creatorIdAsUuid;
// For now, all IDs are UUIDs // 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;
/// <value> /// <value>
/// The creator ID expressed as a UUID /// The creator of this item expressed as a UUID
/// </value> /// </value>
public UUID CreatorIdAsUuid public UUID CreatorIdAsUuid { get; private set; }
{
get { return m_creatorIdAsUuid; }
}
public string Description /// <summary>
{ /// The description of the inventory item (must be less than 64 characters)
get { return _description; } /// </summary>
set { _description = value; } public string Description = String.Empty;
}
public uint NextPermissions /// <value>
{ ///
get { return _nextPermissions; } /// </value>
set { _nextPermissions = value; } public uint NextPermissions;
}
public uint CurrentPermissions /// <summary>
{ /// A mask containing permissions for the current owner (cannot be enforced)
get { return _currentPermissions; } /// </summary>
set { _currentPermissions = value; } public uint CurrentPermissions;
}
public uint BasePermissions /// <summary>
{ ///
get { return _basePermissions; } /// </summary>
set { _basePermissions = value; } public uint BasePermissions;
}
public uint EveryOnePermissions /// <summary>
{ ///
get { return _everyOnePermissions; } /// </summary>
set { _everyOnePermissions = value; } public uint EveryOnePermissions;
}
public uint GroupPermissions /// <summary>
{ ///
get { return _groupPermissions; } /// </summary>
set { _groupPermissions = value; } public uint GroupPermissions;
}
public int AssetType /// <summary>
{ /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc)
get { return _assetType; } /// </summary>
set { _assetType = value; } public int AssetType;
}
public UUID AssetID /// <summary>
{ /// The UUID of the associated asset on the asset server
get { return _assetID; } /// </summary>
set { _assetID = value; } public UUID AssetID;
}
public UUID GroupID /// <summary>
{ ///
get { return _groupID; } /// </summary>
set { _groupID = value; } public UUID GroupID;
}
public bool GroupOwned /// <summary>
{ ///
get { return _groupOwned; } /// </summary>
set { _groupOwned = value; } public bool GroupOwned;
}
public int SalePrice /// <summary>
{ ///
get { return _salePrice; } /// </summary>
set { _salePrice = value; } public int SalePrice;
}
public byte SaleType /// <summary>
{ ///
get { return _saleType; } /// </summary>
set { _saleType = value; } public byte SaleType;
}
public uint Flags /// <summary>
{ ///
get { return _flags; } /// </summary>
set { _flags = value; } public uint Flags;
}
public int CreationDate /// <summary>
{ ///
get { return _creationDate; } /// </summary>
set { _creationDate = value; } public int CreationDate;
}
public InventoryItemBase() public InventoryItemBase()
{ {
_creationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds; CreationDate = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
} }
} }
} }

View File

@ -325,7 +325,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
} }
// Cache Decoded layers // Cache Decoded layers
lock (m_cacheddecode) lock (m_cacheddecode)
{ {
@ -334,8 +333,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
} }
// Notify Interested Parties // Notify Interested Parties
lock (m_notifyList) lock (m_notifyList)
{ {
@ -371,7 +368,6 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
{ {
Createj2KCacheFolder(pFolder); Createj2KCacheFolder(pFolder);
} }
} }
/// <summary> /// <summary>

View File

@ -127,10 +127,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
string serialization = UserInventoryItemSerializer.Serialize(inventoryItem); string serialization = UserInventoryItemSerializer.Serialize(inventoryItem);
m_archive.WriteFile(filename, serialization); m_archive.WriteFile(filename, serialization);
UUID creatorId = inventoryItem.CreatorIdAsUuid; // Record the creator of this item for user record purposes (which might go away soon)
m_userUuids[inventoryItem.CreatorIdAsUuid] = 1;
// Record the creator of this item
m_userUuids[creatorId] = 1;
m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (AssetType)inventoryItem.AssetType, m_assetUuids); m_assetGatherer.GatherAssetUuids(inventoryItem.AssetID, (AssetType)inventoryItem.AssetType, m_assetUuids);
} }