From 9c552212a983c7e076c53340af9f47584d641aff Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 19 Sep 2014 16:51:51 +0100 Subject: [PATCH] exclude npcs from baked cache --- .../AvatarFactory/AvatarFactoryModule.cs | 10 +++++++++ .../Region/Framework/Scenes/ScenePresence.cs | 21 ++++++++++++------- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index dc165932f3..bd243ad619 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -366,6 +366,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // called on textures update public bool UpdateBakedTextureCache(IScenePresence sp, WearableCacheItem[] cacheItems) { + // npcs dont have baked cache + if (((ScenePresence)sp).isNPC) + return true; + // uploaded baked textures will be in assets local cache IAssetService cache = m_scene.AssetService; @@ -485,6 +489,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { int hits = 0; + if (((ScenePresence)sp).isNPC) + return true; + lock (m_setAppearanceLock) { IAssetService cache = m_scene.AssetService; @@ -650,6 +657,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory public int RequestRebake(IScenePresence sp, bool missingTexturesOnly) { + if (((ScenePresence)sp).isNPC) + return 0; + int texturesRebaked = 0; IImprovedAssetCache cache = m_scene.RequestModuleInterface(); diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9d06c26b20..9c55d4a68f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1703,6 +1703,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.DebugFormat("[CompleteMovement] WaitForUpdateAgent: {0}ms", Util.EnvironmentTickCountSubtract(ts)); bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); + if (!MakeRootAgent(AbsolutePosition, flying)) { m_log.DebugFormat( @@ -1724,7 +1725,7 @@ namespace OpenSim.Region.Framework.Scenes look = new Vector3(0.99f, 0.042f, 0); } - if (!IsChildAgent) + if (!IsChildAgent && !isNPC) { InventoryFolderBase cof = m_scene.InventoryService.GetFolderForType(client.AgentId, (AssetType)46); if (cof == null) @@ -1790,16 +1791,22 @@ namespace OpenSim.Region.Framework.Scenes // verify baked textures and cache + bool cachedbaked = false; - if (m_scene.AvatarFactory != null) - cachedbaked = m_scene.AvatarFactory.ValidateBakedTextureCache(this); - - // not sure we need this - if (!cachedbaked) + if (isNPC) + cachedbaked = true; + else { if (m_scene.AvatarFactory != null) - m_scene.AvatarFactory.QueueAppearanceSave(UUID); + 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();