aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs50
1 files changed, 39 insertions, 11 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 9afff5a..8487adc 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;
@@ -319,6 +320,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP
319 /// OnQueueEmpty event is triggered for the texture category</summary> 320 /// OnQueueEmpty event is triggered for the texture category</summary>
320 protected int m_textureSendLimit = 20; 321 protected int m_textureSendLimit = 20;
321 protected IAssetService m_assetService; 322 protected IAssetService m_assetService;
323 private IHyperAssetService m_hyperAssets;
324
322 325
323 #endregion Class Members 326 #endregion Class Members
324 327
@@ -377,6 +380,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
377 380
378 m_scene = scene; 381 m_scene = scene;
379 m_assetService = m_scene.RequestModuleInterface<IAssetService>(); 382 m_assetService = m_scene.RequestModuleInterface<IAssetService>();
383 m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>();
380 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); 384 m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>();
381 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); 385 m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>());
382 m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion()); 386 m_channelVersion = Utils.StringToBytes(scene.GetSimulatorVersion());
@@ -6895,7 +6899,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6895 #endregion 6899 #endregion
6896 6900
6897 //handlerTextureRequest = null; 6901 //handlerTextureRequest = null;
6898
6899 for (int i = 0; i < imageRequest.RequestImage.Length; i++) 6902 for (int i = 0; i < imageRequest.RequestImage.Length; i++)
6900 { 6903 {
6901 if (OnRequestTexture != null) 6904 if (OnRequestTexture != null)
@@ -6906,7 +6909,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6906 args.PacketNumber = imageRequest.RequestImage[i].Packet; 6909 args.PacketNumber = imageRequest.RequestImage[i].Packet;
6907 args.Priority = imageRequest.RequestImage[i].DownloadPriority; 6910 args.Priority = imageRequest.RequestImage[i].DownloadPriority;
6908 args.requestSequence = imageRequest.Header.Sequence; 6911 args.requestSequence = imageRequest.Header.Sequence;
6909
6910 //handlerTextureRequest = OnRequestTexture; 6912 //handlerTextureRequest = OnRequestTexture;
6911 6913
6912 //if (handlerTextureRequest != null) 6914 //if (handlerTextureRequest != null)
@@ -6929,10 +6931,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
6929 // Validate inventory transfers 6931 // Validate inventory transfers
6930 // Has to be done here, because AssetCache can't do it 6932 // Has to be done here, because AssetCache can't do it
6931 // 6933 //
6932 6934 UUID taskID = UUID.Zero;
6933 if (transfer.TransferInfo.SourceType == 3) 6935 if (transfer.TransferInfo.SourceType == 3)
6934 { 6936 {
6935 UUID taskID = new UUID(transfer.TransferInfo.Params, 48); 6937 taskID = new UUID(transfer.TransferInfo.Params, 48);
6936 UUID itemID = new UUID(transfer.TransferInfo.Params, 64); 6938 UUID itemID = new UUID(transfer.TransferInfo.Params, 64);
6937 UUID requestID = new UUID(transfer.TransferInfo.Params, 80); 6939 UUID requestID = new UUID(transfer.TransferInfo.Params, 80);
6938 if (!(((Scene)m_scene).Permissions.BypassPermissions())) 6940 if (!(((Scene)m_scene).Permissions.BypassPermissions()))
@@ -7003,7 +7005,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7003 7005
7004 //m_assetCache.AddAssetRequest(this, transfer); 7006 //m_assetCache.AddAssetRequest(this, transfer);
7005 7007
7006 MakeAssetRequest(transfer); 7008 MakeAssetRequest(transfer, taskID);
7007 7009
7008 /* RequestAsset = OnRequestAsset; 7010 /* RequestAsset = OnRequestAsset;
7009 if (RequestAsset != null) 7011 if (RequestAsset != null)
@@ -10210,7 +10212,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10210 return String.Empty; 10212 return String.Empty;
10211 } 10213 }
10212 10214
10213 public void MakeAssetRequest(TransferRequestPacket transferRequest) 10215 public void MakeAssetRequest(TransferRequestPacket transferRequest, UUID taskID)
10214 { 10216 {
10215 UUID requestID = UUID.Zero; 10217 UUID requestID = UUID.Zero;
10216 if (transferRequest.TransferInfo.SourceType == 2) 10218 if (transferRequest.TransferInfo.SourceType == 2)
@@ -10222,12 +10224,20 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10222 { 10224 {
10223 //inventory asset request 10225 //inventory asset request
10224 requestID = new UUID(transferRequest.TransferInfo.Params, 80); 10226 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
10225 //m_log.Debug("asset request " + requestID); 10227 //m_log.Debug("[XXX] inventory asset request " + requestID);
10228 //if (taskID == UUID.Zero) // Agent
10229 // if (m_scene is HGScene)
10230 // {
10231 // m_log.Debug("[XXX] hg asset request " + requestID);
10232 // // We may need to fetch the asset from the user's asset server into the local asset server
10233 // HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper;
10234 // mapper.Get(requestID, AgentId);
10235 // }
10226 } 10236 }
10227 10237
10228 //check to see if asset is in local cache, if not we need to request it from asset server. 10238 //check to see if asset is in local cache, if not we need to request it from asset server.
10229 //m_log.Debug("asset request " + requestID); 10239 //m_log.Debug("asset request " + requestID);
10230 10240
10231 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived); 10241 m_assetService.Get(requestID.ToString(), transferRequest, AssetReceived);
10232 10242
10233 } 10243 }
@@ -10238,12 +10248,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10238 10248
10239 UUID requestID = UUID.Zero; 10249 UUID requestID = UUID.Zero;
10240 byte source = 2; 10250 byte source = 2;
10241 if (transferRequest.TransferInfo.SourceType == 2) 10251 if ((transferRequest.TransferInfo.SourceType == 2) || (transferRequest.TransferInfo.SourceType == 2222))
10242 { 10252 {
10243 //direct asset request 10253 //direct asset request
10244 requestID = new UUID(transferRequest.TransferInfo.Params, 0); 10254 requestID = new UUID(transferRequest.TransferInfo.Params, 0);
10245 } 10255 }
10246 else if (transferRequest.TransferInfo.SourceType == 3) 10256 else if ((transferRequest.TransferInfo.SourceType == 3) || (transferRequest.TransferInfo.SourceType == 3333))
10247 { 10257 {
10248 //inventory asset request 10258 //inventory asset request
10249 requestID = new UUID(transferRequest.TransferInfo.Params, 80); 10259 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
@@ -10251,10 +10261,28 @@ namespace OpenSim.Region.ClientStack.LindenUDP
10251 //m_log.Debug("asset request " + requestID); 10261 //m_log.Debug("asset request " + requestID);
10252 } 10262 }
10253 10263
10254 // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
10255 if (null == asset) 10264 if (null == asset)
10256 { 10265 {
10266 if ((m_hyperAssets != null) && (transferRequest.TransferInfo.SourceType < 2000))
10267 {
10268 // Try the user's inventory, but only if it's different from the regions'
10269 string userAssets = m_hyperAssets.GetUserAssetServer(AgentId);
10270 if ((userAssets != string.Empty) && (userAssets != m_hyperAssets.GetSimAssetServer()))
10271 {
10272 m_log.DebugFormat("[CLIENT]: asset {0} not found in local asset storage. Trying user's storage.", id);
10273 if (transferRequest.TransferInfo.SourceType == 2)
10274 transferRequest.TransferInfo.SourceType = 2222; // marker
10275 else if (transferRequest.TransferInfo.SourceType == 3)
10276 transferRequest.TransferInfo.SourceType = 3333; // marker
10277
10278 m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived);
10279 return;
10280 }
10281 }
10282
10257 //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID); 10283 //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID);
10284
10285 // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
10258 return; 10286 return;
10259 } 10287 }
10260 10288