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 --- .../Scenes/Animation/ScenePresenceAnimator.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | 24 ++++++++++------------ OpenSim/Region/Framework/Scenes/Scene.cs | 3 ++- .../Framework/Scenes/Tests/UuidGathererTests.cs | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 712dcc7..1eef8d0 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -384,7 +384,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation } } - AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation); + AssetBase Animasset = new AssetBase(UUID.Random(), "Random Animation", (sbyte)AssetType.Animation, m_scenePresence.UUID); Animasset.Data = anim.ToBytes(); Animasset.Temporary = true; Animasset.Local = true; diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index ded001b..7928811 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs @@ -192,7 +192,7 @@ namespace OpenSim.Region.Framework.Scenes return new ArrayList(); } - AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data); + AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)AssetType.LSLText, data, remoteClient.AgentId); AssetService.Store(asset); if (isScriptRunning) @@ -570,15 +570,9 @@ namespace OpenSim.Region.Framework.Scenes /// /// Create a new asset data structure. /// - /// - /// - /// - /// - /// - /// - 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; @@ -704,7 +698,7 @@ namespace OpenSim.Region.Framework.Scenes data = Encoding.ASCII.GetBytes(strdata); } - AssetBase asset = CreateAsset(name, description, assetType, data); + AssetBase asset = CreateAsset(name, description, assetType, data, remoteClient.AgentId); AssetService.Store(asset); CreateNewInventoryItem(remoteClient, remoteClient.AgentId.ToString(), folderID, asset.Name, 0, callbackID, asset, invType, nextOwnerMask, creationDate); @@ -1289,7 +1283,9 @@ namespace OpenSim.Region.Framework.Scenes itemBase.InvType, part.UUID, remoteClient.AgentId)) return; - AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}")); + AssetBase asset = CreateAsset(itemBase.Name, itemBase.Description, (sbyte)itemBase.AssetType, + Encoding.ASCII.GetBytes("default\n{\n state_entry()\n {\n llSay(0, \"Script running\");\n }\n}"), + remoteClient.AgentId); AssetService.Store(asset); TaskInventoryItem taskItem = new TaskInventoryItem(); @@ -1583,7 +1579,8 @@ namespace OpenSim.Region.Framework.Scenes objectGroup.GetPartName(objectGroup.LocalId), objectGroup.GetPartDescription(objectGroup.LocalId), (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml), + remoteClient.AgentId); AssetService.Store(asset); item.AssetID = asset.FullID; @@ -1630,7 +1627,8 @@ namespace OpenSim.Region.Framework.Scenes grp.GetPartName(grp.LocalId), grp.GetPartDescription(grp.LocalId), (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml), + remoteClient.AgentId); AssetService.Store(asset); InventoryItemBase item = new InventoryItemBase(); diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 72ece10..d5ceda8 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4389,7 +4389,8 @@ namespace OpenSim.Region.Framework.Scenes group.GetPartName(localID), group.GetPartDescription(localID), (sbyte)AssetType.Object, - Utils.StringToBytes(sceneObjectXml)); + Utils.StringToBytes(sceneObjectXml), + group.OwnerID); AssetService.Store(asset); InventoryItemBase item = new InventoryItemBase(); diff --git a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs index a36c4db..6686264 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/UuidGathererTests.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestHelper.InMethod(); UUID corruptAssetUuid = UUID.Parse("00000000-0000-0000-0000-000000000666"); - AssetBase corruptAsset = AssetHelpers.CreateAsset(corruptAssetUuid, "CORRUPT ASSET"); + AssetBase corruptAsset = AssetHelpers.CreateAsset(corruptAssetUuid, "CORRUPT ASSET", UUID.Zero); m_assetService.Store(corruptAsset); IDictionary foundAssetUuids = new Dictionary(); -- cgit v1.1