aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
authorJohn Hurliman2010-02-22 13:27:17 -0800
committerJohn Hurliman2010-02-22 13:27:17 -0800
commit7665aad002ef066fc31fa9497225d2668641c769 (patch)
treece2ad89f1ffd20c6f5e9a3b6558f7b90c651c830 /OpenSim/Framework
parent* Added a sanity check for missing asset data in LLClientView (diff)
downloadopensim-SC-7665aad002ef066fc31fa9497225d2668641c769.zip
opensim-SC-7665aad002ef066fc31fa9497225d2668641c769.tar.gz
opensim-SC-7665aad002ef066fc31fa9497225d2668641c769.tar.bz2
opensim-SC-7665aad002ef066fc31fa9497225d2668641c769.tar.xz
* Adds CreatorID to asset metadata. This is just the plumbing to support CreatorID, it doesn't modify database backends or OAR files to support storing/loading it
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AssetBase.cs24
-rw-r--r--OpenSim/Framework/AssetLandmark.cs2
-rw-r--r--OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs3
-rw-r--r--OpenSim/Framework/Capabilities/Caps.cs2
-rw-r--r--OpenSim/Framework/Tests/AssetBaseTest.cs2
5 files changed, 13 insertions, 20 deletions
diff --git a/OpenSim/Framework/AssetBase.cs b/OpenSim/Framework/AssetBase.cs
index 3e64e47..f21a9b5 100644
--- a/OpenSim/Framework/AssetBase.cs
+++ b/OpenSim/Framework/AssetBase.cs
@@ -61,7 +61,7 @@ namespace OpenSim.Framework
61 m_metadata.Type = (sbyte)AssetType.Unknown; 61 m_metadata.Type = (sbyte)AssetType.Unknown;
62 } 62 }
63 63
64 public AssetBase(UUID assetID, string name, sbyte assetType) 64 public AssetBase(UUID assetID, string name, sbyte assetType, UUID creatorID)
65 { 65 {
66 if (assetType == (sbyte)AssetType.Unknown) 66 if (assetType == (sbyte)AssetType.Unknown)
67 { 67 {
@@ -76,7 +76,7 @@ namespace OpenSim.Framework
76 m_metadata.Type = assetType; 76 m_metadata.Type = assetType;
77 } 77 }
78 78
79 public AssetBase(string assetID, string name, sbyte assetType) 79 public AssetBase(string assetID, string name, sbyte assetType, UUID creatorID)
80 { 80 {
81 if (assetType == (sbyte)AssetType.Unknown) 81 if (assetType == (sbyte)AssetType.Unknown)
82 { 82 {
@@ -220,7 +220,6 @@ namespace OpenSim.Framework
220 public class AssetMetadata 220 public class AssetMetadata
221 { 221 {
222 private UUID m_fullid; 222 private UUID m_fullid;
223 // m_id added as a dirty hack to transition from FullID to ID
224 private string m_id; 223 private string m_id;
225 private string m_name = String.Empty; 224 private string m_name = String.Empty;
226 private string m_description = String.Empty; 225 private string m_description = String.Empty;
@@ -230,8 +229,7 @@ namespace OpenSim.Framework
230 private byte[] m_sha1; 229 private byte[] m_sha1;
231 private bool m_local; 230 private bool m_local;
232 private bool m_temporary; 231 private bool m_temporary;
233 //private Dictionary<string, Uri> m_methods = new Dictionary<string, Uri>(); 232 private UUID m_creatorid;
234 //private OSDMap m_extra_data;
235 233
236 public UUID FullID 234 public UUID FullID
237 { 235 {
@@ -324,16 +322,10 @@ namespace OpenSim.Framework
324 set { m_temporary = value; } 322 set { m_temporary = value; }
325 } 323 }
326 324
327 //public Dictionary<string, Uri> Methods 325 public UUID CreatorID
328 //{ 326 {
329 // get { return m_methods; } 327 get { return m_creatorid; }
330 // set { m_methods = value; } 328 set { m_creatorid = value; }
331 //} 329 }
332
333 //public OSDMap ExtraData
334 //{
335 // get { return m_extra_data; }
336 // set { m_extra_data = value; }
337 //}
338 } 330 }
339} 331}
diff --git a/OpenSim/Framework/AssetLandmark.cs b/OpenSim/Framework/AssetLandmark.cs
index 058b442..7806c1f 100644
--- a/OpenSim/Framework/AssetLandmark.cs
+++ b/OpenSim/Framework/AssetLandmark.cs
@@ -38,7 +38,7 @@ namespace OpenSim.Framework
38 public int Version; 38 public int Version;
39 39
40 public AssetLandmark(AssetBase a) 40 public AssetLandmark(AssetBase a)
41 : base(a.FullID, a.Name, a.Type) 41 : base(a.FullID, a.Name, a.Type, a.Metadata.CreatorID)
42 { 42 {
43 Data = a.Data; 43 Data = a.Data;
44 Description = a.Description; 44 Description = a.Description;
diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
index 6ab1b58..458dfdc 100644
--- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
+++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs
@@ -41,11 +41,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
41{ 41{
42 public class AssetLoaderFileSystem : IAssetLoader 42 public class AssetLoaderFileSystem : IAssetLoader
43 { 43 {
44 private static readonly UUID LIBRARY_OWNER_ID = new UUID("11111111-1111-0000-0000-000100bba000");
44 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
45 46
46 protected static AssetBase CreateAsset(string assetIdStr, string name, string path, sbyte type) 47 protected static AssetBase CreateAsset(string assetIdStr, string name, string path, sbyte type)
47 { 48 {
48 AssetBase asset = new AssetBase(new UUID(assetIdStr), name, type); 49 AssetBase asset = new AssetBase(new UUID(assetIdStr), name, type, LIBRARY_OWNER_ID);
49 50
50 if (!String.IsNullOrEmpty(path)) 51 if (!String.IsNullOrEmpty(path))
51 { 52 {
diff --git a/OpenSim/Framework/Capabilities/Caps.cs b/OpenSim/Framework/Capabilities/Caps.cs
index 74c6ab0..323c94c 100644
--- a/OpenSim/Framework/Capabilities/Caps.cs
+++ b/OpenSim/Framework/Capabilities/Caps.cs
@@ -888,7 +888,7 @@ namespace OpenSim.Framework.Capabilities
888 } 888 }
889 889
890 AssetBase asset; 890 AssetBase asset;
891 asset = new AssetBase(assetID, assetName, assType); 891 asset = new AssetBase(assetID, assetName, assType, m_agentID);
892 asset.Data = data; 892 asset.Data = data;
893 if (AddNewAsset != null) 893 if (AddNewAsset != null)
894 AddNewAsset(asset); 894 AddNewAsset(asset);
diff --git a/OpenSim/Framework/Tests/AssetBaseTest.cs b/OpenSim/Framework/Tests/AssetBaseTest.cs
index 18a3e01..0f22600 100644
--- a/OpenSim/Framework/Tests/AssetBaseTest.cs
+++ b/OpenSim/Framework/Tests/AssetBaseTest.cs
@@ -67,7 +67,7 @@ namespace OpenSim.Framework.Tests
67 67
68 private void CheckContainsReferences(AssetType assetType, bool expected) 68 private void CheckContainsReferences(AssetType assetType, bool expected)
69 { 69 {
70 AssetBase asset = new AssetBase(UUID.Zero, String.Empty, (sbyte)assetType); 70 AssetBase asset = new AssetBase(UUID.Zero, String.Empty, (sbyte)assetType, UUID.Zero);
71 bool actual = asset.ContainsReferences; 71 bool actual = asset.ContainsReferences;
72 Assert.AreEqual(expected, actual, "Expected "+assetType+".ContainsReferences to be "+expected+" but was "+actual+"."); 72 Assert.AreEqual(expected, actual, "Expected "+assetType+".ContainsReferences to be "+expected+" but was "+actual+".");
73 } 73 }