aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectPart.cs136
1 files changed, 39 insertions, 97 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 7bd55e5..619bc97 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -61,18 +61,6 @@ namespace OpenSim.Region.Environment.Scenes
61 61
62 public partial class SceneObjectPart : IScriptHost 62 public partial class SceneObjectPart : IScriptHost
63 { 63 {
64 private const PermissionMask OBJFULL_MASK_GENERAL =
65 PermissionMask.Copy | PermissionMask.Modify | PermissionMask.Transfer | PermissionMask.Move;
66
67 private const PermissionMask OBJFULL_MASK_OWNER =
68 PermissionMask.Copy | PermissionMask.Modify |
69 PermissionMask.Transfer;
70
71 private const uint OBJNEXT_OWNER = 2147483647;
72
73 private const uint FULL_MASK_PERMISSIONS_GENERAL = 2147483647;
74 private const uint FULL_MASK_PERMISSIONS_OWNER = 2147483647;
75
76 [XmlIgnore] public PhysicsActor PhysActor = null; 64 [XmlIgnore] public PhysicsActor PhysActor = null;
77 65
78 public LLUUID LastOwnerID; 66 public LLUUID LastOwnerID;
@@ -90,14 +78,23 @@ namespace OpenSim.Region.Environment.Scenes
90 private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1); 78 private Quaternion m_sitTargetOrientation = new Quaternion(0, 0, 0, 1);
91 private LLUUID m_SitTargetAvatar = LLUUID.Zero; 79 private LLUUID m_SitTargetAvatar = LLUUID.Zero;
92 80
93 // 81 #region Permissions
94 // Main grid has default permissions as follows 82
95 // 83 public uint BaseMask = (uint)PermissionMask.All;
96 public uint OwnerMask =(uint) PermissionMask.All; 84 public uint OwnerMask = (uint)PermissionMask.All;
97 public uint NextOwnerMask = OBJNEXT_OWNER; 85 public uint GroupMask = (uint)PermissionMask.None;
98 public uint GroupMask = (uint) PermissionMask.None;
99 public uint EveryoneMask = (uint)PermissionMask.None; 86 public uint EveryoneMask = (uint)PermissionMask.None;
100 public uint BaseMask = FULL_MASK_PERMISSIONS_OWNER; 87 public uint NextOwnerMask = (uint)PermissionMask.All;
88
89 public LLObject.ObjectFlags Flags = LLObject.ObjectFlags.None;
90
91 public uint ObjectFlags
92 {
93 get { return (uint)Flags; }
94 set { Flags = (LLObject.ObjectFlags)value; }
95 }
96
97 #endregion
101 98
102 protected byte[] m_particleSystem = new byte[0]; 99 protected byte[] m_particleSystem = new byte[0];
103 100
@@ -143,13 +140,7 @@ namespace OpenSim.Region.Environment.Scenes
143 set { m_name = value; } 140 set { m_name = value; }
144 } 141 }
145 142
146 protected LLObject.ObjectFlags m_flags = 0; 143
147
148 public uint ObjectFlags
149 {
150 get { return (uint) m_flags; }
151 set { m_flags = (LLObject.ObjectFlags) value; }
152 }
153 144
154 protected LLObject.MaterialType m_material = 0; 145 protected LLObject.MaterialType m_material = 0;
155 146
@@ -659,12 +650,12 @@ namespace OpenSim.Region.Environment.Scenes
659 m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString(); 650 m_inventoryFileName = "taskinventory" + LLUUID.Random().ToString();
660 m_folderID = LLUUID.Random(); 651 m_folderID = LLUUID.Random();
661 652
662 m_flags = 0; 653 Flags = 0;
663 m_flags |= LLObject.ObjectFlags.Touch | 654 Flags |= LLObject.ObjectFlags.Touch |
664 LLObject.ObjectFlags.AllowInventoryDrop | 655 LLObject.ObjectFlags.AllowInventoryDrop |
665 LLObject.ObjectFlags.CreateSelected; 656 LLObject.ObjectFlags.CreateSelected;
666 657
667 ApplySanePermissions(); 658 TrimPermissions();
668 659
669 ScheduleFullUpdate(); 660 ScheduleFullUpdate();
670 } 661 }
@@ -702,7 +693,7 @@ namespace OpenSim.Region.Environment.Scenes
702 RotationOffset = rotation; 693 RotationOffset = rotation;
703 ObjectFlags = flags; 694 ObjectFlags = flags;
704 695
705 ApplySanePermissions(); 696 TrimPermissions();
706 // ApplyPhysics(); 697 // ApplyPhysics();
707 698
708 ScheduleFullUpdate(); 699 ScheduleFullUpdate();
@@ -752,67 +743,18 @@ namespace OpenSim.Region.Environment.Scenes
752 { 743 {
753 BaseMask = NextOwnerMask; 744 BaseMask = NextOwnerMask;
754 OwnerMask = NextOwnerMask; 745 OwnerMask = NextOwnerMask;
746
755 TriggerScriptChangedEvent(Changed.OWNER); 747 TriggerScriptChangedEvent(Changed.OWNER);
756 748
757 } 749 }
758 750
759 public void ApplySanePermissions() 751 public void TrimPermissions()
760 { 752 {
761 // These are some flags that The OwnerMask should never have 753 BaseMask &= (uint)PermissionMask.All;
762 754 OwnerMask &= (uint)PermissionMask.All;
763 755 GroupMask &= (uint)PermissionMask.All;
764 // These are some flags that the next owner mask should never have 756 EveryoneMask &= (uint)PermissionMask.All;
765 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner; 757 NextOwnerMask &= (uint)PermissionMask.All;
766 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
767 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
768 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ObjectGroupOwned;
769 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Physics;
770 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Phantom;
771 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Scripted;
772 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Touch;
773 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Temporary;
774 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.TemporaryOnRez;
775 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.ZlibCompressed;
776 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.AllowInventoryDrop;
777 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.AnimSource;
778 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.Money;
779 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.CastShadows;
780 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.InventoryEmpty;
781 NextOwnerMask &= ~(uint) LLObject.ObjectFlags.CreateSelected;
782
783
784 // These are some flags that the GroupMask should never have
785 GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
786 GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
787 GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
788 GroupMask &= ~(uint) LLObject.ObjectFlags.ObjectGroupOwned;
789 GroupMask &= ~(uint) LLObject.ObjectFlags.Physics;
790 GroupMask &= ~(uint) LLObject.ObjectFlags.Phantom;
791 GroupMask &= ~(uint) LLObject.ObjectFlags.Scripted;
792 GroupMask &= ~(uint) LLObject.ObjectFlags.Touch;
793 GroupMask &= ~(uint) LLObject.ObjectFlags.Temporary;
794 GroupMask &= ~(uint) LLObject.ObjectFlags.TemporaryOnRez;
795 GroupMask &= ~(uint) LLObject.ObjectFlags.ZlibCompressed;
796 GroupMask &= ~(uint) LLObject.ObjectFlags.AllowInventoryDrop;
797 GroupMask &= ~(uint) LLObject.ObjectFlags.AnimSource;
798 GroupMask &= ~(uint) LLObject.ObjectFlags.Money;
799 GroupMask &= ~(uint) LLObject.ObjectFlags.CastShadows;
800 GroupMask &= ~(uint) LLObject.ObjectFlags.InventoryEmpty;
801 GroupMask &= ~(uint) LLObject.ObjectFlags.CreateSelected;
802
803
804 // These are some flags that EveryoneMask should never have
805 //EveryoneMask = (uint)OBJFULL_MASK_EVERYONE;
806
807
808 // These are some flags that ObjectFlags (m_flags) should never have
809 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectYouOwner;
810 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectTransfer;
811 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectOwnerModify;
812 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectYouOfficer;
813 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectCopy;
814 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectModify;
815 ObjectFlags &= ~(uint) LLObject.ObjectFlags.ObjectMove;
816 } 758 }
817 759
818 /// <summary> 760 /// <summary>
@@ -1097,27 +1039,27 @@ namespace OpenSim.Region.Environment.Scenes
1097 1039
1098 public void AddFlag(LLObject.ObjectFlags flag) 1040 public void AddFlag(LLObject.ObjectFlags flag)
1099 { 1041 {
1100 LLObject.ObjectFlags prevflag = m_flags; 1042 LLObject.ObjectFlags prevflag = Flags;
1101 //uint objflags = m_flags; 1043 //uint objflags = Flags;
1102 if ((ObjectFlags & (uint) flag) == 0) 1044 if ((ObjectFlags & (uint) flag) == 0)
1103 { 1045 {
1104 //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString()); 1046 //Console.WriteLine("Adding flag: " + ((LLObject.ObjectFlags) flag).ToString());
1105 m_flags |= flag; 1047 Flags |= flag;
1106 } 1048 }
1107 //uint currflag = (uint)m_flags; 1049 //uint currflag = (uint)Flags;
1108 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + m_flags.ToString()); 1050 //System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString());
1109 //ScheduleFullUpdate(); 1051 //ScheduleFullUpdate();
1110 } 1052 }
1111 1053
1112 public void RemFlag(LLObject.ObjectFlags flag) 1054 public void RemFlag(LLObject.ObjectFlags flag)
1113 { 1055 {
1114 LLObject.ObjectFlags prevflag = m_flags; 1056 LLObject.ObjectFlags prevflag = Flags;
1115 if ((ObjectFlags & (uint) flag) != 0) 1057 if ((ObjectFlags & (uint) flag) != 0)
1116 { 1058 {
1117 //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString()); 1059 //Console.WriteLine("Removing flag: " + ((LLObject.ObjectFlags)flag).ToString());
1118 m_flags &= ~flag; 1060 Flags &= ~flag;
1119 } 1061 }
1120 //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + m_flags.ToString()); 1062 //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + Flags.ToString());
1121 //ScheduleFullUpdate(); 1063 //ScheduleFullUpdate();
1122 } 1064 }
1123 1065
@@ -1581,10 +1523,10 @@ namespace OpenSim.Region.Environment.Scenes
1581 1523
1582 if (remoteClient.AgentId == OwnerID) 1524 if (remoteClient.AgentId == OwnerID)
1583 { 1525 {
1584 if ((uint) (m_flags & LLObject.ObjectFlags.CreateSelected) != 0) 1526 if ((uint) (Flags & LLObject.ObjectFlags.CreateSelected) != 0)
1585 { 1527 {
1586 clientFlags |= (uint) LLObject.ObjectFlags.CreateSelected; 1528 clientFlags |= (uint) LLObject.ObjectFlags.CreateSelected;
1587 m_flags &= ~LLObject.ObjectFlags.CreateSelected; 1529 Flags &= ~LLObject.ObjectFlags.CreateSelected;
1588 } 1530 }
1589 } 1531 }
1590 1532