mirror of
https://github.com/opensim/opensim.git
synced 2026-08-12 04:05:42 +08:00
* 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
This commit is contained in:
@@ -61,7 +61,7 @@ namespace OpenSim.Framework
|
||||
m_metadata.Type = (sbyte)AssetType.Unknown;
|
||||
}
|
||||
|
||||
public AssetBase(UUID assetID, string name, sbyte assetType)
|
||||
public AssetBase(UUID assetID, string name, sbyte assetType, UUID creatorID)
|
||||
{
|
||||
if (assetType == (sbyte)AssetType.Unknown)
|
||||
{
|
||||
@@ -76,7 +76,7 @@ namespace OpenSim.Framework
|
||||
m_metadata.Type = assetType;
|
||||
}
|
||||
|
||||
public AssetBase(string assetID, string name, sbyte assetType)
|
||||
public AssetBase(string assetID, string name, sbyte assetType, UUID creatorID)
|
||||
{
|
||||
if (assetType == (sbyte)AssetType.Unknown)
|
||||
{
|
||||
@@ -220,7 +220,6 @@ namespace OpenSim.Framework
|
||||
public class AssetMetadata
|
||||
{
|
||||
private UUID m_fullid;
|
||||
// m_id added as a dirty hack to transition from FullID to ID
|
||||
private string m_id;
|
||||
private string m_name = String.Empty;
|
||||
private string m_description = String.Empty;
|
||||
@@ -230,8 +229,7 @@ namespace OpenSim.Framework
|
||||
private byte[] m_sha1;
|
||||
private bool m_local;
|
||||
private bool m_temporary;
|
||||
//private Dictionary<string, Uri> m_methods = new Dictionary<string, Uri>();
|
||||
//private OSDMap m_extra_data;
|
||||
private UUID m_creatorid;
|
||||
|
||||
public UUID FullID
|
||||
{
|
||||
@@ -324,16 +322,10 @@ namespace OpenSim.Framework
|
||||
set { m_temporary = value; }
|
||||
}
|
||||
|
||||
//public Dictionary<string, Uri> Methods
|
||||
//{
|
||||
// get { return m_methods; }
|
||||
// set { m_methods = value; }
|
||||
//}
|
||||
|
||||
//public OSDMap ExtraData
|
||||
//{
|
||||
// get { return m_extra_data; }
|
||||
// set { m_extra_data = value; }
|
||||
//}
|
||||
public UUID CreatorID
|
||||
{
|
||||
get { return m_creatorid; }
|
||||
set { m_creatorid = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenSim.Framework
|
||||
public int Version;
|
||||
|
||||
public AssetLandmark(AssetBase a)
|
||||
: base(a.FullID, a.Name, a.Type)
|
||||
: base(a.FullID, a.Name, a.Type, a.Metadata.CreatorID)
|
||||
{
|
||||
Data = a.Data;
|
||||
Description = a.Description;
|
||||
|
||||
@@ -41,11 +41,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
|
||||
{
|
||||
public class AssetLoaderFileSystem : IAssetLoader
|
||||
{
|
||||
private static readonly UUID LIBRARY_OWNER_ID = new UUID("11111111-1111-0000-0000-000100bba000");
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
|
||||
protected static AssetBase CreateAsset(string assetIdStr, string name, string path, sbyte type)
|
||||
{
|
||||
AssetBase asset = new AssetBase(new UUID(assetIdStr), name, type);
|
||||
AssetBase asset = new AssetBase(new UUID(assetIdStr), name, type, LIBRARY_OWNER_ID);
|
||||
|
||||
if (!String.IsNullOrEmpty(path))
|
||||
{
|
||||
|
||||
@@ -888,7 +888,7 @@ namespace OpenSim.Framework.Capabilities
|
||||
}
|
||||
|
||||
AssetBase asset;
|
||||
asset = new AssetBase(assetID, assetName, assType);
|
||||
asset = new AssetBase(assetID, assetName, assType, m_agentID);
|
||||
asset.Data = data;
|
||||
if (AddNewAsset != null)
|
||||
AddNewAsset(asset);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace OpenSim.Framework.Tests
|
||||
|
||||
private void CheckContainsReferences(AssetType assetType, bool expected)
|
||||
{
|
||||
AssetBase asset = new AssetBase(UUID.Zero, String.Empty, (sbyte)assetType);
|
||||
AssetBase asset = new AssetBase(UUID.Zero, String.Empty, (sbyte)assetType, UUID.Zero);
|
||||
bool actual = asset.ContainsReferences;
|
||||
Assert.AreEqual(expected, actual, "Expected "+assetType+".ContainsReferences to be "+expected+" but was "+actual+".");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user