diff options
author | Melanie Thielker | 2014-09-25 22:03:02 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-09-25 22:03:02 +0200 |
commit | e37637587a1d23179442c3aa80e7461c5451ad8f (patch) | |
tree | 3c27a04429d6dc52d88d90ce00cb0ff31b8fdda4 /OpenSim/Region/CoreModules | |
parent | Rename = too generic (diff) | |
download | opensim-SC-e37637587a1d23179442c3aa80e7461c5451ad8f.zip opensim-SC-e37637587a1d23179442c3aa80e7461c5451ad8f.tar.gz opensim-SC-e37637587a1d23179442c3aa80e7461c5451ad8f.tar.bz2 opensim-SC-e37637587a1d23179442c3aa80e7461c5451ad8f.tar.xz |
Add a sample use for the validation
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs index 0569836..fe60c90 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetXferUploader.cs | |||
@@ -454,6 +454,22 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction | |||
454 | 454 | ||
455 | private void ValidateAssets() | 455 | private void ValidateAssets() |
456 | { | 456 | { |
457 | if (m_asset.Type == (sbyte)CustomAssetType.AnimationSet) | ||
458 | { | ||
459 | AnimationSet animSet = new AnimationSet(m_asset.Data); | ||
460 | |||
461 | bool allOk = animSet.Validate(x => { | ||
462 | int perms = m_Scene.InventoryService.GetAssetPermissions(ourClient.AgentId, x); | ||
463 | int required = (int)(PermissionMask.Transfer | PermissionMask.Copy); | ||
464 | if ((perms & required) != required) | ||
465 | return false; | ||
466 | return true; | ||
467 | }); | ||
468 | |||
469 | if (!allOk) | ||
470 | m_asset.Data = animSet.ToBytes(); | ||
471 | } | ||
472 | |||
457 | if (m_asset.Type == (sbyte)AssetType.Clothing || | 473 | if (m_asset.Type == (sbyte)AssetType.Clothing || |
458 | m_asset.Type == (sbyte)AssetType.Bodypart) | 474 | m_asset.Type == (sbyte)AssetType.Bodypart) |
459 | { | 475 | { |