diff options
author | Justin Clark-Casey (justincc) | 2010-08-10 17:26:31 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2010-08-10 17:26:31 +0100 |
commit | 0a81038dd5be361dba0a95546f3ef695ae720fc6 (patch) | |
tree | a371737f90c082fda22b8092f9d719b6e77e0526 /OpenSim/Region/Framework | |
parent | Extend DuplicateObject() test to check flags on the duplicated object (diff) | |
download | opensim-SC-0a81038dd5be361dba0a95546f3ef695ae720fc6.zip opensim-SC-0a81038dd5be361dba0a95546f3ef695ae720fc6.tar.gz opensim-SC-0a81038dd5be361dba0a95546f3ef695ae720fc6.tar.bz2 opensim-SC-0a81038dd5be361dba0a95546f3ef695ae720fc6.tar.xz |
Reduce number of paths in SOP code by setting flags via Flags property rather than _flags
Both ObjectFlags and Flags are effectively exactly the same property, except that ObjectFlags is uint and Flags is PrimFlags
Both reference the PrimFlags _flags underneath, so you couldn't set a non PrimFlags uint anyway.
Deprecated ObjectFlags in favour of Flags.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 0c35eec..0d3f64c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -396,7 +396,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
396 | // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from | 396 | // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from |
397 | // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log | 397 | // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log |
398 | 398 | ||
399 | _flags = 0; | 399 | Flags = 0; |
400 | CreateSelected = true; | 400 | CreateSelected = true; |
401 | 401 | ||
402 | TrimPermissions(); | 402 | TrimPermissions(); |
@@ -424,7 +424,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
424 | private uint _groupMask = (uint)PermissionMask.None; | 424 | private uint _groupMask = (uint)PermissionMask.None; |
425 | private uint _everyoneMask = (uint)PermissionMask.None; | 425 | private uint _everyoneMask = (uint)PermissionMask.None; |
426 | private uint _nextOwnerMask = (uint)PermissionMask.All; | 426 | private uint _nextOwnerMask = (uint)PermissionMask.All; |
427 | private PrimFlags _flags = 0; | 427 | private PrimFlags _flags = PrimFlags.None; |
428 | private DateTime m_expires; | 428 | private DateTime m_expires; |
429 | private DateTime m_rezzed; | 429 | private DateTime m_rezzed; |
430 | private bool m_createSelected = false; | 430 | private bool m_createSelected = false; |
@@ -471,10 +471,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
471 | set { m_inventory.Items = value; } | 471 | set { m_inventory.Items = value; } |
472 | } | 472 | } |
473 | 473 | ||
474 | /// <summary> | ||
475 | /// This is idential to the Flags property, except that the returned value is uint rather than PrimFlags | ||
476 | /// </summary> | ||
477 | [Obsolete("Use Flags property instead")] | ||
474 | public uint ObjectFlags | 478 | public uint ObjectFlags |
475 | { | 479 | { |
476 | get { return (uint)_flags; } | 480 | get { return (uint)Flags; } |
477 | set { _flags = (PrimFlags)value; } | 481 | set { Flags = (PrimFlags)value; } |
478 | } | 482 | } |
479 | 483 | ||
480 | public UUID UUID | 484 | public UUID UUID |
@@ -1169,7 +1173,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1169 | public PrimFlags Flags | 1173 | public PrimFlags Flags |
1170 | { | 1174 | { |
1171 | get { return _flags; } | 1175 | get { return _flags; } |
1172 | set { _flags = value; } | 1176 | set |
1177 | { | ||
1178 | // m_log.DebugFormat("[SOP]: Setting flags for {0} {1} to {2}", UUID, Name, value); | ||
1179 | _flags = value; | ||
1180 | } | ||
1173 | } | 1181 | } |
1174 | 1182 | ||
1175 | [XmlIgnore] | 1183 | [XmlIgnore] |
@@ -1305,7 +1313,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1305 | if ((ObjectFlags & (uint) flag) == 0) | 1313 | if ((ObjectFlags & (uint) flag) == 0) |
1306 | { | 1314 | { |
1307 | //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); | 1315 | //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); |
1308 | _flags |= flag; | 1316 | Flags |= flag; |
1309 | 1317 | ||
1310 | if (flag == PrimFlags.TemporaryOnRez) | 1318 | if (flag == PrimFlags.TemporaryOnRez) |
1311 | ResetExpire(); | 1319 | ResetExpire(); |
@@ -1940,12 +1948,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1940 | } | 1948 | } |
1941 | 1949 | ||
1942 | public uint GetEffectiveObjectFlags() | 1950 | public uint GetEffectiveObjectFlags() |
1943 | { | 1951 | { |
1944 | PrimFlags f = _flags; | 1952 | // Commenting this section of code out since it doesn't actually do anything, as enums are handled by |
1945 | if (m_parentGroup == null || m_parentGroup.RootPart == this) | 1953 | // value rather than reference |
1946 | f &= ~(PrimFlags.Touch | PrimFlags.Money); | 1954 | // PrimFlags f = _flags; |
1955 | // if (m_parentGroup == null || m_parentGroup.RootPart == this) | ||
1956 | // f &= ~(PrimFlags.Touch | PrimFlags.Money); | ||
1947 | 1957 | ||
1948 | return (uint)_flags | (uint)LocalFlags; | 1958 | return (uint)Flags | (uint)LocalFlags; |
1949 | } | 1959 | } |
1950 | 1960 | ||
1951 | public Vector3 GetGeometricCenter() | 1961 | public Vector3 GetGeometricCenter() |
@@ -2696,10 +2706,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2696 | public void RemFlag(PrimFlags flag) | 2706 | public void RemFlag(PrimFlags flag) |
2697 | { | 2707 | { |
2698 | // PrimFlags prevflag = Flags; | 2708 | // PrimFlags prevflag = Flags; |
2699 | if ((ObjectFlags & (uint) flag) != 0) | 2709 | if ((Flags & flag) != 0) |
2700 | { | 2710 | { |
2701 | //m_log.Debug("Removing flag: " + ((PrimFlags)flag).ToString()); | 2711 | //m_log.Debug("Removing flag: " + ((PrimFlags)flag).ToString()); |
2702 | _flags &= ~flag; | 2712 | Flags &= ~flag; |
2703 | } | 2713 | } |
2704 | //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); | 2714 | //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); |
2705 | //ScheduleFullUpdate(); | 2715 | //ScheduleFullUpdate(); |
@@ -2990,10 +3000,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2990 | 3000 | ||
2991 | if (remoteClient.AgentId == _ownerID) | 3001 | if (remoteClient.AgentId == _ownerID) |
2992 | { | 3002 | { |
2993 | if ((uint) (_flags & PrimFlags.CreateSelected) != 0) | 3003 | if ((Flags & PrimFlags.CreateSelected) != 0) |
2994 | { | 3004 | { |
2995 | clientFlags |= (uint) PrimFlags.CreateSelected; | 3005 | clientFlags |= (uint) PrimFlags.CreateSelected; |
2996 | _flags &= ~PrimFlags.CreateSelected; | 3006 | Flags &= ~PrimFlags.CreateSelected; |
2997 | } | 3007 | } |
2998 | } | 3008 | } |
2999 | //bool isattachment = IsAttachment; | 3009 | //bool isattachment = IsAttachment; |