diff options
author | Diva Canto | 2010-07-04 14:59:15 -0700 |
---|---|---|
committer | Diva Canto | 2010-07-04 14:59:15 -0700 |
commit | b84f72df0b7b3917e917a36546c911cb1953b30b (patch) | |
tree | 83655b4b5d17dd10605882fd0258914dc7c1f44f /OpenSim | |
parent | Started to clean up the mess with HyperAssets in LLClientView. Fixed HG acces... (diff) | |
download | opensim-SC_OLD-b84f72df0b7b3917e917a36546c911cb1953b30b.zip opensim-SC_OLD-b84f72df0b7b3917e917a36546c911cb1953b30b.tar.gz opensim-SC_OLD-b84f72df0b7b3917e917a36546c911cb1953b30b.tar.bz2 opensim-SC_OLD-b84f72df0b7b3917e917a36546c911cb1953b30b.tar.xz |
Got rid of all hyperassets references. Also fixed accessing textures in user's inventory in foreign grids.
Diffstat (limited to 'OpenSim')
8 files changed, 25 insertions, 58 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index f6ad6e1..e9e2dca 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
55 | public IJ2KDecoder J2KDecoder; | 55 | public IJ2KDecoder J2KDecoder; |
56 | public IAssetService AssetService; | 56 | public IAssetService AssetService; |
57 | public UUID AgentID; | 57 | public UUID AgentID; |
58 | public IHyperAssetService HyperAssets; | 58 | public IInventoryAccessModule InventoryAccessModule; |
59 | public OpenJPEG.J2KLayerInfo[] Layers; | 59 | public OpenJPEG.J2KLayerInfo[] Layers; |
60 | public bool IsDecoded; | 60 | public bool IsDecoded; |
61 | public bool HasAsset; | 61 | public bool HasAsset; |
@@ -375,15 +375,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
375 | UUID assetID = UUID.Zero; | 375 | UUID assetID = UUID.Zero; |
376 | if (asset != null) | 376 | if (asset != null) |
377 | assetID = asset.FullID; | 377 | assetID = asset.FullID; |
378 | else if ((HyperAssets != null) && (sender != HyperAssets)) | 378 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) |
379 | { | 379 | { |
380 | // Try the user's inventory, but only if it's different from the regions' | 380 | // Unfortunately we need this here, there's no other way. |
381 | string userAssets = HyperAssets.GetUserAssetServer(AgentID); | 381 | // This is due to the fact that textures opened directly from the agent's inventory |
382 | 382 | // don't have any distinguishing feature. As such, in order to serve those when the | |
383 | if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer())) | 383 | // foreign user is visiting, we need to try again after the first fail to the local |
384 | // asset service. | ||
385 | string assetServerURL = string.Empty; | ||
386 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) | ||
384 | { | 387 | { |
385 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); | 388 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); |
386 | AssetService.Get(userAssets + "/" + id, HyperAssets, AssetReceived); | 389 | AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); |
387 | return; | 390 | return; |
388 | } | 391 | } |
389 | } | 392 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 3a2c019..247c2b2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -357,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
357 | protected uint m_agentFOVCounter; | 357 | protected uint m_agentFOVCounter; |
358 | 358 | ||
359 | protected IAssetService m_assetService; | 359 | protected IAssetService m_assetService; |
360 | private IHyperAssetService m_hyperAssets; | ||
361 | private const bool m_checkPackets = true; | 360 | private const bool m_checkPackets = true; |
362 | 361 | ||
363 | private Timer m_propertiesPacketTimer; | 362 | private Timer m_propertiesPacketTimer; |
@@ -432,7 +431,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
432 | // m_attachmentsSent = new HashSet<uint>(); | 431 | // m_attachmentsSent = new HashSet<uint>(); |
433 | 432 | ||
434 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 433 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
435 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); | ||
436 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 434 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
437 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); | 435 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); |
438 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); | 436 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 938cf50..9e0db12 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | |||
@@ -58,8 +58,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
58 | private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); | 58 | private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); |
59 | private object m_syncRoot = new object(); | 59 | private object m_syncRoot = new object(); |
60 | 60 | ||
61 | private IHyperAssetService m_hyperAssets; | ||
62 | |||
63 | public LLClientView Client { get { return m_client; } } | 61 | public LLClientView Client { get { return m_client; } } |
64 | public AssetBase MissingImage { get { return m_missingImage; } } | 62 | public AssetBase MissingImage { get { return m_missingImage; } } |
65 | 63 | ||
@@ -75,7 +73,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
75 | m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); | 73 | m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); |
76 | 74 | ||
77 | m_j2kDecodeModule = pJ2kDecodeModule; | 75 | m_j2kDecodeModule = pJ2kDecodeModule; |
78 | m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>(); | ||
79 | } | 76 | } |
80 | 77 | ||
81 | /// <summary> | 78 | /// <summary> |
@@ -149,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
149 | imgrequest.J2KDecoder = m_j2kDecodeModule; | 146 | imgrequest.J2KDecoder = m_j2kDecodeModule; |
150 | imgrequest.AssetService = m_assetCache; | 147 | imgrequest.AssetService = m_assetCache; |
151 | imgrequest.AgentID = m_client.AgentId; | 148 | imgrequest.AgentID = m_client.AgentId; |
152 | imgrequest.HyperAssets = m_hyperAssets; | 149 | imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>(); |
153 | imgrequest.DiscardLevel = newRequest.DiscardLevel; | 150 | imgrequest.DiscardLevel = newRequest.DiscardLevel; |
154 | imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); | 151 | imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); |
155 | imgrequest.Priority = newRequest.Priority; | 152 | imgrequest.Priority = newRequest.Priority; |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index 6fdd2a8..cd66af5 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -192,11 +192,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
192 | m_assMapper.Post(item.AssetID, receiver, userAssetServer); | 192 | m_assMapper.Post(item.AssetID, receiver, userAssetServer); |
193 | } | 193 | } |
194 | 194 | ||
195 | 195 | public override bool IsForeignUser(UUID userID, out string assetServerURL) | |
196 | |||
197 | #endregion | ||
198 | |||
199 | public bool IsForeignUser(UUID userID, out string assetServerURL) | ||
200 | { | 196 | { |
201 | assetServerURL = string.Empty; | 197 | assetServerURL = string.Empty; |
202 | UserAccount account = null; | 198 | UserAccount account = null; |
@@ -220,6 +216,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
220 | return false; | 216 | return false; |
221 | } | 217 | } |
222 | 218 | ||
219 | #endregion | ||
220 | |||
223 | protected override InventoryItemBase GetItem(UUID agentID, UUID itemID) | 221 | protected override InventoryItemBase GetItem(UUID agentID, UUID itemID) |
224 | { | 222 | { |
225 | InventoryItemBase item = base.GetItem(agentID, itemID); | 223 | InventoryItemBase item = base.GetItem(agentID, itemID); |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 39616f7..90b7b51 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -683,6 +683,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
683 | return true; | 683 | return true; |
684 | } | 684 | } |
685 | 685 | ||
686 | |||
687 | public virtual bool IsForeignUser(UUID userID, out string assetServerURL) | ||
688 | { | ||
689 | assetServerURL = string.Empty; | ||
690 | return false; | ||
691 | } | ||
692 | |||
686 | #endregion | 693 | #endregion |
687 | 694 | ||
688 | #region Misc | 695 | #region Misc |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index ebd6bbd..034e692 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
42 | { | 42 | { |
43 | public class HGAssetBroker : | 43 | public class HGAssetBroker : |
44 | ISharedRegionModule, IAssetService, IHyperAssetService | 44 | ISharedRegionModule, IAssetService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -150,7 +150,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
150 | m_aScene = scene; | 150 | m_aScene = scene; |
151 | 151 | ||
152 | scene.RegisterModuleInterface<IAssetService>(this); | 152 | scene.RegisterModuleInterface<IAssetService>(this); |
153 | scene.RegisterModuleInterface<IHyperAssetService>(this); | ||
154 | } | 153 | } |
155 | 154 | ||
156 | public void RemoveRegion(Scene scene) | 155 | public void RemoveRegion(Scene scene) |
diff --git a/OpenSim/Region/Framework/Interfaces/IHyperService.cs b/OpenSim/Region/Framework/Interfaces/IHyperService.cs deleted file mode 100644 index 51ea28a..0000000 --- a/OpenSim/Region/Framework/Interfaces/IHyperService.cs +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using OpenMetaverse; | ||
29 | |||
30 | namespace OpenSim.Region.Framework.Interfaces | ||
31 | { | ||
32 | public interface IHyperAssetService | ||
33 | { | ||
34 | string GetUserAssetServer(UUID userID); | ||
35 | string GetSimAssetServer(); | ||
36 | } | ||
37 | } | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs index 2d4f509..05fc2ad 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs | |||
@@ -44,6 +44,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
44 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); | 44 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); |
45 | void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); | 45 | void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); |
46 | bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID); | 46 | bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID); |
47 | //bool GetTextureFromAgentInventory(UUID agentID, UUID assetID); | 47 | |
48 | // Must be here because of textures in user's inventory | ||
49 | bool IsForeignUser(UUID userID, out string assetServerURL); | ||
48 | } | 50 | } |
49 | } | 51 | } |