add centerlized AnimationSet item permitions setting

avinationmerge
UbitUmarov 2014-09-26 14:00:33 +01:00
parent 09e05d48b9
commit cce31b6638
1 changed files with 19 additions and 0 deletions

View File

@ -33,10 +33,29 @@ namespace OpenSim.Framework
{ {
public delegate bool AnimationSetValidator(UUID animID); public delegate bool AnimationSetValidator(UUID animID);
public class AnimationSet public class AnimationSet
{ {
private readonly int m_maxAnimations = 255; private readonly int m_maxAnimations = 255;
public const uint allowedPermitions = (uint)(PermissionMask.Copy | PermissionMask.Modify);
public uint enforcePermitions(uint currentPerm)
{
return currentPerm & allowedPermitions;
}
public void enforceItemPermitions(ref InventoryItemBase it)
{
if (it == null)
return;
it.CurrentPermissions &= allowedPermitions;
it.NextPermissions &= allowedPermitions;
it.EveryOnePermissions &= allowedPermitions;
it.GroupPermissions &= allowedPermitions;
it.BasePermissions &= allowedPermitions;
}
public int AnimationCount { get; private set; } public int AnimationCount { get; private set; }
private Dictionary<int, UUID> m_animations = new Dictionary<int, UUID>(); private Dictionary<int, UUID> m_animations = new Dictionary<int, UUID>();