refactor: Use SOP.Flags rather than SOP.ObjectFlags

prebuild-update
Justin Clark-Casey (justincc) 2010-08-13 20:23:53 +01:00
parent c98c6a2930
commit 39a748b47a
9 changed files with 25 additions and 25 deletions

View File

@ -1017,7 +1017,7 @@ VALUES
prim.SitName = (string)primRow["SitName"]; prim.SitName = (string)primRow["SitName"];
prim.TouchName = (string)primRow["TouchName"]; prim.TouchName = (string)primRow["TouchName"];
// permissions // permissions
prim.ObjectFlags = Convert.ToUInt32(primRow["ObjectFlags"]); prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
prim.CreatorID = new UUID((Guid)primRow["CreatorID"]); prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]); prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
prim.GroupID = new UUID((Guid)primRow["GroupID"]); prim.GroupID = new UUID((Guid)primRow["GroupID"]);
@ -1408,7 +1408,7 @@ VALUES
parameters.Add(_Database.CreateParameter("SitName", prim.SitName)); parameters.Add(_Database.CreateParameter("SitName", prim.SitName));
parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName)); parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName));
// permissions // permissions
parameters.Add(_Database.CreateParameter("ObjectFlags", prim.ObjectFlags)); parameters.Add(_Database.CreateParameter("ObjectFlags", (uint)prim.Flags));
parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID)); parameters.Add(_Database.CreateParameter("CreatorID", prim.CreatorID));
parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID)); parameters.Add(_Database.CreateParameter("OwnerID", prim.OwnerID));
parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID)); parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID));

View File

@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL
prim.SitName = (string)row["SitName"]; prim.SitName = (string)row["SitName"];
prim.TouchName = (string)row["TouchName"]; prim.TouchName = (string)row["TouchName"];
// Permissions // Permissions
prim.ObjectFlags = (uint)(int)row["ObjectFlags"]; prim.Flags = (PrimFlags)(int)row["ObjectFlags"];
prim.OwnerMask = (uint)(int)row["OwnerMask"]; prim.OwnerMask = (uint)(int)row["OwnerMask"];
prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"]; prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"];
prim.GroupMask = (uint)(int)row["GroupMask"]; prim.GroupMask = (uint)(int)row["GroupMask"];
@ -1414,7 +1414,7 @@ namespace OpenSim.Data.MySQL
cmd.Parameters.AddWithValue("SitName", prim.SitName); cmd.Parameters.AddWithValue("SitName", prim.SitName);
cmd.Parameters.AddWithValue("TouchName", prim.TouchName); cmd.Parameters.AddWithValue("TouchName", prim.TouchName);
// permissions // permissions
cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags); cmd.Parameters.AddWithValue("ObjectFlags", (uint)prim.Flags);
cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString()); cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString());
cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString()); cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString());
cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString()); cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString());

View File

@ -1187,7 +1187,7 @@ namespace OpenSim.Data.SQLiteLegacy
prim.SitName = (String) row["SitName"]; prim.SitName = (String) row["SitName"];
prim.TouchName = (String) row["TouchName"]; prim.TouchName = (String) row["TouchName"];
// permissions // permissions
prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]); prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]);
prim.CreatorID = new UUID((String) row["CreatorID"]); prim.CreatorID = new UUID((String) row["CreatorID"]);
prim.OwnerID = new UUID((String) row["OwnerID"]); prim.OwnerID = new UUID((String) row["OwnerID"]);
prim.GroupID = new UUID((String) row["GroupID"]); prim.GroupID = new UUID((String) row["GroupID"]);
@ -1521,7 +1521,7 @@ namespace OpenSim.Data.SQLiteLegacy
row["SitName"] = prim.SitName; row["SitName"] = prim.SitName;
row["TouchName"] = prim.TouchName; row["TouchName"] = prim.TouchName;
// permissions // permissions
row["ObjectFlags"] = prim.ObjectFlags; row["ObjectFlags"] = (uint)prim.Flags;
row["CreatorID"] = prim.CreatorID.ToString(); row["CreatorID"] = prim.CreatorID.ToString();
row["OwnerID"] = prim.OwnerID.ToString(); row["OwnerID"] = prim.OwnerID.ToString();
row["GroupID"] = prim.GroupID.ToString(); row["GroupID"] = prim.GroupID.ToString();

View File

@ -317,7 +317,7 @@ namespace OpenSim.Data.Tests
sop.CreatorID = creator; sop.CreatorID = creator;
sop.InventorySerial = iserial; sop.InventorySerial = iserial;
sop.TaskInventory = dic; sop.TaskInventory = dic;
sop.ObjectFlags = objf; sop.Flags = (PrimFlags)objf;
sop.Name = name; sop.Name = name;
sop.Material = material; sop.Material = material;
sop.ScriptAccessPin = pin; sop.ScriptAccessPin = pin;
@ -350,7 +350,7 @@ namespace OpenSim.Data.Tests
// Modified in-class // Modified in-class
// Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))"); // Assert.That(iserial,Is.EqualTo(sop.InventorySerial), "Assert.That(iserial,Is.EqualTo(sop.InventorySerial))");
Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))"); Assert.That(dic,Is.EqualTo(sop.TaskInventory), "Assert.That(dic,Is.EqualTo(sop.TaskInventory))");
Assert.That(objf,Is.EqualTo(sop.ObjectFlags), "Assert.That(objf,Is.EqualTo(sop.ObjectFlags))"); Assert.That(objf, Is.EqualTo((uint)sop.Flags), "Assert.That(objf,Is.EqualTo(sop.Flags))");
Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))"); Assert.That(name,Is.EqualTo(sop.Name), "Assert.That(name,Is.EqualTo(sop.Name))");
Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))"); Assert.That(material,Is.EqualTo(sop.Material), "Assert.That(material,Is.EqualTo(sop.Material))");
Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))"); Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(sop.ScriptAccessPin))");
@ -373,7 +373,7 @@ namespace OpenSim.Data.Tests
Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))"); Assert.That(updatef,Is.EqualTo(sop.UpdateFlag), "Assert.That(updatef,Is.EqualTo(sop.UpdateFlag))");
// This is necessary or object will not be inserted in DB // This is necessary or object will not be inserted in DB
sop.ObjectFlags = 0; sop.Flags = PrimFlags.None;
SceneObjectGroup sog = new SceneObjectGroup(sop); SceneObjectGroup sog = new SceneObjectGroup(sop);
@ -398,7 +398,7 @@ namespace OpenSim.Data.Tests
Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))"); Assert.That(creator,Is.EqualTo(p.CreatorID), "Assert.That(creator,Is.EqualTo(p.CreatorID))");
//Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))"); //Assert.That(iserial,Is.EqualTo(p.InventorySerial), "Assert.That(iserial,Is.EqualTo(p.InventorySerial))");
Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))"); Assert.That(dic,Is.EqualTo(p.TaskInventory), "Assert.That(dic,Is.EqualTo(p.TaskInventory))");
//Assert.That(objf,Is.EqualTo(p.ObjectFlags), "Assert.That(objf,Is.EqualTo(p.ObjectFlags))"); //Assert.That(objf, Is.EqualTo((uint)p.Flags), "Assert.That(objf,Is.EqualTo(p.Flags))");
Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))"); Assert.That(name,Is.EqualTo(p.Name), "Assert.That(name,Is.EqualTo(p.Name))");
Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))"); Assert.That(material,Is.EqualTo(p.Material), "Assert.That(material,Is.EqualTo(p.Material))");
Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))"); Assert.That(pin,Is.EqualTo(p.ScriptAccessPin), "Assert.That(pin,Is.EqualTo(p.ScriptAccessPin))");

View File

@ -1,4 +1,4 @@
/* /*
* Copyright (c) Contributors, http://opensimulator.org/ * Copyright (c) Contributors, http://opensimulator.org/
* See CONTRIBUTORS.TXT for a full list of copyright holders. * See CONTRIBUTORS.TXT for a full list of copyright holders.
* *
@ -543,7 +543,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
if (attachment) if (attachment)
{ {
group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom; group.RootPart.Flags |= PrimFlags.Phantom;
group.RootPart.IsAttachment = true; group.RootPart.IsAttachment = true;
} }

View File

@ -135,7 +135,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
xmlobject.AppendChild(node); xmlobject.AppendChild(node);
node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", ""); node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", "");
node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags); node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags);
xmlobject.AppendChild(node); xmlobject.AppendChild(node);
node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", ""); node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", "");

View File

@ -1897,7 +1897,7 @@ namespace OpenSim.Region.Framework.Scenes
AddRestoredSceneObject(group, true, true); AddRestoredSceneObject(group, true, true);
SceneObjectPart rootPart = group.GetChildPart(group.UUID); SceneObjectPart rootPart = group.GetChildPart(group.UUID);
rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted; rootPart.Flags &= ~PrimFlags.Scripted;
rootPart.TrimPermissions(); rootPart.TrimPermissions();
group.CheckSculptAndLoad(); group.CheckSculptAndLoad();
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true); //rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
@ -2184,7 +2184,7 @@ namespace OpenSim.Region.Framework.Scenes
foreach (SceneObjectPart part in group.Children.Values) foreach (SceneObjectPart part in group.Children.Values)
{ {
if (part.IsJoint() && ((part.ObjectFlags&(uint)PrimFlags.Physics) != 0)) if (part.IsJoint() && ((part.Flags & PrimFlags.Physics) != 0))
{ {
PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed? PhysicsScene.RequestJointDeletion(part.Name); // FIXME: what if the name changed?
} }
@ -4852,7 +4852,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
// turn the proxy non-physical, which also stops its client-side interpolation // turn the proxy non-physical, which also stops its client-side interpolation
bool wasUsingPhysics = ((jointProxyObject.ObjectFlags & (uint)PrimFlags.Physics) != 0); bool wasUsingPhysics = ((jointProxyObject.Flags & PrimFlags.Physics) != 0);
if (wasUsingPhysics) if (wasUsingPhysics)
{ {
jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock jointProxyObject.UpdatePrimFlags(false, false, true, false); // FIXME: possible deadlock here; check to make sure all the scene alterations set into motion here won't deadlock

View File

@ -1322,9 +1322,9 @@ namespace OpenSim.Region.Framework.Scenes
public void aggregateScriptEvents() public void aggregateScriptEvents()
{ {
uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags(); PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags();
scriptEvents aggregateScriptEvents=0; scriptEvents aggregateScriptEvents = 0;
lock (m_parts) lock (m_parts)
{ {
@ -1333,7 +1333,7 @@ namespace OpenSim.Region.Framework.Scenes
if (part == null) if (part == null)
continue; continue;
if (part != RootPart) if (part != RootPart)
part.ObjectFlags = objectflagupdate; part.Flags = objectflagupdate;
aggregateScriptEvents |= part.AggregateScriptEvents; aggregateScriptEvents |= part.AggregateScriptEvents;
} }
} }

View File

@ -1324,7 +1324,7 @@ namespace OpenSim.Region.Framework.Scenes
public void AddFlag(PrimFlags flag) public void AddFlag(PrimFlags flag)
{ {
// PrimFlags prevflag = Flags; // PrimFlags prevflag = Flags;
if ((ObjectFlags & (uint) flag) == 0) if ((Flags & flag) == 0)
{ {
//m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString());
Flags |= flag; Flags |= flag;
@ -1607,7 +1607,7 @@ namespace OpenSim.Region.Framework.Scenes
dupe.Velocity = new Vector3(0, 0, 0); dupe.Velocity = new Vector3(0, 0, 0);
dupe.Acceleration = new Vector3(0, 0, 0); dupe.Acceleration = new Vector3(0, 0, 0);
dupe.AngularVelocity = new Vector3(0, 0, 0); dupe.AngularVelocity = new Vector3(0, 0, 0);
dupe.ObjectFlags = ObjectFlags; dupe.Flags = Flags;
dupe._ownershipCost = _ownershipCost; dupe._ownershipCost = _ownershipCost;
dupe._objectSaleType = _objectSaleType; dupe._objectSaleType = _objectSaleType;
@ -1644,7 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived); m_parentGroup.Scene.AssetService.Get(dupe.m_shape.SculptTexture.ToString(), dupe, AssetReceived);
} }
bool UsePhysics = ((dupe.ObjectFlags & (uint)PrimFlags.Physics) != 0); bool UsePhysics = ((dupe.Flags & PrimFlags.Physics) != 0);
dupe.DoPhysicsPropertyUpdate(UsePhysics, true); dupe.DoPhysicsPropertyUpdate(UsePhysics, true);
} }
@ -4271,9 +4271,9 @@ namespace OpenSim.Region.Framework.Scenes
public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD) public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD)
{ {
bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0); bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0);
bool wasTemporary = ((ObjectFlags & (uint)PrimFlags.TemporaryOnRez) != 0); bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0);
bool wasPhantom = ((ObjectFlags & (uint)PrimFlags.Phantom) != 0); bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0);
bool wasVD = VolumeDetectActive; bool wasVD = VolumeDetectActive;
if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD)) if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD))