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
{
_creatorID = value;
SetCreatorID(value);
UpdateBucketSyncInfo("CreatorID");
//_creatorID = value;
}
}
//SYMMETRIC SYNC
public void SetCreatorID(UUID value)
{
_creatorID = value;
}
/// <summary>
/// Data about the creator in the form profile_url;name
@ -521,7 +528,17 @@ namespace OpenSim.Region.Framework.Scenes
public string 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>
@ -637,11 +654,22 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_name; }
set
{
/*
m_name = value;
if (PhysActor != null)
{
PhysActor.SOPName = value;
}
* */
}
}
//SYMMETRIC SYNC
public void SetName(string value)
{
m_name = value;
if (PhysActor != null)
{
PhysActor.SOPName = value;
}
}
@ -649,6 +677,20 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return (byte) m_material; }
set
{
SetMaterial(value);
UpdateBucketSyncInfo("Material");
/*
m_material = (Material)value;
if (PhysActor != null)
{
PhysActor.SetMaterial((int)value);
}
* */
}
}
//SYMMETRIC SYNC
public void SetMaterial(byte value)
{
m_material = (Material)value;
if (PhysActor != null)
@ -656,7 +698,7 @@ namespace OpenSim.Region.Framework.Scenes
PhysActor.SetMaterial((int)value);
}
}
}
public bool PassTouches
{
@ -3060,6 +3102,10 @@ namespace OpenSim.Region.Framework.Scenes
ParentGroup.HasGroupChanged = true;
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)
@ -5558,7 +5604,7 @@ namespace OpenSim.Region.Framework.Scenes
SetAngularVelocity(updatedPart.AngularVelocity);
SetRotationOffset(updatedPart.RotationOffset);
//implementation in PhysicsActor
//properties in Physics bucket whose update processors are in PhysicsActor
/*
"Position":
"Size":
@ -5595,7 +5641,7 @@ namespace OpenSim.Region.Framework.Scenes
{
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 (!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.
/// </summary>
/// <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)
{

View File

@ -76,7 +76,19 @@ namespace OpenSim.Region.Framework.Scenes
protected internal uint Serial
{
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>
@ -86,11 +98,20 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return m_items; }
set
{
SetItems(value);
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>
/// Constructor
@ -136,6 +157,10 @@ namespace OpenSim.Region.Framework.Scenes
item.ResetIDs(m_part.UUID);
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;
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;
}
}
//SYMMETRIC SYNC
m_part.UpdateBucketSyncInfo("TaskInventory");
}
/// <summary>
@ -213,6 +244,12 @@ namespace OpenSim.Region.Framework.Scenes
if (groupID != item.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>
@ -543,7 +580,11 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ParentGroup.HasGroupChanged = true;
//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>
@ -564,6 +605,9 @@ namespace OpenSim.Region.Framework.Scenes
}
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>
@ -722,6 +766,10 @@ namespace OpenSim.Region.Framework.Scenes
HasInventoryChanged = true;
m_part.ParentGroup.HasGroupChanged = true;
}
//SYMMETRIC SYNC
m_part.UpdateBucketSyncInfo("TaskInventory");
m_part.UpdateBucketSyncInfo("InventorySerial");
return true;
}
else
@ -765,6 +813,10 @@ namespace OpenSim.Region.Framework.Scenes
m_part.ScheduleFullUpdate();
//SYMMETRIC SYNC
m_part.UpdateBucketSyncInfo("TaskInventory");
m_part.UpdateBucketSyncInfo("InventorySerial");
return type;
}
@ -1019,6 +1071,9 @@ namespace OpenSim.Region.Framework.Scenes
item.OwnerChanged = true;
item.PermsMask = 0;
item.PermsGranter = UUID.Zero;
//SYMMETRIC SYNC
m_part.UpdateBucketSyncInfo("TaskInventory");
}
}
}
@ -1035,6 +1090,10 @@ namespace OpenSim.Region.Framework.Scenes
}
m_inventorySerial++;
HasInventoryChanged = true;
//SYMMETRIC SYNC
m_part.UpdateBucketSyncInfo("TaskInventory");
m_part.UpdateBucketSyncInfo("InventorySerial");
}
public bool ContainsScripts()