From 5fd17491509fb4b939666cdc37951e213f054242 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Fri, 11 Nov 2011 17:16:52 -0800
Subject: 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.
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 68 ++++------------------
1 file changed, 12 insertions(+), 56 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 4e1383c..f693b36 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1373,25 +1373,6 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.Debug("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString());
}
- ///
- /// Tell all scene presences that they should send updates for this part to their clients
- ///
- public void AddFullUpdateToAllAvatars()
- {
- ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
- {
- AddFullUpdateToAvatar(avatar);
- });
- }
-
- ///
- /// Tell the scene presence that it should send updates for this part to its client
- ///
- 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;
@@ -2928,23 +2900,6 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Send a full update to all clients except the one nominated.
- ///
- ///
- 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));
- });
- }
-
- ///
/// Sends a full update to the client
///
///
@@ -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
///
public void SendTerseUpdateToAllClients()
{
- ParentGroup.Scene.ForEachScenePresence(delegate(ScenePresence avatar)
+ ParentGroup.Scene.ForEachClient(delegate(IClientAPI client)
{
- SendTerseUpdateToClient(avatar.ControllingClient);
+ SendTerseUpdateToClient(client);
});
}
--
cgit v1.1