From b3a71c6df1538c61247f7d4711aba4c840508db8 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 24 Nov 2010 18:56:25 +0100
Subject: Prevent an overlength button label from producing a debug dump and
aborting the script.
---
.../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +-
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 2 +-
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 233 +++++++++++----------
3 files changed, 120 insertions(+), 117 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f3964c2..bcb715b 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -398,7 +398,7 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 offset = p.GetWorldPosition() - av.ParentPosition;
av.AbsolutePosition += offset;
av.ParentPosition = p.GetWorldPosition(); //ParentPosition gets cleared by AbsolutePosition
- av.SendFullUpdateToAllClients();
+ av.SendAvatarDataToAllAgents();
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index bdd42fc..8cc2be1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -803,7 +803,7 @@ namespace OpenSim.Region.Framework.Scenes
{
Vector3 offset = (m_offsetPosition - oldpos);
av.OffsetPosition += offset;
- av.SendFullUpdateToAllClients();
+ av.SendAvatarDataToAllAgents();
}
}
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c35df08..98a3b29 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -767,7 +767,9 @@ namespace OpenSim.Region.Framework.Scenes
// Note: This won't send data *to* other clients in that region (children don't send)
// MIC: This gets called again in CompleteMovement
- SendInitialFullUpdateToAllClients();
+ // SendInitialFullUpdateToAllClients();
+ SendOtherAgentsAvatarDataToMe();
+ SendOtherAgentsAppearanceToMe();
RegisterToEvents();
SetDirectionVectors();
@@ -1757,7 +1759,7 @@ namespace OpenSim.Region.Framework.Scenes
{
AbsolutePosition = part.AbsolutePosition;
Velocity = Vector3.Zero;
- SendFullUpdateToAllClients();
+ SendAvatarDataToAllAgents();
HandleAgentSit(ControllingClient, m_requestedSitTargetUUID); //KF ??
}
@@ -1867,7 +1869,7 @@ namespace OpenSim.Region.Framework.Scenes
m_parentID = 0;
m_linkedPrim = UUID.Zero;
m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
- SendFullUpdateToAllClients();
+ SendAvatarDataToAllAgents();
m_requestedSitTargetID = 0;
if (m_physicsActor != null && m_appearance != null)
{
@@ -2462,8 +2464,8 @@ namespace OpenSim.Region.Framework.Scenes
Velocity = Vector3.Zero;
RemoveFromPhysicalScene();
Animator.TrySetMovementAnimation(sitAnimation);
- SendFullUpdateToAllClients();
- SendTerseUpdateToAllClients();
+ SendAvatarDataToAllAgents();
+ //SendTerseUpdateToAllClients();
}
public void SitAltitudeCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal)
@@ -2742,165 +2744,169 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar)
+ /// Do everything required once a client completes its movement into a region and becomes
+ /// a root agent.
///
- ///
- public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar)
+ private void SendInitialData()
{
- // 2 stage check is needed.
- if (remoteAvatar == null)
- return;
+ // Moved this into CompleteMovement to ensure that m_appearance is initialized before
+ // the inventory arrives
+ // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
- IClientAPI cl = remoteAvatar.ControllingClient;
- if (cl == null)
- return;
+ // This agent just became root. We are going to tell everyone about it. The process of
+ // getting other avatars information was initiated in the constructor... don't do it
+ // again here...
+ SendAvatarDataToAllAgents();
- if (m_appearance.Texture == null)
- return;
-
-// MT: This is needed for sit. It's legal to send it to oneself, and the name
-// of the method is a misnomer
-//
-// if (LocalId == remoteAvatar.LocalId)
-// {
-// m_log.WarnFormat("[SCENEPRESENCE]: An agent is attempting to send avatar data to itself; {0}", UUID);
-// return;
-// }
+ // We have an appearance but we may not have the baked textures. Check the asset cache
+ // to see if all the baked textures are already here.
+ if (m_scene.AvatarFactory != null)
+ {
+ if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient))
+ {
+// m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
+ SendAppearanceToAgent(this);
- if (IsChildAgent)
+ // If the avatars baked textures are all in the cache, then we have a
+ // complete appearance... send it out, if not, then we'll send it when
+ // the avatar finishes updating its appearance
+ SendAppearanceToAllOtherAgents();
+ }
+ }
+ else
{
- m_log.WarnFormat("[SCENEPRESENCE]: A child agent is attempting to send out avatar data; {0}", UUID);
- return;
+ m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name);
}
-
- remoteAvatar.m_controllingClient.SendAvatarDataImmediate(this);
- m_scene.StatsReporter.AddAgentUpdates(1);
}
///
- /// Tell *ALL* agents about this agent
+ /// Send this agent's avatar data to all other root and child agents in the scene
+ /// This agent must be root. This avatar will receive its own update.
///
- public void SendInitialFullUpdateToAllClients()
+ public void SendAvatarDataToAllAgents()
{
- m_perfMonMS = Util.EnvironmentTickCount();
- int avUpdates = 0;
- m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
+ // only send update from root agents to other clients; children are only "listening posts"
+ if (IsChildAgent)
{
- ++avUpdates;
-
- // Don't update ourselves
- if (avatar.LocalId == LocalId)
- return;
-
- // If this is a root agent, then get info about the avatar
- if (!IsChildAgent)
- {
- SendFullUpdateToOtherClient(avatar);
- }
+ m_log.Warn("[SCENEPRESENCE] attempt to send avatar data from a child agent");
+ return;
+ }
+
+ m_perfMonMS = Util.EnvironmentTickCount();
- // If the other avatar is a root
- if (!avatar.IsChildAgent)
- {
- avatar.SendFullUpdateToOtherClient(this);
- avatar.SendAppearanceToOtherAgent(this);
- avatar.Animator.SendAnimPackToClient(ControllingClient);
- }
- });
+ int count = 0;
+ m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
+ {
+ SendAvatarDataToAgent(scenePresence);
+ count++;
+ });
- m_scene.StatsReporter.AddAgentUpdates(avUpdates);
+ m_scene.StatsReporter.AddAgentUpdates(count);
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
-
- //Animator.SendAnimPack();
}
- public void SendFullUpdateToAllClients()
+ ///
+ /// Send avatar data for all other root agents to this agent, this agent
+ /// can be either a child or root
+ ///
+ public void SendOtherAgentsAvatarDataToMe()
{
m_perfMonMS = Util.EnvironmentTickCount();
- // only send update from root agents to other clients; children are only "listening posts"
- if (IsChildAgent)
- {
- m_log.Warn("[SCENEPRESENCE] attempt to send update from a childagent");
- return;
- }
-
int count = 0;
- m_scene.ForEachScenePresence(delegate(ScenePresence sp)
- {
- if (sp.IsChildAgent)
- return;
- SendFullUpdateToOtherClient(sp);
- ++count;
- });
+ m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
+ {
+ // only send information about root agents
+ if (scenePresence.IsChildAgent)
+ return;
+
+ // only send information about other root agents
+ if (scenePresence.UUID == UUID)
+ return;
+
+ scenePresence.SendAvatarDataToAgent(this);
+ count++;
+ });
+
m_scene.StatsReporter.AddAgentUpdates(count);
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
-
- Animator.SendAnimPack();
}
///
- /// Do everything required once a client completes its movement into a region
+ /// Send avatar data to an agent.
///
- public void SendInitialData()
+ ///
+ private void SendAvatarDataToAgent(ScenePresence avatar)
{
- // Moved this into CompleteMovement to ensure that m_appearance is initialized before
- // the inventory arrives
- // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance);
+// m_log.WarnFormat("[SP] Send avatar data from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
- m_controllingClient.SendAvatarDataImmediate(this);
- if (m_scene.AvatarFactory != null)
- {
- if (m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient))
- {
-// m_log.WarnFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
- m_controllingClient.SendAppearance(
- m_appearance.Owner,m_appearance.VisualParams,m_appearance.Texture.GetBytes());
- }
- }
- else
+ avatar.ControllingClient.SendAvatarDataImmediate(this);
+ Animator.SendAnimPackToClient(avatar.ControllingClient);
+ }
+
+ ///
+ /// Send this agent's appearance to all other root and child agents in the scene
+ /// This agent must be root.
+ ///
+ public void SendAppearanceToAllOtherAgents()
+ {
+ // only send update from root agents to other clients; children are only "listening posts"
+ if (IsChildAgent)
{
- m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name);
+ m_log.Warn("[SCENEPRESENCE] attempt to send avatar data from a child agent");
+ return;
}
+
+ m_perfMonMS = Util.EnvironmentTickCount();
+
+ int count = 0;
+ m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
+ {
+ if (scenePresence.UUID == UUID)
+ return;
- SendInitialFullUpdateToAllClients();
+ SendAppearanceToAgent(scenePresence);
+ count++;
+ });
+
+ m_scene.StatsReporter.AddAgentUpdates(count);
+ m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
- ///
+ /// Send appearance from all other root agents to this agent. this agent
+ /// can be either root or child
///
- public void SendAppearanceToAllOtherAgents()
+ public void SendOtherAgentsAppearanceToMe()
{
-// DEBUG ON
-// m_log.WarnFormat("[SCENEPRESENCE]: Send appearance from {0} to all other agents", m_uuid);
-// DEBUG OFF
m_perfMonMS = Util.EnvironmentTickCount();
+ int count = 0;
m_scene.ForEachScenePresence(delegate(ScenePresence scenePresence)
{
- if (scenePresence.UUID != UUID)
- {
- SendAppearanceToOtherAgent(scenePresence);
- }
+ // only send information about root agents
+ if (scenePresence.IsChildAgent)
+ return;
+
+ // only send information about other root agents
+ if (scenePresence.UUID == UUID)
+ return;
+
+ scenePresence.SendAppearanceToAgent(this);
+ count++;
});
+ m_scene.StatsReporter.AddAgentUpdates(count);
m_scene.StatsReporter.AddAgentTime(Util.EnvironmentTickCountSubtract(m_perfMonMS));
}
///
- /// Send appearance data to an agent that isn't this one.
+ /// Send appearance data to an agent.
///
///
- public void SendAppearanceToOtherAgent(ScenePresence avatar)
+ private void SendAppearanceToAgent(ScenePresence avatar)
{
- if (LocalId == avatar.LocalId)
- {
- m_log.WarnFormat("[SCENE PRESENCE]: An agent is attempting to send appearance data to itself; {0}", UUID);
- return;
- }
-
-// DEBUG ON
// m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId);
-// DEBUG OFF
avatar.ControllingClient.SendAppearance(
m_appearance.Owner, m_appearance.VisualParams, m_appearance.Texture.GetBytes());
@@ -3413,9 +3419,6 @@ namespace OpenSim.Region.Framework.Scenes
public void CopyFrom(AgentData cAgent)
{
-// DEBUG ON
- m_log.ErrorFormat("[SCENEPRESENCE] CALLING COPYFROM");
-// DEBUG OFF
m_originRegionID = cAgent.RegionID;
m_callbackURI = cAgent.CallbackURI;
--
cgit v1.1