Updated PrimSyncInfo.CompareAndUpdateHashedValueByLocal, to overwrite SOP's
properties Shape and TaskInventory if PrimSyncInfo's value has newer timestamp.dsg
parent
7c033f9d08
commit
2f41b216d3
|
@ -3427,7 +3427,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
|
|
||||||
private bool CompareAndUpdateHashedValueByLocal(SceneObjectPart part, SceneObjectPartProperties property, ulong lastUpdateTS, string syncID)
|
private bool CompareAndUpdateHashedValueByLocal(SceneObjectPart part, SceneObjectPartProperties property, ulong lastUpdateTS, string syncID)
|
||||||
{
|
{
|
||||||
bool isLocalValueDifferent = false;
|
bool updated = false;
|
||||||
switch (property)
|
switch (property)
|
||||||
{
|
{
|
||||||
case SceneObjectPartProperties.Shape:
|
case SceneObjectPartProperties.Shape:
|
||||||
|
@ -3436,7 +3436,17 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
//primShapeString.GetHashCode
|
//primShapeString.GetHashCode
|
||||||
if (!m_propertiesSyncInfo[property].IsHashValueEqual(primShapeStringHash))
|
if (!m_propertiesSyncInfo[property].IsHashValueEqual(primShapeStringHash))
|
||||||
{
|
{
|
||||||
UpdatePropertySyncInfoByLocal(property, lastUpdateTS, syncID, (Object)primShapeString, primShapeStringHash);
|
if (lastUpdateTS > m_propertiesSyncInfo[property].LastUpdateTimeStamp)
|
||||||
|
{
|
||||||
|
UpdatePropertySyncInfoByLocal(property, lastUpdateTS, syncID, (Object)primShapeString, primShapeStringHash);
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
else if (lastUpdateTS > m_propertiesSyncInfo[property].LastUpdateTimeStamp)
|
||||||
|
{
|
||||||
|
PrimitiveBaseShape shape = DeSerializeShape((string)m_propertiesSyncInfo[property].LastUpdateValue);
|
||||||
|
part.Shape = shape;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SceneObjectPartProperties.TaskInventory:
|
case SceneObjectPartProperties.TaskInventory:
|
||||||
|
@ -3444,13 +3454,22 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
string primTaskInventoryStringHash = Util.Md5Hash(primTaskInventoryString);
|
string primTaskInventoryStringHash = Util.Md5Hash(primTaskInventoryString);
|
||||||
if (!m_propertiesSyncInfo[property].IsHashValueEqual(primTaskInventoryStringHash))
|
if (!m_propertiesSyncInfo[property].IsHashValueEqual(primTaskInventoryStringHash))
|
||||||
{
|
{
|
||||||
UpdatePropertySyncInfoByLocal(property, lastUpdateTS, syncID, (Object)primTaskInventoryString, primTaskInventoryStringHash);
|
if (lastUpdateTS > m_propertiesSyncInfo[property].LastUpdateTimeStamp)
|
||||||
|
{
|
||||||
|
UpdatePropertySyncInfoByLocal(property, lastUpdateTS, syncID, (Object)primTaskInventoryString, primTaskInventoryStringHash);
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
else if (lastUpdateTS > m_propertiesSyncInfo[property].LastUpdateTimeStamp)
|
||||||
|
{
|
||||||
|
TaskInventoryDictionary taskInv = DeSerializeTaskInventory((string)m_propertiesSyncInfo[property].LastUpdateValue);
|
||||||
|
part.TaskInventory = taskInv;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return isLocalValueDifferent;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string SerializePrimPropertyShape(SceneObjectPart part)
|
private string SerializePrimPropertyShape(SceneObjectPart part)
|
||||||
|
@ -3467,6 +3486,14 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
return serializedShape;
|
return serializedShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TO BE TESTED
|
||||||
|
private PrimitiveBaseShape DeSerializeShape(string shapeString)
|
||||||
|
{
|
||||||
|
StringReader sr = new StringReader(shapeString);
|
||||||
|
XmlTextReader reader = new XmlTextReader(sr);
|
||||||
|
return SceneObjectSerializer.ReadShape(reader, "Shape");
|
||||||
|
}
|
||||||
|
|
||||||
private string SerializePrimPropertyTaskInventory(SceneObjectPart part)
|
private string SerializePrimPropertyTaskInventory(SceneObjectPart part)
|
||||||
{
|
{
|
||||||
string serializedTaskInventory;
|
string serializedTaskInventory;
|
||||||
|
@ -3481,7 +3508,12 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
|
||||||
return serializedTaskInventory;
|
return serializedTaskInventory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TaskInventoryDictionary DeSerializeTaskInventory(string taskInvString)
|
||||||
|
{
|
||||||
|
StringReader sr = new StringReader(taskInvString);
|
||||||
|
XmlTextReader reader = new XmlTextReader(sr);
|
||||||
|
return SceneObjectSerializer.ReadTaskInventory(reader, "TaskInventory");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Compare the value (not "reference") of the given property.
|
/// Compare the value (not "reference") of the given property.
|
||||||
|
|
|
@ -1600,7 +1600,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
|
//DSG SYNC: make it public to be called outside
|
||||||
|
//static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
|
||||||
|
public static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name)
|
||||||
{
|
{
|
||||||
TaskInventoryDictionary tinv = new TaskInventoryDictionary();
|
TaskInventoryDictionary tinv = new TaskInventoryDictionary();
|
||||||
|
|
||||||
|
@ -1639,7 +1641,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
return tinv;
|
return tinv;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
|
//DSG SYNC: make it public to be called outside
|
||||||
|
//static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
|
||||||
|
public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name)
|
||||||
{
|
{
|
||||||
PrimitiveBaseShape shape = new PrimitiveBaseShape();
|
PrimitiveBaseShape shape = new PrimitiveBaseShape();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue