aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorDiva Canto2009-10-12 17:00:01 -0700
committerDiva Canto2009-10-12 17:00:01 -0700
commitc0beeb929e22509329781cdf85f7a5d90c4b0e36 (patch)
tree42f724d921f08b0d2d14c8f7eb872a118a9adadd /OpenSim/Region/ClientStack
parent0004246: [Patch] FlotsamAssetCache deep scan & cache (diff)
downloadopensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.zip
opensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.tar.gz
opensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.tar.bz2
opensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.tar.xz
* Fixes http://opensimulator.org/mantis/view.php?id=4225
* Fixes http://opensimulator.org/mantis/view.php?id=3959 * Allows for viewing inventory textures outside home grid
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs14
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs21
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs5
3 files changed, 33 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
index 5877779..1bbe00f 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
@@ -31,6 +31,7 @@ using OpenMetaverse;
31using OpenMetaverse.Imaging; 31using OpenMetaverse.Imaging;
32using OpenSim.Framework; 32using OpenSim.Framework;
33using OpenSim.Region.Framework.Interfaces; 33using OpenSim.Region.Framework.Interfaces;
34using OpenSim.Region.Framework.Scenes.Hypergrid;
34using OpenSim.Services.Interfaces; 35using OpenSim.Services.Interfaces;
35using log4net; 36using log4net;
36using System.Reflection; 37using System.Reflection;
@@ -54,6 +55,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
54 public UUID TextureID; 55 public UUID TextureID;
55 public IJ2KDecoder J2KDecoder; 56 public IJ2KDecoder J2KDecoder;
56 public IAssetService AssetService; 57 public IAssetService AssetService;
58 public UUID AgentID;
59 public IHyperAssetService HyperAssets;
57 public OpenJPEG.J2KLayerInfo[] Layers; 60 public OpenJPEG.J2KLayerInfo[] Layers;
58 public bool IsDecoded; 61 public bool IsDecoded;
59 public bool HasAsset; 62 public bool HasAsset;
@@ -370,6 +373,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
370 UUID assetID = UUID.Zero; 373 UUID assetID = UUID.Zero;
371 if (asset != null) 374 if (asset != null)
372 assetID = asset.FullID; 375 assetID = asset.FullID;
376 else if (HyperAssets != null)
377 {
378 // Try the user's inventory, but only if it's different from the regions'
379 string userAssets = HyperAssets.GetUserAssetServer(AgentID);
380 if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer()))
381 {
382 m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id);
383 AssetService.Get(userAssets + "/" + id, this, AssetReceived);
384 return;
385 }
386 }
373 387
374 AssetDataCallback(assetID, asset); 388 AssetDataCallback(assetID, asset);
375 389
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 84e705a..25eb5cd 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -43,6 +43,7 @@ using OpenSim.Framework.Communications.Cache;
43using OpenSim.Framework.Statistics; 43using OpenSim.Framework.Statistics;
44using OpenSim.Region.Framework.Interfaces; 44using OpenSim.Region.Framework.Interfaces;
45using OpenSim.Region.Framework.Scenes; 45using OpenSim.Region.Framework.Scenes;
46using OpenSim.Region.Framework.Scenes.Hypergrid;
46using OpenSim.Services.Interfaces; 47using OpenSim.Services.Interfaces;
47using Timer=System.Timers.Timer; 48using Timer=System.Timers.Timer;
48using AssetLandmark = OpenSim.Framework.AssetLandmark; 49using AssetLandmark = OpenSim.Framework.AssetLandmark;
@@ -117,6 +118,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
117 protected int m_packetMTU = 1400; 118 protected int m_packetMTU = 1400;
118 protected IAssetService m_assetService; 119 protected IAssetService m_assetService;
119 120
121
120 #region Properties 122 #region Properties
121 123
122 public UUID SecureSessionId { get { return m_secureSessionId; } } 124 public UUID SecureSessionId { get { return m_secureSessionId; } }
@@ -7013,7 +7015,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7013 #endregion 7015 #endregion
7014 7016
7015 //handlerTextureRequest = null; 7017 //handlerTextureRequest = null;
7016
7017 for (int i = 0; i < imageRequest.RequestImage.Length; i++) 7018 for (int i = 0; i < imageRequest.RequestImage.Length; i++)
7018 { 7019 {
7019 if (OnRequestTexture != null) 7020 if (OnRequestTexture != null)
@@ -7024,7 +7025,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7024 args.PacketNumber = imageRequest.RequestImage[i].Packet; 7025 args.PacketNumber = imageRequest.RequestImage[i].Packet;
7025 args.Priority = imageRequest.RequestImage[i].DownloadPriority; 7026 args.Priority = imageRequest.RequestImage[i].DownloadPriority;
7026 args.requestSequence = imageRequest.Header.Sequence; 7027 args.requestSequence = imageRequest.Header.Sequence;
7027
7028 //handlerTextureRequest = OnRequestTexture; 7028 //handlerTextureRequest = OnRequestTexture;
7029 7029
7030 //if (handlerTextureRequest != null) 7030 //if (handlerTextureRequest != null)
@@ -7047,10 +7047,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7047 // Validate inventory transfers 7047 // Validate inventory transfers
7048 // Has to be done here, because AssetCache can't do it 7048 // Has to be done here, because AssetCache can't do it
7049 // 7049 //
7050 7050 UUID taskID = UUID.Zero;
7051 if (transfer.TransferInfo.SourceType == 3) 7051 if (transfer.TransferInfo.SourceType == 3)
7052 { 7052 {
7053 UUID taskID = new UUID(transfer.TransferInfo.Params, 48); 7053 taskID = new UUID(transfer.TransferInfo.Params, 48);
7054 UUID itemID = new UUID(transfer.TransferInfo.Params, 64); 7054 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
7055 UUID requestID = new UUID(transfer.TransferInfo.Params, 80); 7055 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
7056 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 7056 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
@@ -7121,7 +7121,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7121 7121
7122 //m_assetCache.AddAssetRequest(this, transfer); 7122 //m_assetCache.AddAssetRequest(this, transfer);
7123 7123
7124 MakeAssetRequest(transfer); 7124 MakeAssetRequest(transfer, taskID);
7125 7125
7126 /* RequestAsset = OnRequestAsset; 7126 /* RequestAsset = OnRequestAsset;
7127 if (RequestAsset != null) 7127 if (RequestAsset != null)
@@ -10330,7 +10330,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10330 return String.Empty; 10330 return String.Empty;
10331 } 10331 }
10332 10332
10333 public void MakeAssetRequest(TransferRequestPacket transferRequest) 10333 public void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID)
10334 { 10334 {
10335 UUID requestID = UUID.Zero; 10335 UUID requestID = UUID.Zero;
10336 if (transferRequest.TransferInfo.SourceType == 2) 10336 if (transferRequest.TransferInfo.SourceType == 2)
@@ -10343,11 +10343,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10343 //inventory asset request 10343 //inventory asset request
10344 requestID = new UUID(transferRequest.TransferInfo.Params, 80); 10344 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
10345 //m_log.Debug("asset request " + requestID); 10345 //m_log.Debug("asset request " + requestID);
10346 if (taskID == UUID.Zero) // Agent
10347 if (m_scene is HGScene)
10348 {
10349 // We may need to fetch the asset from the user's asset server into the local asset server
10350 HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper;
10351 mapper.Get(requestID, AgentId);
10352 }
10346 } 10353 }
10347 10354
10348 //check to see if asset is in local cache, if not we need to request it from asset server. 10355 //check to see if asset is in local cache, if not we need to request it from asset server.
10349 //m_log.Debug("asset request " + requestID); 10356 //m_log.Debug("asset request " + requestID);
10350 10357
10351 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 10358 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
10352 10359
10353 } 10360 }
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
index 343f537..56d34e6 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs
@@ -59,6 +59,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
59 private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); 59 private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer());
60 private object m_syncRoot = new object(); 60 private object m_syncRoot = new object();
61 61
62 private IHyperAssetService m_hyperAssets;
63
62 public LLClientView Client { get { return m_client; } } 64 public LLClientView Client { get { return m_client; } }
63 public AssetBase MissingImage { get { return m_missingImage; } } 65 public AssetBase MissingImage { get { return m_missingImage; } }
64 66
@@ -74,6 +76,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
74 m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); 76 m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client");
75 77
76 m_j2kDecodeModule = pJ2kDecodeModule; 78 m_j2kDecodeModule = pJ2kDecodeModule;
79 m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>();
77 } 80 }
78 81
79 /// <summary> 82 /// <summary>
@@ -146,6 +149,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
146 imgrequest = new J2KImage(this); 149 imgrequest = new J2KImage(this);
147 imgrequest.J2KDecoder = m_j2kDecodeModule; 150 imgrequest.J2KDecoder = m_j2kDecodeModule;
148 imgrequest.AssetService = m_assetCache; 151 imgrequest.AssetService = m_assetCache;
152 imgrequest.AgentID = m_client.AgentId;
153 imgrequest.HyperAssets = m_hyperAssets;
149 imgrequest.DiscardLevel = newRequest.DiscardLevel; 154 imgrequest.DiscardLevel = newRequest.DiscardLevel;
150 imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); 155 imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber);
151 imgrequest.Priority = newRequest.Priority; 156 imgrequest.Priority = newRequest.Priority;