Remove SceneViewer from ScenePresence to reduce quadruple queueing of

prim update to only triple queuing. Existing method was:
1. Schedule prim for update, adding to scene update list
2. Update on SOGs during heartbeat queues update onto each SceneViewer
3. Update on SPs during heartbeat queues update onto each IClientAPI
4. ProcessEntityUpdates queues updates into UDP send stack

Now the SceneViewer has been eliminated so updates are scheduled at any
time and then put onto the IClientAPI priority queues immediately during
SceneGraph.UpdateObjectGroups.
This commit is contained in:
Dan Lake
2011-11-11 17:16:52 -08:00
parent e61ea79c72
commit 5fd1749150
7 changed files with 22 additions and 427 deletions

View File

@@ -1373,25 +1373,6 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.Debug("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString());
}
/// <summary>
/// Tell all scene presences that they should send updates for this part to their clients
/// </summary>
public void AddFullUpdateToAllAvatars()
{
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
AddFullUpdateToAvatar(avatar);
});
}
/// <summary>
/// Tell the scene presence that it should send updates for this part to its client
/// </summary>
public void AddFullUpdateToAvatar(ScenePresence presence)
{
presence.SceneViewer.QueuePartForUpdate(this);
}
public void AddNewParticleSystem(Primitive.ParticleSystem pSystem)
{
m_particleSystem = pSystem.GetBytes();
@@ -1402,20 +1383,6 @@ namespace OpenSim.Region.Framework.Scenes
m_particleSystem = new byte[0];
}
/// Terse updates
public void AddTerseUpdateToAllAvatars()
{
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
AddTerseUpdateToAvatar(avatar);
});
}
public void AddTerseUpdateToAvatar(ScenePresence presence)
{
presence.SceneViewer.QueuePartForUpdate(this);
}
public void AddTextureAnimation(Primitive.TextureAnimation pTexAnim)
{
byte[] data = new byte[16];
@@ -2650,8 +2617,6 @@ namespace OpenSim.Region.Framework.Scenes
//ParentGroup.RootPart.m_groupPosition = newpos;
}
ScheduleTerseUpdate();
//SendTerseUpdateToAllClients();
}
public void PreloadSound(string sound)
@@ -2834,6 +2799,13 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentGroup == null)
return;
// This was pulled from SceneViewer. Attachments always receive full updates.
// I could not verify if this is a requirement but this maintains existing behavior
if (ParentGroup.IsAttachment)
{
ScheduleFullUpdate();
}
if (UpdateFlag == UpdateRequired.NONE)
{
ParentGroup.HasGroupChanged = true;
@@ -2927,23 +2899,6 @@ namespace OpenSim.Region.Framework.Scenes
});
}
/// <summary>
/// Send a full update to all clients except the one nominated.
/// </summary>
/// <param name="agentID"></param>
public void SendFullUpdateToAllClientsExcept(UUID agentID)
{
if (ParentGroup == null)
return;
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
{
// Ugly reference :(
if (avatar.UUID != agentID)
SendFullUpdate(avatar.ControllingClient, avatar.GenerateClientFlags(UUID));
});
}
/// <summary>
/// Sends a full update to the client
/// </summary>
@@ -3020,7 +2975,8 @@ namespace OpenSim.Region.Framework.Scenes
!OffsetPosition.ApproxEquals(m_lastPosition, POSITION_TOLERANCE) ||
Environment.TickCount - m_lastTerseSent > TIME_MS_TOLERANCE)
{
AddTerseUpdateToAllAvatars();
SendTerseUpdateToAllClients();
ClearUpdateSchedule();
// Update the "last" values
@@ -3035,7 +2991,7 @@ namespace OpenSim.Region.Framework.Scenes
}
case UpdateRequired.FULL:
{
AddFullUpdateToAllAvatars();
SendFullUpdateToAllClients();
break;
}
}
@@ -3140,9 +3096,9 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary>
public void SendTerseUpdateToAllClients()
{
ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
{
SendTerseUpdateToClient(avatar.ControllingClient);
SendTerseUpdateToClient(client);
});
}