diff options
author | teravus | 2012-12-31 23:04:28 -0500 |
---|---|---|
committer | teravus | 2012-12-31 23:04:28 -0500 |
commit | 2805ec64662494d680925c6034e59b823e051a9d (patch) | |
tree | ba2294dab3ced1b10962d373d29fb6011b55735c /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |
parent | * This finishes the implementation of AgentCachedTexture. Requires the XBak... (diff) | |
download | opensim-SC-2805ec64662494d680925c6034e59b823e051a9d.zip opensim-SC-2805ec64662494d680925c6034e59b823e051a9d.tar.gz opensim-SC-2805ec64662494d680925c6034e59b823e051a9d.tar.bz2 opensim-SC-2805ec64662494d680925c6034e59b823e051a9d.tar.xz |
* Fixed a bug that replayed old cached appearance when changing outfits
* Added suser(bad client) DOS protection by limiting the max cacheitems to the maximum sane amount.
* Prevents potential numerous loops from running amok and index errors if the client purposely provides bad cache info.
* If the XBakes service wasn't running, the SetAvatarAppearance routine would crash when contacting the XBakes service even though it was in a Try/Catch for the appropriate error type. It only properly error handles with the type Exception :(. (commented on that because it's unusual)
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 9e39699..d46adb8 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -11727,6 +11727,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11727 | 11727 | ||
11728 | IAssetService cache = m_scene.AssetService; | 11728 | IAssetService cache = m_scene.AssetService; |
11729 | IBakedTextureModule bakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | 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 | |||
11730 | if (bakedTextureModule != null && cache != null) | 11735 | if (bakedTextureModule != null && cache != null) |
11731 | { | 11736 | { |
11732 | // 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 | 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 |
@@ -11742,10 +11747,27 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11742 | p.Appearance.WearableCacheItems = cacheItems; | 11747 | p.Appearance.WearableCacheItems = cacheItems; |
11743 | p.Appearance.WearableCacheItemsDirty = false; | 11748 | p.Appearance.WearableCacheItemsDirty = false; |
11744 | } | 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 | } | ||
11745 | catch (InvalidOperationException) | 11762 | catch (InvalidOperationException) |
11746 | { | 11763 | { |
11747 | cacheItems = null; | 11764 | cacheItems = null; |
11765 | } */ | ||
11766 | catch (Exception) | ||
11767 | { | ||
11768 | cacheItems = null; | ||
11748 | } | 11769 | } |
11770 | |||
11749 | } | 11771 | } |
11750 | else if (p.Appearance.WearableCacheItems != null) | 11772 | else if (p.Appearance.WearableCacheItems != null) |
11751 | { | 11773 | { |
@@ -11766,10 +11788,11 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11766 | 11788 | ||
11767 | } | 11789 | } |
11768 | } | 11790 | } |
11791 | |||
11769 | if (cacheItems != null) | 11792 | if (cacheItems != null) |
11770 | { | 11793 | { |
11771 | 11794 | ||
11772 | for (int i = 0; i < cachedtex.WearableData.Length; i++) | 11795 | for (int i = 0; i < maxWearablesLoop; i++) |
11773 | { | 11796 | { |
11774 | WearableCacheItem item = | 11797 | WearableCacheItem item = |
11775 | WearableCacheItem.SearchTextureIndex(cachedtex.WearableData[i].TextureIndex,cacheItems); | 11798 | WearableCacheItem.SearchTextureIndex(cachedtex.WearableData[i].TextureIndex,cacheItems); |
@@ -11777,8 +11800,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11777 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 11800 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
11778 | cachedresp.WearableData[i].TextureIndex= cachedtex.WearableData[i].TextureIndex; | 11801 | cachedresp.WearableData[i].TextureIndex= cachedtex.WearableData[i].TextureIndex; |
11779 | cachedresp.WearableData[i].HostName = new byte[0]; | 11802 | cachedresp.WearableData[i].HostName = new byte[0]; |
11780 | if (item != null) | 11803 | if (item != null && cachedtex.WearableData[i].ID == item.CacheId) |
11781 | { | 11804 | { |
11805 | |||
11782 | cachedresp.WearableData[i].TextureID = item.TextureID; | 11806 | cachedresp.WearableData[i].TextureID = item.TextureID; |
11783 | } | 11807 | } |
11784 | else | 11808 | else |
@@ -11789,7 +11813,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11789 | } | 11813 | } |
11790 | else | 11814 | else |
11791 | { | 11815 | { |
11792 | for (int i = 0; i < cachedtex.WearableData.Length; i++) | 11816 | for (int i = 0; i < maxWearablesLoop; i++) |
11793 | { | 11817 | { |
11794 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 11818 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
11795 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; | 11819 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; |
@@ -11803,7 +11827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11803 | { | 11827 | { |
11804 | if (cache == null) | 11828 | if (cache == null) |
11805 | { | 11829 | { |
11806 | for (int i = 0; i < cachedtex.WearableData.Length; i++) | 11830 | for (int i = 0; i < maxWearablesLoop; i++) |
11807 | { | 11831 | { |
11808 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 11832 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
11809 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; | 11833 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; |
@@ -11814,7 +11838,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11814 | } | 11838 | } |
11815 | else | 11839 | else |
11816 | { | 11840 | { |
11817 | for (int i = 0; i < cachedtex.WearableData.Length; i++) | 11841 | for (int i = 0; i < maxWearablesLoop; i++) |
11818 | { | 11842 | { |
11819 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); | 11843 | cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); |
11820 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; | 11844 | cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; |