From f3c7298fc5bdb35e8a293c9aee4134c8e8fe2856 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 8 Apr 2009 17:50:57 +0000
Subject: * Make it possible to store creator strings in user inventory items
as well as UUIDs * All existing functionality should be unaffected. *
Database schemas have not been changed.
---
.../Communications/Cache/LibraryRootFolder.cs | 4 +--
.../Framework/Communications/Capabilities/Caps.cs | 4 +--
OpenSim/Framework/InventoryItemBase.cs | 33 +++++++++++++++++++---
3 files changed, 33 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Framework')
diff --git a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
index 93f126f..ec62ed2 100644
--- a/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
+++ b/OpenSim/Framework/Communications/Cache/LibraryRootFolder.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Framework.Communications.Cache
{
InventoryItemBase item = new InventoryItemBase();
item.Owner = libOwner;
- item.Creator = libOwner;
+ item.CreatorId = libOwner.ToString();
item.ID = inventoryID;
item.AssetID = assetID;
item.Description = description;
@@ -159,7 +159,7 @@ namespace OpenSim.Framework.Communications.Cache
{
InventoryItemBase item = new InventoryItemBase();
item.Owner = libOwner;
- item.Creator = libOwner;
+ item.CreatorId = libOwner.ToString();
item.ID = new UUID(config.GetString("inventoryID", ID.ToString()));
item.AssetID = new UUID(config.GetString("assetID", item.ID.ToString()));
item.Folder = new UUID(config.GetString("folderID", ID.ToString()));
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs
index 1423e3a..a2e8042 100644
--- a/OpenSim/Framework/Communications/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs
@@ -440,7 +440,7 @@ namespace OpenSim.Framework.Communications.Capabilities
llsdItem.type = Enum.GetName(typeof(AssetType), invItem.AssetType).ToLower();
llsdItem.inv_type = Enum.GetName(typeof(InventoryType), invItem.InvType).ToLower();
llsdItem.permissions = new LLSDPermissions();
- llsdItem.permissions.creator_id = invItem.Creator;
+ llsdItem.permissions.creator_id = invItem.CreatorIdAsUuid;
llsdItem.permissions.base_mask = (int)invItem.CurrentPermissions;
llsdItem.permissions.everyone_mask = (int)invItem.EveryOnePermissions;
llsdItem.permissions.group_id = UUID.Zero;
@@ -789,7 +789,7 @@ namespace OpenSim.Framework.Communications.Capabilities
InventoryItemBase item = new InventoryItemBase();
item.Owner = m_agentID;
- item.Creator = m_agentID;
+ item.CreatorId = m_agentID.ToString();
item.ID = inventoryItem;
item.AssetID = asset.FullID;
item.Description = assetDescription;
diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs
index 21683c4..ae3777c 100644
--- a/OpenSim/Framework/InventoryItemBase.cs
+++ b/OpenSim/Framework/InventoryItemBase.cs
@@ -53,8 +53,16 @@ namespace OpenSim.Framework
///
/// The creator of this item
///
- private UUID _creator;
+ private string m_creatorId = String.Empty;
+
+ ///
+ /// The creator of this item expressed as a UUID
+ ///
+ private UUID m_creatorIdAsUuid = UUID.Zero;
+ ///
+ ///
+ ///
private uint _nextPermissions;
///
@@ -129,10 +137,27 @@ namespace OpenSim.Framework
set { _folder = value; }
}
- public UUID Creator
+ ///
+ /// 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 _creator; }
- set { _creator = value; }
+ get { return m_creatorIdAsUuid; }
}
public string Description
--
cgit v1.1