From dfa9ba0937f6e2d30e1d541d64533ede4ecb671e Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 7 Aug 2014 08:47:03 +0100 Subject: minor clean, dont check for cache if we aren't using it.. --- .../Region/ClientStack/Linden/UDP/LLClientView.cs | 104 +++++---------------- 1 file changed, 22 insertions(+), 82 deletions(-) (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs') diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index def1f8e..e9a087b 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -12011,120 +12011,60 @@ namespace OpenSim.Region.ClientStack.LindenUDP AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); if (cachedtex.AgentData.SessionID != SessionId) - return false; + return false; // TODO: don't create new blocks if recycling an old packet cachedresp.AgentData.AgentID = AgentId; cachedresp.AgentData.SessionID = m_sessionId; -// cachedresp.AgentData.SerialNum = m_cachedTextureSerial; -// m_cachedTextureSerial++; cachedresp.AgentData.SerialNum = cachedtex.AgentData.SerialNum; cachedresp.WearableData = new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length]; - //IAvatarFactoryModule fac = m_scene.RequestModuleInterface(); - // var item = fac.GetBakedTextureFaces(AgentId); - //WearableCacheItem[] items = fac.GetCachedItems(AgentId); - - IAssetService cache = m_scene.AssetService; - //bakedTextureModule = null; int maxWearablesLoop = cachedtex.WearableData.Length; if (maxWearablesLoop > AvatarWearable.MAX_WEARABLES) maxWearablesLoop = AvatarWearable.MAX_WEARABLES; int cacheHits = 0; - if (cache != null) - { - // We need to make sure the asset stored in the bake is available on this server also by it's assetid before we map it to a Cacheid - - WearableCacheItem[] cacheItems = null; - - ScenePresence p = m_scene.GetScenePresence(AgentId); - - if (p!= null && p.Appearance != null) - { - /* we should only check bakedTextureModule at login or when appearance changes - if (p.Appearance.WearableCacheItems == null) // currently with a caching only bakemodule Appearance.Wearables.dirty as no use - { - IBakedTextureModule bakedTextureModule = m_scene.RequestModuleInterface(); - if (bakedTextureModule != null) - { - m_log.Debug("[ HandleAgentTextureCached] bakedTextureModule"); - try - { - cacheItems = bakedTextureModule.Get(AgentId); - p.Appearance.WearableCacheItems = cacheItems; - p.Appearance.WearableCacheItemsDirty = false; + // We need to make sure the asset stored in the bake is available on this server also by it's assetid before we map it to a Cacheid - if (cacheItems != null) - { - foreach (WearableCacheItem item in cacheItems) - { - if (item.TextureAsset != null) - { - item.TextureAsset.Temporary = true; - item.TextureAsset.Local = true; - cache.Store(item.TextureAsset); - } - } - } - } + WearableCacheItem[] cacheItems = null; - catch (Exception) - { - cacheItems = null; - } - } - } + ScenePresence p = m_scene.GetScenePresence(AgentId); - else if (p.Appearance.WearableCacheItems != null) - { - cacheItems = p.Appearance.WearableCacheItems; - } -*/ - cacheItems = p.Appearance.WearableCacheItems; - } + if (p != null && p.Appearance != null) + { + cacheItems = p.Appearance.WearableCacheItems; + } - if (cacheItems != null) + if (cacheItems != null) + { + for (int i = 0; i < maxWearablesLoop; i++) { - for (int i = 0; i < maxWearablesLoop; i++) - { - int idx = cachedtex.WearableData[i].TextureIndex; + int idx = cachedtex.WearableData[i].TextureIndex; - cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); - cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; - cachedresp.WearableData[i].HostName = new byte[0]; - if (cachedtex.WearableData[i].ID == cacheItems[idx].CacheId) - { - cachedresp.WearableData[i].TextureID = cacheItems[idx].TextureID; - cacheHits++; - } - else - { - cachedresp.WearableData[i].TextureID = UUID.Zero; - } + cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); + cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; + cachedresp.WearableData[i].HostName = new byte[0]; + if (cachedtex.WearableData[i].ID == cacheItems[idx].CacheId) + { + cachedresp.WearableData[i].TextureID = cacheItems[idx].TextureID; + cacheHits++; } - } - else - { - for (int i = 0; i < maxWearablesLoop; i++) + else { - cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); - cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; cachedresp.WearableData[i].TextureID = UUID.Zero; - //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); - cachedresp.WearableData[i].HostName = new byte[0]; } } } - else // no cache + else { for (int i = 0; i < maxWearablesLoop; i++) { cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; cachedresp.WearableData[i].TextureID = UUID.Zero; + //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); cachedresp.WearableData[i].HostName = new byte[0]; } } -- cgit v1.1