From e2c2d92d5aba757e459d0362c9b7392b528d5c8d Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 18 Jan 2017 02:29:05 +0000 Subject: antecipate baked cache check and Xbakes requests, so they happen before viewer check request (or force it to wait via locking). --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 59 +++++++++++++----------- 1 file changed, 33 insertions(+), 26 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 9545c13..c4d4f8f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -2029,11 +2029,6 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement]: Missing COF for {0} is {1}", client.AgentId, COF); } - // Tell the client that we're totally ready - ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); - - m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); - if (!string.IsNullOrEmpty(m_callbackURI)) { // We cannot sleep here since this would hold up the inbound packet processing thread, as @@ -2054,6 +2049,7 @@ namespace OpenSim.Region.Framework.Scenes Scene.SimulationService.ReleaseAgent(originID, UUID, m_callbackURI); m_callbackURI = null; + m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); } // else // { @@ -2062,19 +2058,48 @@ namespace OpenSim.Region.Framework.Scenes // client.Name, client.AgentId, m_scene.RegionInfo.RegionName); // } - m_log.DebugFormat("[CompleteMovement] ReleaseAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); + + // Tell the client that we're totally ready + ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); + m_log.DebugFormat("[CompleteMovement] MoveAgentIntoRegion: {0}ms", Util.EnvironmentTickCountSubtract(ts)); + + bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; + + int delayctnr = Util.EnvironmentTickCount(); + + if (!IsChildAgent) + { + // verify baked textures and cache + bool cachedbaked = false; + + if (IsNPC) + cachedbaked = true; + else + { + if (m_scene.AvatarFactory != null && !isHGTP) + cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); + + // not sure we need this + if (!cachedbaked) + { + if (m_scene.AvatarFactory != null) + m_scene.AvatarFactory.QueueAppearanceSave(UUID); + } + } + m_log.DebugFormat("[CompleteMovement] Baked check: {0}ms", Util.EnvironmentTickCountSubtract(ts)); + } if(m_teleportFlags > 0) { gotCrossUpdate = false; // sanity check - Thread.Sleep(500); // let viewers catch us + if(Util.EnvironmentTickCountSubtract(delayctnr)< 500) + Thread.Sleep(500); // let viewers catch us } if(!gotCrossUpdate) RotateToLookAt(look); // HG - bool isHGTP = (m_teleportFlags & TeleportFlags.ViaHGLogin) != 0; if(isHGTP) { // ControllingClient.SendNameReply(m_uuid, Firstname, Lastname); @@ -2101,24 +2126,6 @@ namespace OpenSim.Region.Framework.Scenes if (!IsChildAgent) { - // verify baked textures and cache - bool cachedbaked = false; - - if (IsNPC) - cachedbaked = true; - else - { - if (m_scene.AvatarFactory != null && !isHGTP) - cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); - - // not sure we need this - if (!cachedbaked) - { - if (m_scene.AvatarFactory != null) - m_scene.AvatarFactory.QueueAppearanceSave(UUID); - } - } - List allpresences = m_scene.GetScenePresences(); // send avatar object to all presences including us, so they cross it into region -- cgit v1.1