Renamed SOP and SOPInventory as SOPBase and SOPInventoryBase, and define new SOP and SOPInventory. The latters
will invoke UpdateBucketSyncInfo the set functions of their properties, while the base classes won't.dsg
parent
a9ebb3ebae
commit
3cd1ec8752
|
@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
PupolatePropertyBuketMapByDefault();
|
PupolatePropertyBuketMapByDefault();
|
||||||
|
|
||||||
//Pass the bucket information to SceneObjectPart.
|
//Pass the bucket information to SceneObjectPart.
|
||||||
SceneObjectPart.InitializeBucketInfo(m_primPropertyBucketMap, m_propertyBucketDescription, m_actorID);
|
SceneObjectPart.InitializePropertyBucketInfo(m_primPropertyBucketMap, m_propertyBucketDescription, m_actorID);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,8 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||||
{
|
{
|
||||||
void Reset();
|
void Reset();
|
||||||
void Close();
|
void Close();
|
||||||
void QueuePartForUpdate(SceneObjectPart part);
|
//void QueuePartForUpdate(SceneObjectPart part);
|
||||||
|
void QueuePartForUpdate(SceneObjectPartBase part);
|
||||||
void SendPrimUpdates();
|
void SendPrimUpdates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2148,8 +2148,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//SYMMETRIC SYNC: need to copy value w/o trigger UpdateBucketSyncInfo
|
//SYMMETRIC SYNC: need to copy value w/o trigger UpdateBucketSyncInfo
|
||||||
//child.RootPart.ObjectSaleType = 0;
|
//child.RootPart.ObjectSaleType = 0;
|
||||||
//child.RootPart.SalePrice = 10;
|
//child.RootPart.SalePrice = 10;
|
||||||
child.RootPart.SetObjectSaleType(0);
|
//child.RootPart.SetObjectSaleType(0);
|
||||||
child.RootPart.SetSalePrice(10);
|
//child.RootPart.SetSalePrice(10);
|
||||||
|
//child.RootPart.SetProperty("ObjectSaleType", 0);
|
||||||
|
//child.RootPart.SetProperty("SalePrice", 10);
|
||||||
|
|
||||||
|
//casting SOP to SOPBase to make sure we call SOPBase.Property set function, not the SOP.Property set function
|
||||||
|
SceneObjectPartBase rootPart = (SceneObjectPartBase)child.RootPart;
|
||||||
|
rootPart.ObjectSaleType = 0;
|
||||||
|
rootPart.SalePrice = 10;
|
||||||
childGroups.Add(child);
|
childGroups.Add(child);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -294,11 +294,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return m_rootPart.GroupPosition; }
|
get { return m_rootPart.GroupPosition; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
SetAbsolutePosition(value);
|
SetAbsolutePosition(value);
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
parts[i].UpdateBucketSyncInfo("GroupPosition");
|
parts[i].UpdateBucketSyncInfo("GroupPosition");
|
||||||
/*
|
*/
|
||||||
Vector3 val = value;
|
Vector3 val = value;
|
||||||
|
|
||||||
//REGION SYNC touched
|
//REGION SYNC touched
|
||||||
|
@ -333,7 +334,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//m_rootPart.GroupPosition.Z);
|
//m_rootPart.GroupPosition.Z);
|
||||||
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
|
//m_scene.PhysicsScene.AddPhysicsActorTaint(m_rootPart.PhysActor);
|
||||||
//}
|
//}
|
||||||
* */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void SetAbsolutePosition(Vector3 value)
|
public void SetAbsolutePosition(Vector3 value)
|
||||||
|
@ -364,8 +365,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
{
|
{
|
||||||
//parts[i].GroupPosition = val;
|
parts[i].GroupPosition = val;
|
||||||
parts[i].SetGroupPosition(val);
|
//parts[i].SetGroupPosition(val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3749,12 +3750,13 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
//!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!
|
//!!!!!!!!!!!!!!!!!!NOTE!!!!!!!!!!!!!!!
|
||||||
//All SOP properties below is set through calling SetXXX(value) instead of by "XXX=value", as such a value is being changed due to sync (
|
//All SOP properties below is set through calling SetXXX(value) instead of by "XXX=value", as such a value is being changed due to sync (
|
||||||
//i.e. triggered by remote operation instead of by local operation
|
//i.e. triggered by remote operation instead of by local operation
|
||||||
public SceneObjectGroup DelinkFromGroupBySync(SceneObjectPart linkPart, bool sendEvents)
|
public SceneObjectGroup DelinkFromGroupBySync(SceneObjectPart delinkPart, bool sendEvents)
|
||||||
{
|
{
|
||||||
// m_log.DebugFormat(
|
// m_log.DebugFormat(
|
||||||
// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
|
// "[SCENE OBJECT GROUP]: Delinking part {0}, {1} from group with root part {2}, {3}",
|
||||||
// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
|
// linkPart.Name, linkPart.UUID, RootPart.Name, RootPart.UUID);
|
||||||
|
|
||||||
|
SceneObjectPartBase linkPart = (SceneObjectPartBase)delinkPart;
|
||||||
linkPart.ClearUndoState();
|
linkPart.ClearUndoState();
|
||||||
|
|
||||||
Quaternion worldRot = linkPart.GetWorldRotation();
|
Quaternion worldRot = linkPart.GetWorldRotation();
|
||||||
|
@ -3770,27 +3772,27 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
// Single prim left
|
// Single prim left
|
||||||
//RootPart.LinkNum = 0;
|
//RootPart.LinkNum = 0;
|
||||||
RootPart.SetLinkNum(0);
|
//RootPart.SetProperty("LinkNum", 0);
|
||||||
|
((SceneObjectPartBase)RootPart).LinkNum = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = parts[i];
|
SceneObjectPartBase part = (SceneObjectPartBase)parts[i];
|
||||||
if (part.LinkNum > linkPart.LinkNum)
|
if (part.LinkNum > linkPart.LinkNum)
|
||||||
{
|
{
|
||||||
//part.LinkNum--;
|
part.LinkNum--;
|
||||||
int linkNum = part.LinkNum - 1;
|
//int linkNum = part.LinkNum - 1;
|
||||||
part.SetLinkNum(linkNum);
|
//part.SetProperty("LinkNum", linkNum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//linkPart.ParentID = 0;
|
linkPart.ParentID = 0; //ParentID is a value set only locally and ignored in synchronization, so no need to call SetProperty to set its value
|
||||||
//linkPart.LinkNum = 0;
|
linkPart.LinkNum = 0;
|
||||||
linkPart.SetParentID(0);
|
//linkPart.SetParentID(0);
|
||||||
linkPart.SetLinkNum(0);
|
|
||||||
|
|
||||||
if (linkPart.PhysActor != null)
|
if (linkPart.PhysActor != null)
|
||||||
{
|
{
|
||||||
|
@ -3804,19 +3806,23 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
Vector3 axPos = linkPart.OffsetPosition;
|
Vector3 axPos = linkPart.OffsetPosition;
|
||||||
|
|
||||||
axPos *= parentRot;
|
axPos *= parentRot;
|
||||||
//linkPart.OffsetPosition = new Vector3(axPos.X, axPos.Y, axPos.Z);
|
linkPart.OffsetPosition = new Vector3(axPos.X, axPos.Y, axPos.Z);
|
||||||
//linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
|
linkPart.GroupPosition = AbsolutePosition + linkPart.OffsetPosition;
|
||||||
//linkPart.OffsetPosition = new Vector3(0, 0, 0);
|
linkPart.OffsetPosition = new Vector3(0, 0, 0);
|
||||||
//linkPart.RotationOffset = worldRot;
|
linkPart.RotationOffset = worldRot;
|
||||||
|
|
||||||
linkPart.SetOffsetPosition(new Vector3(axPos.X, axPos.Y, axPos.Z));
|
//linkPart.SetOffsetPosition(new Vector3(axPos.X, axPos.Y, axPos.Z));
|
||||||
linkPart.SetGroupPosition(AbsolutePosition + linkPart.OffsetPosition);
|
//linkPart.SetGroupPosition(AbsolutePosition + linkPart.OffsetPosition);
|
||||||
linkPart.SetOffsetPosition(new Vector3(0, 0, 0));
|
//linkPart.SetOffsetPosition(new Vector3(0, 0, 0));
|
||||||
linkPart.SetRotationOffset(worldRot);
|
//linkPart.SetRotationOffset(worldRot);
|
||||||
|
//linkPart.SetProperty("OffsetPosition", new Vector3(axPos.X, axPos.Y, axPos.Z));
|
||||||
|
//linkPart.SetProperty("GroupPosition", AbsolutePosition + linkPart.OffsetPosition);
|
||||||
|
//linkPart.SetProperty("OffsetPosition", new Vector3(0, 0, 0));
|
||||||
|
//linkPart.SetProperty("RotationOffset", worldRot);
|
||||||
|
|
||||||
//SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
|
//SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart);
|
||||||
bool newGroupBySync = true;
|
bool newGroupBySync = true;
|
||||||
SceneObjectGroup objectGroup = new SceneObjectGroup(linkPart, newGroupBySync);
|
SceneObjectGroup objectGroup = new SceneObjectGroup(delinkPart, newGroupBySync);
|
||||||
|
|
||||||
m_scene.AddNewSceneObjectBySync(objectGroup, true);
|
m_scene.AddNewSceneObjectBySync(objectGroup, true);
|
||||||
|
|
||||||
|
@ -3833,7 +3839,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Set a part to act as the root part for this scene object, in which SetLinkNum() is called instead of "LinkNum=".
|
/// Set a part to act as the root part for this scene object, in which SetProperty("LinkNum",) is called instead of "LinkNum=".
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
public void SetRootPartBySync(SceneObjectPart part)
|
public void SetRootPartBySync(SceneObjectPart part)
|
||||||
|
@ -3845,7 +3851,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_rootPart = part;
|
m_rootPart = part;
|
||||||
if (!IsAttachment)
|
if (!IsAttachment)
|
||||||
part.ParentID = 0;
|
part.ParentID = 0;
|
||||||
part.SetLinkNum(0);
|
part.SetProperty("LinkNum", 0);
|
||||||
|
|
||||||
m_parts.Add(m_rootPart.UUID, m_rootPart);
|
m_parts.Add(m_rootPart.UUID, m_rootPart);
|
||||||
}
|
}
|
||||||
|
@ -3872,36 +3878,40 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
public void LinkToGroupBySync(SceneObjectGroup objectGroup)
|
public void LinkToGroupBySync(SceneObjectGroup objectGroup)
|
||||||
{
|
{
|
||||||
|
|
||||||
SceneObjectPart linkPart = objectGroup.m_rootPart;
|
SceneObjectPartBase linkPart = (SceneObjectPartBase)objectGroup.m_rootPart;
|
||||||
|
|
||||||
Vector3 oldGroupPosition = linkPart.GroupPosition;
|
Vector3 oldGroupPosition = linkPart.GroupPosition;
|
||||||
Quaternion oldRootRotation = linkPart.RotationOffset;
|
Quaternion oldRootRotation = linkPart.RotationOffset;
|
||||||
|
|
||||||
//linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
|
linkPart.OffsetPosition = linkPart.GroupPosition - AbsolutePosition;
|
||||||
//linkPart.GroupPosition = AbsolutePosition;
|
linkPart.GroupPosition = AbsolutePosition;
|
||||||
linkPart.SetOffsetPosition(linkPart.GroupPosition - AbsolutePosition);
|
//linkPart.SetOffsetPosition(linkPart.GroupPosition - AbsolutePosition);
|
||||||
linkPart.SetGroupPosition(AbsolutePosition);
|
//linkPart.SetGroupPosition(AbsolutePosition);
|
||||||
|
//linkPart.SetProperty("OffsetPosition", linkPart.GroupPosition - AbsolutePosition);
|
||||||
|
//linkPart.SetProperty("GroupPosition", AbsolutePosition);
|
||||||
Vector3 axPos = linkPart.OffsetPosition;
|
Vector3 axPos = linkPart.OffsetPosition;
|
||||||
|
|
||||||
Quaternion parentRot = m_rootPart.RotationOffset;
|
Quaternion parentRot = m_rootPart.RotationOffset;
|
||||||
axPos *= Quaternion.Inverse(parentRot);
|
axPos *= Quaternion.Inverse(parentRot);
|
||||||
|
|
||||||
//linkPart.OffsetPosition = axPos;
|
linkPart.OffsetPosition = axPos;
|
||||||
linkPart.SetOffsetPosition(axPos);
|
//linkPart.SetOffsetPosition(axPos);
|
||||||
|
//linkPart.SetProperty("OffsetPosition", axPos);
|
||||||
Quaternion oldRot = linkPart.RotationOffset;
|
Quaternion oldRot = linkPart.RotationOffset;
|
||||||
Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
|
Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
|
||||||
//linkPart.RotationOffset = newRot;
|
linkPart.RotationOffset = newRot;
|
||||||
linkPart.SetRotationOffset(newRot);
|
//linkPart.SetRotationOffset(newRot);
|
||||||
|
//linkPart.SetProperty("RotationOffset", newRot);
|
||||||
|
|
||||||
//ParentID is only valid locally, so remote value is ignored and no syncinfo will be modified
|
//ParentID is only valid locally, so remote value is ignored and no syncinfo will be modified
|
||||||
linkPart.ParentID = m_rootPart.LocalId;
|
linkPart.ParentID = m_rootPart.LocalId;
|
||||||
if (m_rootPart.LinkNum == 0)
|
if (m_rootPart.LinkNum == 0)
|
||||||
//m_rootPart.LinkNum = 1;
|
((SceneObjectPartBase)m_rootPart).LinkNum = 1;
|
||||||
m_rootPart.SetLinkNum(1);
|
//m_rootPart.SetProperty("LinkNum",1);
|
||||||
|
|
||||||
lock (m_parts.SyncRoot)
|
lock (m_parts.SyncRoot)
|
||||||
{
|
{
|
||||||
m_parts.Add(linkPart.UUID, linkPart);
|
m_parts.Add(linkPart.UUID, (SceneObjectPart) linkPart);
|
||||||
|
|
||||||
// Insert in terms of link numbers, the new links
|
// Insert in terms of link numbers, the new links
|
||||||
// before the current ones (with the exception of
|
// before the current ones (with the exception of
|
||||||
|
@ -3909,17 +3919,17 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
SceneObjectPart[] parts = m_parts.GetArray();
|
SceneObjectPart[] parts = m_parts.GetArray();
|
||||||
for (int i = 0; i < parts.Length; i++)
|
for (int i = 0; i < parts.Length; i++)
|
||||||
{
|
{
|
||||||
SceneObjectPart part = parts[i];
|
SceneObjectPartBase part = (SceneObjectPartBase)parts[i];
|
||||||
if (part.LinkNum != 1)
|
if (part.LinkNum != 1)
|
||||||
{
|
{
|
||||||
// Don't update root prim link number
|
// Don't update root prim link number
|
||||||
//part.LinkNum += objectGroup.PrimCount;
|
part.LinkNum += objectGroup.PrimCount;
|
||||||
part.SetLinkNum(objectGroup.PrimCount);
|
//part.SetProperty("LinkNum",objectGroup.PrimCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//linkPart.LinkNum = 2;
|
linkPart.LinkNum = 2;
|
||||||
linkPart.SetLinkNum(2);
|
//linkPart.SetProperty("LinkNum",2);
|
||||||
|
|
||||||
linkPart.SetParent(this);
|
linkPart.SetParent(this);
|
||||||
linkPart.CreateSelected = true;
|
linkPart.CreateSelected = true;
|
||||||
|
@ -3963,49 +3973,57 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LinkNonRootPartBySync(SceneObjectPart part, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum)
|
private void LinkNonRootPartBySync(SceneObjectPart linkPart, Vector3 oldGroupPosition, Quaternion oldGroupRotation, int linkNum)
|
||||||
{
|
{
|
||||||
Quaternion parentRot = oldGroupRotation;
|
Quaternion parentRot = oldGroupRotation;
|
||||||
Quaternion oldRot = part.RotationOffset;
|
Quaternion oldRot = linkPart.RotationOffset;
|
||||||
Quaternion worldRot = parentRot * oldRot;
|
Quaternion worldRot = parentRot * oldRot;
|
||||||
|
|
||||||
parentRot = oldGroupRotation;
|
parentRot = oldGroupRotation;
|
||||||
|
|
||||||
Vector3 axPos = part.OffsetPosition;
|
Vector3 axPos = linkPart.OffsetPosition;
|
||||||
|
|
||||||
|
SceneObjectPartBase part = (SceneObjectPartBase)linkPart;
|
||||||
axPos *= parentRot;
|
axPos *= parentRot;
|
||||||
//part.OffsetPosition = axPos;
|
part.OffsetPosition = axPos;
|
||||||
//part.GroupPosition = oldGroupPosition + part.OffsetPosition;
|
part.GroupPosition = oldGroupPosition + part.OffsetPosition;
|
||||||
//part.OffsetPosition = Vector3.Zero;
|
part.OffsetPosition = Vector3.Zero;
|
||||||
//part.RotationOffset = worldRot;
|
part.RotationOffset = worldRot;
|
||||||
part.SetOffsetPosition(axPos);
|
//part.SetOffsetPosition(axPos);
|
||||||
part.SetGroupPosition(oldGroupPosition + part.OffsetPosition);
|
//part.SetGroupPosition(oldGroupPosition + part.OffsetPosition);
|
||||||
part.SetOffsetPosition(Vector3.Zero);
|
//part.SetOffsetPosition(Vector3.Zero);
|
||||||
part.SetRotationOffset(worldRot);
|
//part.SetRotationOffset(worldRot);
|
||||||
|
//part.SetProperty("OffsetPosition", axPos);
|
||||||
|
//part.SetProperty("GroupPosition", oldGroupPosition + part.OffsetPosition);
|
||||||
|
//part.SetProperty("OffsetPosition", Vector3.Zero);
|
||||||
|
//part.SetProperty("RotationOffset", worldRot);
|
||||||
|
|
||||||
part.SetParent(this);
|
part.SetParent(this);
|
||||||
part.ParentID = m_rootPart.LocalId;
|
part.ParentID = m_rootPart.LocalId;
|
||||||
|
|
||||||
m_parts.Add(part.UUID, part);
|
m_parts.Add(part.UUID, linkPart);
|
||||||
|
|
||||||
//part.LinkNum = linkNum;
|
part.LinkNum = linkNum;
|
||||||
part.SetLinkNum(linkNum);
|
//part.SetProperty("LinkNum",linkNum);
|
||||||
|
|
||||||
//part.OffsetPosition = part.GroupPosition - AbsolutePosition;
|
part.OffsetPosition = part.GroupPosition - AbsolutePosition;
|
||||||
part.SetOffsetPosition(part.GroupPosition - AbsolutePosition);
|
//part.SetOffsetPosition(part.GroupPosition - AbsolutePosition);
|
||||||
|
//part.SetProperty("OffsetPosition", part.GroupPosition - AbsolutePosition);
|
||||||
|
|
||||||
Quaternion rootRotation = m_rootPart.RotationOffset;
|
Quaternion rootRotation = m_rootPart.RotationOffset;
|
||||||
|
|
||||||
Vector3 pos = part.OffsetPosition;
|
Vector3 pos = part.OffsetPosition;
|
||||||
pos *= Quaternion.Inverse(rootRotation);
|
pos *= Quaternion.Inverse(rootRotation);
|
||||||
//part.OffsetPosition = pos;
|
part.OffsetPosition = pos;
|
||||||
part.SetOffsetPosition(pos);
|
//part.SetOffsetPosition(pos);
|
||||||
|
//part.SetProperty("OffsetPosition", pos);
|
||||||
|
|
||||||
parentRot = m_rootPart.RotationOffset;
|
parentRot = m_rootPart.RotationOffset;
|
||||||
oldRot = part.RotationOffset;
|
oldRot = part.RotationOffset;
|
||||||
Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
|
Quaternion newRot = Quaternion.Inverse(parentRot) * oldRot;
|
||||||
//part.RotationOffset = newRot;
|
part.RotationOffset = newRot;
|
||||||
part.SetRotationOffset(newRot);
|
//part.SetRotationOffset(newRot);
|
||||||
|
//part.SetProperty("RotationOffset", newRot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -41,7 +41,8 @@ using OpenSim.Region.Framework.Scenes.Serialization;
|
||||||
|
|
||||||
namespace OpenSim.Region.Framework.Scenes
|
namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
public class SceneObjectPartInventory : IEntityInventory
|
//public class SceneObjectPartInventory : IEntityInventory
|
||||||
|
public class SceneObjectPartInventoryBase : IEntityInventory
|
||||||
{
|
{
|
||||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||||
|
|
||||||
|
@ -52,7 +53,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <value>
|
/// <value>
|
||||||
/// The part to which the inventory belongs.
|
/// The part to which the inventory belongs.
|
||||||
/// </value>
|
/// </value>
|
||||||
private SceneObjectPart m_part;
|
//private SceneObjectPart m_part;
|
||||||
|
private SceneObjectPartBase m_part;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Serial count for inventory file , used to tell if inventory has changed
|
/// Serial count for inventory file , used to tell if inventory has changed
|
||||||
|
@ -76,19 +78,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
protected internal uint Serial
|
protected internal uint Serial
|
||||||
{
|
{
|
||||||
get { return m_inventorySerial; }
|
get { return m_inventorySerial; }
|
||||||
set
|
set { m_inventorySerial = value; }
|
||||||
{
|
|
||||||
SetSerial(value);
|
|
||||||
m_part.UpdateBucketSyncInfo("InventorySerial");
|
|
||||||
//m_inventorySerial = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
public void SetSerial(uint value)
|
|
||||||
{
|
|
||||||
m_inventorySerial = value;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <value>
|
/// <value>
|
||||||
|
@ -99,21 +89,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
get { return m_items; }
|
get { return m_items; }
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
SetItems(value);
|
m_items = value;
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
m_part.UpdateBucketSyncInfo("InventorySerial");
|
|
||||||
//m_items = value;
|
|
||||||
//m_inventorySerial++;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//SYMMETRIC SYNC
|
|
||||||
//This is inparticular for updating properties
|
|
||||||
public void SetItems(TaskInventoryDictionary value)
|
|
||||||
{
|
|
||||||
m_items = value;
|
|
||||||
//m_inventorySerial++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructor
|
/// Constructor
|
||||||
|
@ -121,7 +100,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// <param name="part">
|
/// <param name="part">
|
||||||
/// A <see cref="SceneObjectPart"/>
|
/// A <see cref="SceneObjectPart"/>
|
||||||
/// </param>
|
/// </param>
|
||||||
public SceneObjectPartInventory(SceneObjectPart part)
|
//public SceneObjectPartInventory(SceneObjectPart part)
|
||||||
|
public SceneObjectPartInventoryBase(SceneObjectPartBase part)
|
||||||
{
|
{
|
||||||
m_part = part;
|
m_part = part;
|
||||||
}
|
}
|
||||||
|
@ -159,10 +139,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
item.ResetIDs(m_part.UUID);
|
item.ResetIDs(m_part.UUID);
|
||||||
m_items.Add(item.ItemID, item);
|
m_items.Add(item.ItemID, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
//No need to trigger UpdateBucketSyncInfo, as callers eventually will call SOG.AttachToScene and init BucketSyncInfo
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,9 +155,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
item.ParentID = m_part.UUID;
|
item.ParentID = m_part.UUID;
|
||||||
Items.Add(item.ItemID, item);
|
Items.Add(item.ItemID, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
//No need to trigger UpdateBucketSyncInfo, this is called only when SOP.UUID is written, which is assumed not to change after being created.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,9 +185,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
item.PermsGranter = UUID.Zero;
|
item.PermsGranter = UUID.Zero;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -246,12 +216,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
if (groupID != item.GroupID)
|
if (groupID != item.GroupID)
|
||||||
item.GroupID = groupID;
|
item.GroupID = groupID;
|
||||||
}
|
}
|
||||||
|
|
||||||
//SYMMETRIC SYNC: need to test if we need to take different actions when this is attachment or not
|
|
||||||
//if (!m_part.ParentGroup.RootPart.IsAttachment)
|
|
||||||
//{
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -582,11 +546,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
|
|
||||||
//SYMMETRIC SYNC: add ScheduleFullUpdate to enable synchronization across actors
|
//SYMMETRIC SYNC: add ScheduleFullUpdate to enable synchronization across actors
|
||||||
//m_part.ScheduleFullUpdate();
|
m_part.ScheduleFullUpdate();
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
m_part.UpdateBucketSyncInfo("InventorySerial"); //m_inventorySerial is also changed,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -607,9 +567,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
}
|
}
|
||||||
|
|
||||||
//SYMMETRIC SYNC: no UpdateBucketSyncInfo called here, since this function is called by loading objects from DB, and UpdateBucketSyncInfo
|
|
||||||
//will be called after all objects are loaded.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -768,10 +725,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
m_part.ParentGroup.HasGroupChanged = true;
|
m_part.ParentGroup.HasGroupChanged = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
m_part.UpdateBucketSyncInfo("InventorySerial");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -815,10 +768,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
|
|
||||||
m_part.ScheduleFullUpdate();
|
m_part.ScheduleFullUpdate();
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
m_part.UpdateBucketSyncInfo("InventorySerial");
|
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1073,9 +1022,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
item.OwnerChanged = true;
|
item.OwnerChanged = true;
|
||||||
item.PermsMask = 0;
|
item.PermsMask = 0;
|
||||||
item.PermsGranter = UUID.Zero;
|
item.PermsGranter = UUID.Zero;
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1092,10 +1038,6 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
m_inventorySerial++;
|
m_inventorySerial++;
|
||||||
HasInventoryChanged = true;
|
HasInventoryChanged = true;
|
||||||
|
|
||||||
//SYMMETRIC SYNC
|
|
||||||
m_part.UpdateBucketSyncInfo("TaskInventory");
|
|
||||||
m_part.UpdateBucketSyncInfo("InventorySerial");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool ContainsScripts()
|
public bool ContainsScripts()
|
||||||
|
@ -1233,4 +1175,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
}
|
}
|
||||||
#endregion REGION SYNC
|
#endregion REGION SYNC
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region SYMMETRIC SYNC
|
||||||
|
public class SceneObjectPartInventory : SceneObjectPartInventoryBase
|
||||||
|
{
|
||||||
|
private SceneObjectPart m_part;
|
||||||
|
public SceneObjectPartInventory(SceneObjectPart part):base((SceneObjectPartBase) part)
|
||||||
|
{
|
||||||
|
m_part = part;
|
||||||
|
}
|
||||||
|
|
||||||
|
new protected internal uint Serial
|
||||||
|
{
|
||||||
|
get { return base.Serial; }
|
||||||
|
set
|
||||||
|
{
|
||||||
|
base.Serial = value;
|
||||||
|
//m_part.UpdateBucketSyncInfo("InventorySerial");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,11 +57,12 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
/// Add the part to the queue of parts for which we need to send an update to the client
|
/// Add the part to the queue of parts for which we need to send an update to the client
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="part"></param>
|
/// <param name="part"></param>
|
||||||
public void QueuePartForUpdate(SceneObjectPart part)
|
//public void QueuePartForUpdate(SceneObjectPart part)
|
||||||
|
public void QueuePartForUpdate(SceneObjectPartBase part)
|
||||||
{
|
{
|
||||||
lock (m_partsUpdateQueue)
|
lock (m_partsUpdateQueue)
|
||||||
{
|
{
|
||||||
m_partsUpdateQueue.Enqueue(part);
|
m_partsUpdateQueue.Enqueue((SceneObjectPart)part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -423,8 +423,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
//That is, calling SetXXX(value) instead of using "XXX = value".
|
//That is, calling SetXXX(value) instead of using "XXX = value".
|
||||||
private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.AllowedDrop = Util.ReadBoolean(reader);
|
obj.AllowedDrop = Util.ReadBoolean(reader);
|
||||||
obj.SetAllowedDrop(Util.ReadBoolean(reader));
|
//obj.SetAllowedDrop(Util.ReadBoolean(reader));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessCreatorID(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessCreatorID(SceneObjectPart obj, XmlTextReader reader)
|
||||||
|
@ -489,32 +489,32 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
private static void ProcessGroupPosition(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessGroupPosition(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.GroupPosition = Util.ReadVector(reader, "GroupPosition");
|
obj.GroupPosition = Util.ReadVector(reader, "GroupPosition");
|
||||||
obj.SetGroupPosition(Util.ReadVector(reader, "GroupPosition"));
|
//obj.SetGroupPosition(Util.ReadVector(reader, "GroupPosition"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessOffsetPosition(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessOffsetPosition(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.OffsetPosition = Util.ReadVector(reader, "OffsetPosition"); ;
|
obj.OffsetPosition = Util.ReadVector(reader, "OffsetPosition"); ;
|
||||||
obj.SetOffsetPosition(Util.ReadVector(reader, "OffsetPosition"));
|
//obj.SetOffsetPosition(Util.ReadVector(reader, "OffsetPosition"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessRotationOffset(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessRotationOffset(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.RotationOffset = Util.ReadQuaternion(reader, "RotationOffset");
|
obj.RotationOffset = Util.ReadQuaternion(reader, "RotationOffset");
|
||||||
obj.SetRotationOffset(Util.ReadQuaternion(reader, "RotationOffset"));
|
//obj.SetRotationOffset(Util.ReadQuaternion(reader, "RotationOffset"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessVelocity(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessVelocity(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.Velocity = Util.ReadVector(reader, "Velocity");
|
obj.Velocity = Util.ReadVector(reader, "Velocity");
|
||||||
obj.SetVelocity(Util.ReadVector(reader, "Velocity"));
|
//obj.SetVelocity(Util.ReadVector(reader, "Velocity"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessAngularVelocity(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessAngularVelocity(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.AngularVelocity = Util.ReadVector(reader, "AngularVelocity");
|
obj.AngularVelocity = Util.ReadVector(reader, "AngularVelocity");
|
||||||
obj.SetVelocity(Util.ReadVector(reader, "AngularVelocity"));
|
//obj.SetVelocity(Util.ReadVector(reader, "AngularVelocity"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessAcceleration(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessAcceleration(SceneObjectPart obj, XmlTextReader reader)
|
||||||
|
@ -573,8 +573,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
//obj.Scale = Util.ReadVector(reader, "Scale");
|
obj.Scale = Util.ReadVector(reader, "Scale");
|
||||||
obj.SetScale(Util.ReadVector(reader, "Scale"));
|
//obj.SetScale(Util.ReadVector(reader, "Scale"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace OpenSim.Region.Framework.Scenes.Types
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Enqueue(SceneObjectPart part)
|
public void Enqueue(SceneObjectPart part)
|
||||||
{
|
{
|
||||||
lock (m_syncObject)
|
lock (m_syncObject)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue