From 7665aad002ef066fc31fa9497225d2668641c769 Mon Sep 17 00:00:00 2001
From: John Hurliman
Date: Mon, 22 Feb 2010 13:27:17 -0800
Subject: * 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
---
.../CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | 2 +-
.../Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs | 2 +-
.../Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs | 2 +-
.../CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | 2 +-
.../Framework/InventoryAccess/InventoryAccessModule.cs | 9 +++++----
.../CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs | 3 ++-
OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs | 2 +-
OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs | 2 +-
.../Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs | 2 +-
OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs | 3 ++-
10 files changed, 16 insertions(+), 13 deletions(-)
(limited to 'OpenSim/Region/CoreModules')
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
index ebe93d5..1320b33 100644
--- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
+++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs
@@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction
bool storeLocal, bool tempFile)
{
ourClient = remoteClient;
- m_asset = new AssetBase(assetID, "blank", type);
+ m_asset = new AssetBase(assetID, "blank", type, remoteClient.AgentId);
m_asset.Data = data;
m_asset.Description = "empty";
m_asset.Local = storeLocal;
diff --git a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
index 7ac8bed..a23e8ce 100644
--- a/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
+++ b/OpenSim/Region/CoreModules/Agent/TextureSender/J2KDecoderModule.cs
@@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureSender
{
string assetID = "j2kCache_" + AssetId.ToString();
- AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard);
+ AssetBase layerDecodeAsset = new AssetBase(assetID, assetID, (sbyte)AssetType.Notecard, m_scene.RegionInfo.RegionID);
layerDecodeAsset.Local = true;
layerDecodeAsset.Temporary = true;
diff --git a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
index 65ad703..5756d35 100644
--- a/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Inventory/Archiver/InventoryArchiveReadRequest.cs
@@ -416,7 +416,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Inventory.Archiver
//m_log.DebugFormat("[INVENTORY ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
- AssetBase asset = new AssetBase(new UUID(uuid), "RandomName", assetType);
+ AssetBase asset = new AssetBase(new UUID(uuid), "RandomName", assetType, UUID.Zero);
asset.Data = data;
m_scene.AssetService.Store(asset);
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index e303a1f..664f38d 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
// HGAssetService dispatches it to the remote grid.
// It's not pretty, but the best that can be done while
// not having a global naming infrastructure
- AssetBase asset1 = new AssetBase(asset.FullID, asset.Name, asset.Type);
+ AssetBase asset1 = new AssetBase(asset.FullID, asset.Name, asset.Type, asset.Metadata.CreatorID);
Copy(asset, asset1);
try
{
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index d242a34..eec852e 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -161,7 +161,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
}
AssetBase asset =
- CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data);
+ CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data, remoteClient.AgentId);
item.AssetID = asset.FullID;
m_Scene.AssetService.Store(asset);
@@ -339,7 +339,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
objectGroup.GetPartName(objectGroup.RootPart.LocalId),
objectGroup.GetPartDescription(objectGroup.RootPart.LocalId),
(sbyte)AssetType.Object,
- Utils.StringToBytes(sceneObjectXml));
+ Utils.StringToBytes(sceneObjectXml),
+ objectGroup.OwnerID);
m_Scene.AssetService.Store(asset);
assetID = asset.FullID;
@@ -640,9 +641,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
///
///
///
- private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data)
+ private AssetBase CreateAsset(string name, string description, sbyte assetType, byte[] data, UUID creatorID)
{
- AssetBase asset = new AssetBase(UUID.Random(), name, assetType);
+ AssetBase asset = new AssetBase(UUID.Random(), name, assetType, creatorID);
asset.Description = description;
asset.Data = (data == null) ? new byte[1] : data;
diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
index e3c7bbf..367068e 100644
--- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs
@@ -309,7 +309,8 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture
}
// Create a new asset for user
- AssetBase asset = new AssetBase(UUID.Random(), "DynamicImage" + Util.RandomClass.Next(1, 10000), (sbyte)AssetType.Texture);
+ AssetBase asset = new AssetBase(UUID.Random(), "DynamicImage" + Util.RandomClass.Next(1, 10000), (sbyte)AssetType.Texture,
+ scene.RegionInfo.RegionID);
asset.Data = assetData;
asset.Description = String.Format("URL image : {0}", Url);
asset.Local = false;
diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
index 59a1b8f..c4b1817 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs
@@ -335,7 +335,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
//m_log.DebugFormat("[ARCHIVER]: Importing asset {0}, type {1}", uuid, assetType);
- AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType);
+ AssetBase asset = new AssetBase(new UUID(uuid), String.Empty, assetType, UUID.Zero);
asset.Data = data;
// We're relying on the asset service to do the sensible thing and not store the asset if it already
diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
index 2d2c570..8601cae 100644
--- a/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
+++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsDearchiver.cs
@@ -158,7 +158,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver
m_log.DebugFormat("[ARCHIVER]: Importing asset {0}", filename);
- AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType);
+ AssetBase asset = new AssetBase(new UUID(filename), metadata.Name, metadata.AssetType, UUID.Zero);
asset.Description = metadata.Description;
asset.Data = data;
diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs
index 2ff635b..d10d4d6 100644
--- a/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs
+++ b/OpenSim/Region/CoreModules/World/Estate/EstateTerrainXferHandler.cs
@@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate
public EstateTerrainXferHandler(IClientAPI pRemoteClient, string pClientFilename)
{
- m_asset = new AssetBase(UUID.Zero, pClientFilename, type);
+ m_asset = new AssetBase(UUID.Zero, pClientFilename, type, pRemoteClient.AgentId);
m_asset.Data = new byte[0];
m_asset.Description = "empty";
m_asset.Local = true;
diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
index 44a651f..6ae75a8 100644
--- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
+++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs
@@ -1080,7 +1080,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap
AssetBase asset = new AssetBase(
m_scene.RegionInfo.RegionSettings.TerrainImageID,
"terrainImage_" + m_scene.RegionInfo.RegionID.ToString() + "_" + lastMapRefresh.ToString(),
- (sbyte)AssetType.Texture);
+ (sbyte)AssetType.Texture,
+ m_scene.RegionInfo.RegionID);
asset.Data = data;
asset.Description = m_scene.RegionInfo.RegionName;
asset.Temporary = temporary;
--
cgit v1.1