From 21b71ff1d857239c919ad275db5aacbf0cb6331e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Jul 2017 17:36:40 +0100 Subject: partial mantis 8219; on creating or updating items (animationsets, wearables) that reference assets, and user does not have permissions on those, abort and warn, instead of silent invalition of the references to those assets, creating a broken item --- OpenSim/Framework/AnimationSet.cs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AnimationSet.cs b/OpenSim/Framework/AnimationSet.cs index 87c4a78..8753088 100644 --- a/OpenSim/Framework/AnimationSet.cs +++ b/OpenSim/Framework/AnimationSet.cs @@ -31,7 +31,8 @@ using OpenMetaverse; namespace OpenSim.Framework { - public delegate bool AnimationSetValidator(UUID animID); +// public delegate bool AnimationSetValidator(UUID animID); + public delegate uint AnimationSetValidator(UUID animID); public class AnimationSet { @@ -141,7 +142,7 @@ namespace OpenSim.Framework assetData += String.Format("{0} {1} {2}\n", kvp.Key, kvp.Value.Value.ToString(), kvp.Value.Key); return System.Text.Encoding.ASCII.GetBytes(assetData); } - +/* public bool Validate(AnimationSetValidator val) { if (m_parseError) @@ -164,5 +165,22 @@ namespace OpenSim.Framework return allOk; } +*/ + public uint Validate(AnimationSetValidator val) + { + if (m_parseError) + return 0; + + uint ret = 0x7fffffff; + uint t; + foreach (KeyValuePair> kvp in m_animations) + { + t = val(kvp.Value.Value); + if (t == 0) + return 0; + ret &= t; + } + return ret; + } } } -- cgit v1.1