aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs17
1 files changed, 10 insertions, 7 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 }