Added SOP.HasPropertyUpdatedLocally() to help enqueue the right set of objects that have properties updated locally.

Also, in RegionSyncModule.SendSceneUpdates, added calling sog.UpdateTaintedBucketSyncInfo() to update timestamp of a tainted property bucket.
dsg
Huaiyu (Kitty) Liu 2011-02-11 16:23:03 -08:00
parent 7a331b6a8f
commit f47c301a56
3 changed files with 47 additions and 0 deletions

View File

@ -298,6 +298,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
if (!updated) if (!updated)
{ {
/*
foreach (KeyValuePair<string, BucketSyncInfo> pair in part.BucketSyncInfoList) foreach (KeyValuePair<string, BucketSyncInfo> pair in part.BucketSyncInfoList)
{ {
if (pair.Value.LastUpdateActorID.Equals(m_actorID)) if (pair.Value.LastUpdateActorID.Equals(m_actorID))
@ -306,6 +307,11 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
break; break;
} }
} }
* */
if (part.HasPropertyUpdatedLocally())
{
updated = true;
}
} }
if(updated) if(updated)
@ -368,6 +374,8 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
if (primUpdates != null || presenceUpdates != null) if (primUpdates != null || presenceUpdates != null)
{ {
long timeStamp = DateTime.Now.Ticks;
// This could be another thread for sending outgoing messages or just have the Queue functions // This could be another thread for sending outgoing messages or just have the Queue functions
// create and queue the messages directly into the outgoing server thread. // create and queue the messages directly into the outgoing server thread.
System.Threading.ThreadPool.QueueUserWorkItem(delegate System.Threading.ThreadPool.QueueUserWorkItem(delegate
@ -380,6 +388,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
foreach (SceneObjectGroup sog in primUpdates) foreach (SceneObjectGroup sog in primUpdates)
{ {
//If this is a relay node, or at least one part of the object has the last update caused by this actor, then send the update //If this is a relay node, or at least one part of the object has the last update caused by this actor, then send the update
sog.UpdateTaintedBucketSyncInfo(timeStamp);
if (m_isSyncRelay || (!sog.IsDeleted && CheckObjectForSendingUpdate(sog))) if (m_isSyncRelay || (!sog.IsDeleted && CheckObjectForSendingUpdate(sog)))
{ {
//send //send

View File

@ -4104,6 +4104,13 @@ namespace OpenSim.Region.Framework.Scenes
} }
public void UpdateTaintedBucketSyncInfo(long timeStamp)
{
foreach (SceneObjectPart part in Parts)
{
part.UpdateTaintedBucketSyncInfo(timeStamp);
}
}
#endregion #endregion
} }

View File

@ -5391,6 +5391,18 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
public bool HasPropertyUpdatedLocally()
{
bool updatedLocally = false;
foreach (KeyValuePair<string, bool> pair in m_bucketSyncTainted)
{
updatedLocally = pair.Value;
if (updatedLocally)
break;
}
return updatedLocally;
}
/* /*
public void ClearBucketTaint() public void ClearBucketTaint()
{ {
@ -5424,6 +5436,25 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
/// <summary>
/// Update the timestamp information of each property bucket, and clear out the taint on each bucket.
/// </summary>
public void UpdateTaintedBucketSyncInfo(long timeStamp)
{
if (m_syncEnabled)
{
foreach (KeyValuePair<string, BucketSyncInfo> pair in m_bucketSyncInfoList)
{
string bucketName = pair.Key;
if (m_bucketSyncTainted[bucketName])
{
m_bucketSyncInfoList[bucketName].UpdateSyncInfo(timeStamp, m_localActorID);
m_bucketSyncTainted[bucketName] = false;
}
}
}
}
/// <summary> /// <summary>
/// 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>