aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs134
1 files changed, 118 insertions, 16 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 7364f45..465d76d 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3629,7 +3629,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3629 3629
3630 avp.Sender.IsTrial = false; 3630 avp.Sender.IsTrial = false;
3631 avp.Sender.ID = agentID; 3631 avp.Sender.ID = agentID;
3632 //m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString()); 3632 m_log.DebugFormat("[CLIENT]: Sending appearance for {0} to {1}", agentID.ToString(), AgentId.ToString());
3633 OutPacket(avp, ThrottleOutPacketType.State); 3633 OutPacket(avp, ThrottleOutPacketType.State);
3634 } 3634 }
3635 3635
@@ -11725,32 +11725,134 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11725 // var item = fac.GetBakedTextureFaces(AgentId); 11725 // var item = fac.GetBakedTextureFaces(AgentId);
11726 //WearableCacheItem[] items = fac.GetCachedItems(AgentId); 11726 //WearableCacheItem[] items = fac.GetCachedItems(AgentId);
11727 11727
11728 IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); 11728 IAssetService cache = m_scene.AssetService;
11729 if (cache == null) 11729 IBakedTextureModule bakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
11730 //bakedTextureModule = null;
11731 int maxWearablesLoop = cachedtex.WearableData.Length;
11732 if (maxWearablesLoop > AvatarWearable.MAX_WEARABLES)
11733 maxWearablesLoop = AvatarWearable.MAX_WEARABLES;
11734
11735 if (bakedTextureModule != null && cache != null)
11730 { 11736 {
11731 for (int i = 0; i < cachedtex.WearableData.Length; i++) 11737 // 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
11738
11739 WearableCacheItem[] cacheItems = null;
11740 ScenePresence p = m_scene.GetScenePresence(AgentId);
11741 if (p.Appearance != null)
11742 if (p.Appearance.WearableCacheItems == null || p.Appearance.WearableCacheItemsDirty)
11743 {
11744 try
11745 {
11746 cacheItems = bakedTextureModule.Get(AgentId);
11747 p.Appearance.WearableCacheItems = cacheItems;
11748 p.Appearance.WearableCacheItemsDirty = false;
11749 }
11750
11751 /*
11752 * The following Catch types DO NOT WORK, it jumps to the General Packet Exception Handler if you don't catch Exception!
11753 *
11754 catch (System.Net.Sockets.SocketException)
11755 {
11756 cacheItems = null;
11757 }
11758 catch (WebException)
11759 {
11760 cacheItems = null;
11761 }
11762 catch (InvalidOperationException)
11763 {
11764 cacheItems = null;
11765 } */
11766 catch (Exception)
11767 {
11768 cacheItems = null;
11769 }
11770
11771 }
11772 else if (p.Appearance.WearableCacheItems != null)
11773 {
11774 cacheItems = p.Appearance.WearableCacheItems;
11775 }
11776
11777 if (cache != null && cacheItems != null)
11732 { 11778 {
11733 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); 11779 foreach (WearableCacheItem item in cacheItems)
11734 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; 11780 {
11735 cachedresp.WearableData[i].TextureID = UUID.Zero; //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); 11781
11736 cachedresp.WearableData[i].HostName = new byte[0]; 11782 if (cache.GetCached(item.TextureID.ToString()) == null)
11783 {
11784 item.TextureAsset.Temporary = true;
11785 cache.Store(item.TextureAsset);
11786 }
11787
11788
11789 }
11790 }
11791
11792 if (cacheItems != null)
11793 {
11794
11795 for (int i = 0; i < maxWearablesLoop; i++)
11796 {
11797 WearableCacheItem item =
11798 WearableCacheItem.SearchTextureIndex(cachedtex.WearableData[i].TextureIndex,cacheItems);
11799
11800 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
11801 cachedresp.WearableData[i].TextureIndex= cachedtex.WearableData[i].TextureIndex;
11802 cachedresp.WearableData[i].HostName = new byte[0];
11803 if (item != null && cachedtex.WearableData[i].ID == item.CacheId)
11804 {
11805
11806 cachedresp.WearableData[i].TextureID = item.TextureID;
11807 }
11808 else
11809 {
11810 cachedresp.WearableData[i].TextureID = UUID.Zero;
11811 }
11812 }
11813 }
11814 else
11815 {
11816 for (int i = 0; i < maxWearablesLoop; i++)
11817 {
11818 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
11819 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
11820 cachedresp.WearableData[i].TextureID = UUID.Zero;
11821 //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46");
11822 cachedresp.WearableData[i].HostName = new byte[0];
11823 }
11737 } 11824 }
11738 } 11825 }
11739 else 11826 else
11740 { 11827 {
11741 for (int i = 0; i < cachedtex.WearableData.Length; i++) 11828 if (cache == null)
11742 { 11829 {
11743 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); 11830 for (int i = 0; i < maxWearablesLoop; i++)
11744 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; 11831 {
11832 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
11833 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
11834 cachedresp.WearableData[i].TextureID = UUID.Zero;
11835 //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46");
11836 cachedresp.WearableData[i].HostName = new byte[0];
11837 }
11838 }
11839 else
11840 {
11841 for (int i = 0; i < maxWearablesLoop; i++)
11842 {
11843 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
11844 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
11745 11845
11746 11846
11747 11847
11748 if (cache.Check(cachedtex.WearableData[i].ID.ToString())) 11848 if (cache.GetCached(cachedresp.WearableData[i].TextureID.ToString()) == null)
11749 cachedresp.WearableData[i].TextureID = UUID.Zero; 11849 cachedresp.WearableData[i].TextureID = UUID.Zero;
11750 //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); 11850 //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46");
11751 else 11851 else
11752 cachedresp.WearableData[i].TextureID = UUID.Zero; // UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46"); 11852 cachedresp.WearableData[i].TextureID = UUID.Zero;
11753 cachedresp.WearableData[i].HostName = new byte[0]; 11853 // UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46");
11854 cachedresp.WearableData[i].HostName = new byte[0];
11855 }
11754 } 11856 }
11755 } 11857 }
11756 cachedresp.Header.Zerocoded = true; 11858 cachedresp.Header.Zerocoded = true;