On handling UpdatePrimProperties, if the properties updated are all in the terse-update

list, only trigger SOP.ScheduleTerseUpdate; otherwise, trigger ScheduleFullUpdate.
This is to prevent client managers to send big updates to clients, especially when a link-set
object moves around.
dsg
Huaiyu (Kitty) Liu 2011-06-03 11:35:37 -07:00
parent fa892e4afb
commit 06d002cc3b
3 changed files with 41 additions and 8 deletions

View File

@ -1570,9 +1570,25 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
//Enqueue the updated SOP and its properties for sync
ProcessAndEnqueuePrimUpdatesBySync(sop, propertiesUpdated);
//Calling SOP.ScheduleFullUpdate(), so that viewers, if any,
//Calling SOP.ScheduleFullUpdate() or ScheduleTerseUpdate(), so that viewers, if any,
//will receive updates as well.
sop.ScheduleFullUpdate(null);
bool allTerseUpdates = true;
foreach (SceneObjectPartSyncProperties prop in propertiesUpdated)
{
if (!PrimSyncInfo.TerseUpdateProperties.Contains(prop))
{
allTerseUpdates = false;
break;
}
}
if (allTerseUpdates)
{
sop.ScheduleTerseUpdate(null);
}
else
{
sop.ScheduleFullUpdate(null);
}
}
}
}
@ -3769,6 +3785,7 @@ namespace OpenSim.Region.CoreModules.RegionSync.RegionSyncModule
public static HashSet<SceneObjectPartSyncProperties> PrimPhysActorProperties = SceneObjectPart.GetAllPhysActorProperties();
public static HashSet<SceneObjectPartSyncProperties> PrimNonPhysActorProperties = SceneObjectPart.GetAllPrimNonPhysActorProperties();
public static HashSet<SceneObjectPartSyncProperties> GroupProperties = SceneObjectPart.GetGroupProperties();
public static HashSet<SceneObjectPartSyncProperties> TerseUpdateProperties = SceneObjectPart.GetTerseUpdateProperties();
private PrimSyncInfoManager m_syncInfoManager;

View File

@ -3686,7 +3686,7 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.stopLookAt();
//m_parentGroup.ScheduleGroupForTerseUpdate();
m_parentGroup.ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None});//in stopLookAt(), PhysicsActor shall already take care of tainting which properties have been updated
m_parentGroup.ScheduleGroupForTerseUpdate(null);//in stopLookAt(), PhysicsActor shall already take care of tainting which properties have been updated
}
/// <summary>
@ -3710,7 +3710,7 @@ namespace OpenSim.Region.Framework.Scenes
m_parentGroup.stopMoveToTarget();
//m_parentGroup.ScheduleGroupForTerseUpdate();
m_parentGroup.ScheduleGroupForTerseUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.None}); //in stopMoveToTarget(), PhysicsActor shall already take care of tainting which properties have been updated
m_parentGroup.ScheduleGroupForTerseUpdate(null); //in stopMoveToTarget(), PhysicsActor shall already take care of tainting which properties have been updated
//m_parentGroup.ScheduleGroupForFullUpdate();
}
@ -4271,7 +4271,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 newPos = new Vector3(pos.X, pos.Y, pos.Z);
GroupPosition = newPos;
//ScheduleTerseUpdate();
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.GroupPosition});
ScheduleTerseUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.GroupPosition });
}
}
@ -4304,7 +4304,7 @@ namespace OpenSim.Region.Framework.Scenes
OffsetPosition = newPos;
//ScheduleTerseUpdate();
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.OffsetPosition});
ScheduleTerseUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.OffsetPosition });
}
}
@ -4613,7 +4613,7 @@ namespace OpenSim.Region.Framework.Scenes
RotationOffset = rot;
ParentGroup.HasGroupChanged = true;
//ScheduleTerseUpdate();
ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>() {SceneObjectPartSyncProperties.RotationOffset});
ScheduleTerseUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.RotationOffset });
}
}
@ -5169,6 +5169,22 @@ namespace OpenSim.Region.Framework.Scenes
return allProperties;
}
public static HashSet<SceneObjectPartSyncProperties> GetTerseUpdateProperties()
{
HashSet<SceneObjectPartSyncProperties> allProperties = new HashSet<SceneObjectPartSyncProperties>();
allProperties.Add(SceneObjectPartSyncProperties.Velocity);
allProperties.Add(SceneObjectPartSyncProperties.RotationOffset);
allProperties.Add(SceneObjectPartSyncProperties.AngularVelocity);
allProperties.Add(SceneObjectPartSyncProperties.OffsetPosition);
allProperties.Add(SceneObjectPartSyncProperties.Scale);
allProperties.Add(SceneObjectPartSyncProperties.GroupPosition);
allProperties.Add(SceneObjectPartSyncProperties.Orientation);
allProperties.Add(SceneObjectPartSyncProperties.RotationalVelocity);
allProperties.Add(SceneObjectPartSyncProperties.Position);
return allProperties;
}
#endregion SceneObjectPartSyncProperties categorization
/*

View File

@ -3329,7 +3329,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
m_host.AddScriptLPS(1);
m_host.AngularVelocity = new Vector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
//m_host.ScheduleTerseUpdate();
m_host.ScheduleFullUpdate(new List<SceneObjectPartSyncProperties>(){SceneObjectPartSyncProperties.AngularVelocity});
m_host.ScheduleSyncUpdate(new List<SceneObjectPartSyncProperties>() { SceneObjectPartSyncProperties.AngularVelocity });
m_host.SendTerseUpdateToAllClients();
m_host.ParentGroup.HasGroupChanged = true;
}