Modified/added set functions for SOP properties: "AllowedDrop" to "Material", as listed in SceneObjectSerializer().

dsg
Huaiyu (Kitty) Liu 2011-02-04 15:01:38 -08:00
parent 4fe0c6d0d2
commit 2ae8917c2e
2 changed files with 114 additions and 9 deletions

View File

@ -511,9 +511,16 @@ namespace OpenSim.Region.Framework.Scenes
} }
set set
{ {
_creatorID = value; SetCreatorID(value);
UpdateBucketSyncInfo("CreatorID");
//_creatorID = value;
} }
} }
//SYMMETRIC SYNC
public void SetCreatorID(UUID value)
{
_creatorID = value;
}
/// <summary> /// <summary>
/// Data about the creator in the form profile_url;name /// Data about the creator in the form profile_url;name
@ -521,7 +528,17 @@ namespace OpenSim.Region.Framework.Scenes
public string CreatorData public string CreatorData
{ {
get { return m_creatorData; } get { return m_creatorData; }
set { m_creatorData = value; } set
{
SetCreatorData(value);
UpdateBucketSyncInfo("CreatorData");
//m_creatorData = value;
}
}
//SYMMETRIC SYNC
public void SetCreatorData(string value)
{
m_creatorData = value;
} }
/// <summary> /// <summary>
@ -637,11 +654,22 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_name; } get { return m_name; }
set set
{ {
/*
m_name = value; m_name = value;
if (PhysActor != null) if (PhysActor != null)
{ {
PhysActor.SOPName = value; PhysActor.SOPName = value;
} }
* */
}
}
//SYMMETRIC SYNC
public void SetName(string value)
{
m_name = value;
if (PhysActor != null)
{
PhysActor.SOPName = value;
} }
} }
@ -650,13 +678,27 @@ namespace OpenSim.Region.Framework.Scenes
get { return (byte) m_material; } get { return (byte) m_material; }
set set
{ {
SetMaterial(value);
UpdateBucketSyncInfo("Material");
/*
m_material = (Material)value; m_material = (Material)value;
if (PhysActor != null) if (PhysActor != null)
{ {
PhysActor.SetMaterial((int)value); PhysActor.SetMaterial((int)value);
} }
* */
} }
} }
//SYMMETRIC SYNC
public void SetMaterial(byte value)
{
m_material = (Material)value;
if (PhysActor != null)
{
PhysActor.SetMaterial((int)value);
}
}
public bool PassTouches public bool PassTouches
{ {
@ -3060,6 +3102,10 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true; ParentGroup.HasGroupChanged = true;
ScheduleFullUpdate(); ScheduleFullUpdate();
//SYMMETRIC SYNC
//Make sure we record down the timestamp info for synchronization purpose
UpdateBucketSyncInfo("Scale");
} }
public void RotLookAt(Quaternion target, float strength, float damping) public void RotLookAt(Quaternion target, float strength, float damping)
@ -5558,7 +5604,7 @@ namespace OpenSim.Region.Framework.Scenes
SetAngularVelocity(updatedPart.AngularVelocity); SetAngularVelocity(updatedPart.AngularVelocity);
SetRotationOffset(updatedPart.RotationOffset); SetRotationOffset(updatedPart.RotationOffset);
//implementation in PhysicsActor //properties in Physics bucket whose update processors are in PhysicsActor
/* /*
"Position": "Position":
"Size": "Size":
@ -5595,7 +5641,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
string bucketName = m_propertyBucketNames[i]; string bucketName = m_propertyBucketNames[i];
//If the object is created by de-serialization, then it already has m_bucketSyncInfoList populated with the right number of buckets. //If the object is created by de-serialization, then it may already have m_bucketSyncInfoList populated with the right number of buckets.
//If the deserilaization is due to receiving a sync message, then m_bucketSyncInfoList should already be filled with sync info. //If the deserilaization is due to receiving a sync message, then m_bucketSyncInfoList should already be filled with sync info.
if (!m_bucketSyncInfoList.ContainsKey(bucketName)) if (!m_bucketSyncInfoList.ContainsKey(bucketName))
{ {
@ -5619,7 +5665,7 @@ namespace OpenSim.Region.Framework.Scenes
/// Update the timestamp and actorID information of the bucket the given property belongs to. /// Update the timestamp and actorID information of the bucket the given property belongs to.
/// </summary> /// </summary>
/// <param name="propertyName">Name of the property. Make sure the spelling is consistent with what are defined in PropertyList</param> /// <param name="propertyName">Name of the property. Make sure the spelling is consistent with what are defined in PropertyList</param>
private void UpdateBucketSyncInfo(string propertyName) public void UpdateBucketSyncInfo(string propertyName)
{ {
if (m_bucketSyncInfoList != null && m_bucketSyncInfoList.Count>0) if (m_bucketSyncInfoList != null && m_bucketSyncInfoList.Count>0)
{ {

View File

@ -76,7 +76,19 @@ namespace OpenSim.Region.Framework.Scenes
protected internal uint Serial protected internal uint Serial
{ {
get { return m_inventorySerial; } get { return m_inventorySerial; }
set { m_inventorySerial = value; } set
{
SetSerial(value);
m_part.UpdateBucketSyncInfo("InventorySerial");
//m_inventorySerial = value;
}
}
//SYMMETRIC SYNC
protected void SetSerial(uint value)
{
m_inventorySerial = value;
} }
/// <value> /// <value>
@ -87,10 +99,19 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_items; } get { return m_items; }
set set
{ {
m_items = value; SetItems(value);
m_inventorySerial++; m_part.UpdateBucketSyncInfo("TaskInventory");
m_part.UpdateBucketSyncInfo("InventorySerial");
//m_items = value;
//m_inventorySerial++;
} }
} }
//SYMMETRIC SYNC
protected void SetItems(TaskInventoryDictionary value)
{
m_items = value;
m_inventorySerial++;
}
/// <summary> /// <summary>
/// Constructor /// Constructor
@ -136,6 +157,10 @@ 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
} }
} }
@ -152,6 +177,9 @@ 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.
} }
} }
@ -182,6 +210,9 @@ namespace OpenSim.Region.Framework.Scenes
item.PermsGranter = UUID.Zero; item.PermsGranter = UUID.Zero;
} }
} }
//SYMMETRIC SYNC
m_part.UpdateBucketSyncInfo("TaskInventory");
} }
/// <summary> /// <summary>
@ -213,6 +244,12 @@ 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>
@ -543,7 +580,11 @@ 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>
@ -564,6 +605,9 @@ 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>
@ -722,6 +766,10 @@ 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
@ -765,6 +813,10 @@ 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;
} }
@ -1019,6 +1071,9 @@ 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");
} }
} }
} }
@ -1035,6 +1090,10 @@ 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()