From df860516bf4fa4e4196be4d5fc26db71d98334f4 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Fri, 3 Dec 2010 16:17:50 -0800 Subject: Various bug fixes for appearance handling: more aggressive reset of textures and vparams when appearance is not cached and when wearables change. Send appearance to the viewer with initial data. Cleaned up (and added) debugging. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 46 +++++++++++++++--------- 1 file changed, 30 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 82214bf..a1c80e5 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2418,30 +2418,44 @@ namespace OpenSim.Region.Framework.Scenes // the inventory arrives // m_scene.GetAvatarAppearance(m_controllingClient, out m_appearance); - // 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(); + bool cachedappearance = false; // 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 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(); - } + cachedappearance = m_scene.AvatarFactory.ValidateBakedTextureCache(m_controllingClient); } else { m_log.WarnFormat("[SCENEPRESENCE]: AvatarFactory not set for {0}", Name); } + + // If we aren't using a cached appearance, then clear out the baked textures + if (! cachedappearance) + { + m_appearance.ResetAppearance(); + if (m_scene.AvatarFactory != null) + m_scene.AvatarFactory.QueueAppearanceSave(UUID); + } + + // 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... this comes after the cached appearance check because the avatars + // appearance goes into the avatar update packet + SendAvatarDataToAllAgents(); + SendAppearanceToAgent(this); + + // If we are using the the cached appearance then send it out to everyone + if (cachedappearance) + { + m_log.InfoFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); + + // 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(); + } } /// @@ -2501,7 +2515,7 @@ namespace OpenSim.Region.Framework.Scenes /// Send avatar data to an agent. /// /// - private void SendAvatarDataToAgent(ScenePresence avatar) + public void SendAvatarDataToAgent(ScenePresence avatar) { // m_log.WarnFormat("[SP] Send avatar data from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); @@ -2569,7 +2583,7 @@ namespace OpenSim.Region.Framework.Scenes /// Send appearance data to an agent. /// /// - private void SendAppearanceToAgent(ScenePresence avatar) + public void SendAppearanceToAgent(ScenePresence avatar) { // m_log.WarnFormat("[SP] Send appearance from {0} to {1}",m_uuid,avatar.ControllingClient.AgentId); -- cgit v1.1