From 3ea76e3131203f6a553d5a540d5d28aa5ca3f74a Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 27 Sep 2014 02:30:01 +0200 Subject: Make changes to AnimationSet to allow indexing by names rather than indices. Add some debugging output and prepare for parsing an ascii-based format. --- .../Framework/InventoryAccess/InventoryAccessModule.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index e8ad0f2..94782f9 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -277,6 +277,20 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess remoteClient.SendAlertMessage("Script saved"); } + else if ((CustomInventoryType)item.InvType == CustomInventoryType.AnimationSet) + { + AnimationSet animSet = new AnimationSet(data); + if (!animSet.Validate(x => { + int perms = m_Scene.InventoryService.GetAssetPermissions(remoteClient.AgentId, x); + int required = (int)(PermissionMask.Transfer | PermissionMask.Copy); + if ((perms & required) != required) + return false; + return true; + })) + { + data = animSet.ToBytes(); + } + } AssetBase asset = CreateAsset(item.Name, item.Description, (sbyte)item.AssetType, data, remoteClient.AgentId.ToString()); -- cgit v1.1 From f60139cb918833711ac6d1b4df66c0507db0515d Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 27 Sep 2014 21:17:56 +0200 Subject: Reinstate the part of the id theft protection that was lost in a long ago merge --- .../AssetTransaction/AgentAssetsTransactions.cs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 1e14f45..96c7e8c 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -172,6 +172,16 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { AssetXferUploader uploader = RequestXferUploader(transactionID); + // Here we need to get the old asset to extract the + // texture UUIDs if it's a wearable. + if (item.Type == (int)AssetType.Bodypart || + item.Type == (int)AssetType.Clothing) + { + AssetBase oldAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); + if (oldAsset != null) + uploader.SetOldData(oldAsset.Data); + } + uploader.RequestUpdateTaskInventoryItem(remoteClient, item); } @@ -180,6 +190,16 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { AssetXferUploader uploader = RequestXferUploader(transactionID); + // Here we need to get the old asset to extract the + // texture UUIDs if it's a wearable. + if (item.AssetType == (int)AssetType.Bodypart || + item.AssetType == (int)AssetType.Clothing) + { + AssetBase oldAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); + if (oldAsset != null) + uploader.SetOldData(oldAsset.Data); + } + uploader.RequestUpdateInventoryItem(remoteClient, item); } } -- cgit v1.1 From dbc0dfa606b7a344e1b7daf3653c360656f9b319 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 27 Sep 2014 22:18:43 +0200 Subject: Also fetch and store old asset for animation sets --- .../CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs index 96c7e8c..1a19585 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetsTransactions.cs @@ -175,7 +175,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction // Here we need to get the old asset to extract the // texture UUIDs if it's a wearable. if (item.Type == (int)AssetType.Bodypart || - item.Type == (int)AssetType.Clothing) + item.Type == (int)AssetType.Clothing || + item.Type == (int)CustomAssetType.AnimationSet) { AssetBase oldAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); if (oldAsset != null) @@ -193,7 +194,8 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction // Here we need to get the old asset to extract the // texture UUIDs if it's a wearable. if (item.AssetType == (int)AssetType.Bodypart || - item.AssetType == (int)AssetType.Clothing) + item.AssetType == (int)AssetType.Clothing || + item.AssetType == (int)CustomAssetType.AnimationSet) { AssetBase oldAsset = m_Scene.AssetService.Get(item.AssetID.ToString()); if (oldAsset != null) -- cgit v1.1