refactor: Use SOP.Flags rather than SOP.ObjectFlags
parent
c98c6a2930
commit
39a748b47a
|
@ -1017,7 +1017,7 @@ VALUES
|
|||
prim.SitName = (string)primRow["SitName"];
|
||||
prim.TouchName = (string)primRow["TouchName"];
|
||||
// permissions
|
||||
prim.ObjectFlags = Convert.ToUInt32(primRow["ObjectFlags"]);
|
||||
prim.Flags = (PrimFlags)Convert.ToUInt32(primRow["ObjectFlags"]);
|
||||
prim.CreatorID = new UUID((Guid)primRow["CreatorID"]);
|
||||
prim.OwnerID = new UUID((Guid)primRow["OwnerID"]);
|
||||
prim.GroupID = new UUID((Guid)primRow["GroupID"]);
|
||||
|
@ -1408,7 +1408,7 @@ VALUES
|
|||
parameters.Add(_Database.CreateParameter("SitName", prim.SitName));
|
||||
parameters.Add(_Database.CreateParameter("TouchName", prim.TouchName));
|
||||
// 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("OwnerID", prim.OwnerID));
|
||||
parameters.Add(_Database.CreateParameter("GroupID", prim.GroupID));
|
||||
|
|
|
@ -1081,7 +1081,7 @@ namespace OpenSim.Data.MySQL
|
|||
prim.SitName = (string)row["SitName"];
|
||||
prim.TouchName = (string)row["TouchName"];
|
||||
// Permissions
|
||||
prim.ObjectFlags = (uint)(int)row["ObjectFlags"];
|
||||
prim.Flags = (PrimFlags)(int)row["ObjectFlags"];
|
||||
prim.OwnerMask = (uint)(int)row["OwnerMask"];
|
||||
prim.NextOwnerMask = (uint)(int)row["NextOwnerMask"];
|
||||
prim.GroupMask = (uint)(int)row["GroupMask"];
|
||||
|
@ -1414,7 +1414,7 @@ namespace OpenSim.Data.MySQL
|
|||
cmd.Parameters.AddWithValue("SitName", prim.SitName);
|
||||
cmd.Parameters.AddWithValue("TouchName", prim.TouchName);
|
||||
// permissions
|
||||
cmd.Parameters.AddWithValue("ObjectFlags", prim.ObjectFlags);
|
||||
cmd.Parameters.AddWithValue("ObjectFlags", (uint)prim.Flags);
|
||||
cmd.Parameters.AddWithValue("CreatorID", prim.CreatorID.ToString());
|
||||
cmd.Parameters.AddWithValue("OwnerID", prim.OwnerID.ToString());
|
||||
cmd.Parameters.AddWithValue("GroupID", prim.GroupID.ToString());
|
||||
|
|
|
@ -1187,7 +1187,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
|||
prim.SitName = (String) row["SitName"];
|
||||
prim.TouchName = (String) row["TouchName"];
|
||||
// permissions
|
||||
prim.ObjectFlags = Convert.ToUInt32(row["ObjectFlags"]);
|
||||
prim.Flags = (PrimFlags)Convert.ToUInt32(row["ObjectFlags"]);
|
||||
prim.CreatorID = new UUID((String) row["CreatorID"]);
|
||||
prim.OwnerID = new UUID((String) row["OwnerID"]);
|
||||
prim.GroupID = new UUID((String) row["GroupID"]);
|
||||
|
@ -1521,7 +1521,7 @@ namespace OpenSim.Data.SQLiteLegacy
|
|||
row["SitName"] = prim.SitName;
|
||||
row["TouchName"] = prim.TouchName;
|
||||
// permissions
|
||||
row["ObjectFlags"] = prim.ObjectFlags;
|
||||
row["ObjectFlags"] = (uint)prim.Flags;
|
||||
row["CreatorID"] = prim.CreatorID.ToString();
|
||||
row["OwnerID"] = prim.OwnerID.ToString();
|
||||
row["GroupID"] = prim.GroupID.ToString();
|
||||
|
|
|
@ -317,7 +317,7 @@ namespace OpenSim.Data.Tests
|
|||
sop.CreatorID = creator;
|
||||
sop.InventorySerial = iserial;
|
||||
sop.TaskInventory = dic;
|
||||
sop.ObjectFlags = objf;
|
||||
sop.Flags = (PrimFlags)objf;
|
||||
sop.Name = name;
|
||||
sop.Material = material;
|
||||
sop.ScriptAccessPin = pin;
|
||||
|
@ -350,7 +350,7 @@ namespace OpenSim.Data.Tests
|
|||
// Modified in-class
|
||||
// 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(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(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))");
|
||||
|
@ -373,7 +373,7 @@ namespace OpenSim.Data.Tests
|
|||
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
|
||||
sop.ObjectFlags = 0;
|
||||
sop.Flags = PrimFlags.None;
|
||||
|
||||
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(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(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(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))");
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* Copyright (c) Contributors, http://opensimulator.org/
|
||||
* See CONTRIBUTORS.TXT for a full list of copyright holders.
|
||||
*
|
||||
|
@ -543,7 +543,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
|
|||
|
||||
if (attachment)
|
||||
{
|
||||
group.RootPart.ObjectFlags |= (uint)PrimFlags.Phantom;
|
||||
group.RootPart.Flags |= PrimFlags.Phantom;
|
||||
group.RootPart.IsAttachment = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@ namespace OpenSim.Region.DataSnapshot.Providers
|
|||
xmlobject.AppendChild(node);
|
||||
|
||||
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);
|
||||
|
||||
node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", "");
|
||||
|
|
|
@ -1897,7 +1897,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
AddRestoredSceneObject(group, true, true);
|
||||
SceneObjectPart rootPart = group.GetChildPart(group.UUID);
|
||||
rootPart.ObjectFlags &= ~(uint)PrimFlags.Scripted;
|
||||
rootPart.Flags &= ~PrimFlags.Scripted;
|
||||
rootPart.TrimPermissions();
|
||||
group.CheckSculptAndLoad();
|
||||
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
|
||||
|
@ -2184,7 +2184,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
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?
|
||||
}
|
||||
|
@ -4852,7 +4852,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
|
||||
// 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)
|
||||
{
|
||||
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
|
||||
|
|
|
@ -1322,7 +1322,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public void aggregateScriptEvents()
|
||||
{
|
||||
uint objectflagupdate=(uint)RootPart.GetEffectiveObjectFlags();
|
||||
PrimFlags objectflagupdate = (PrimFlags)RootPart.GetEffectiveObjectFlags();
|
||||
|
||||
scriptEvents aggregateScriptEvents = 0;
|
||||
|
||||
|
@ -1333,7 +1333,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
if (part == null)
|
||||
continue;
|
||||
if (part != RootPart)
|
||||
part.ObjectFlags = objectflagupdate;
|
||||
part.Flags = objectflagupdate;
|
||||
aggregateScriptEvents |= part.AggregateScriptEvents;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1324,7 +1324,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public void AddFlag(PrimFlags flag)
|
||||
{
|
||||
// PrimFlags prevflag = Flags;
|
||||
if ((ObjectFlags & (uint) flag) == 0)
|
||||
if ((Flags & flag) == 0)
|
||||
{
|
||||
//m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString());
|
||||
Flags |= flag;
|
||||
|
@ -1607,7 +1607,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
dupe.Velocity = new Vector3(0, 0, 0);
|
||||
dupe.Acceleration = new Vector3(0, 0, 0);
|
||||
dupe.AngularVelocity = new Vector3(0, 0, 0);
|
||||
dupe.ObjectFlags = ObjectFlags;
|
||||
dupe.Flags = Flags;
|
||||
|
||||
dupe._ownershipCost = _ownershipCost;
|
||||
dupe._objectSaleType = _objectSaleType;
|
||||
|
@ -1644,7 +1644,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -4271,9 +4271,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
public void UpdatePrimFlags(bool UsePhysics, bool IsTemporary, bool IsPhantom, bool IsVD)
|
||||
{
|
||||
bool wasUsingPhysics = ((ObjectFlags & (uint) PrimFlags.Physics) != 0);
|
||||
bool wasTemporary = ((ObjectFlags & (uint)PrimFlags.TemporaryOnRez) != 0);
|
||||
bool wasPhantom = ((ObjectFlags & (uint)PrimFlags.Phantom) != 0);
|
||||
bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0);
|
||||
bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0);
|
||||
bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0);
|
||||
bool wasVD = VolumeDetectActive;
|
||||
|
||||
if ((UsePhysics == wasUsingPhysics) && (wasTemporary == IsTemporary) && (wasPhantom == IsPhantom) && (IsVD==wasVD))
|
||||
|
|
Loading…
Reference in New Issue