aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs1
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs89
2 files changed, 9 insertions, 81 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
index 9869a99..f6ad6e1 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs
@@ -379,6 +379,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
379 { 379 {
380 // Try the user's inventory, but only if it's different from the regions' 380 // Try the user's inventory, but only if it's different from the regions'
381 string userAssets = HyperAssets.GetUserAssetServer(AgentID); 381 string userAssets = HyperAssets.GetUserAssetServer(AgentID);
382
382 if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer())) 383 if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer()))
383 { 384 {
384 m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); 385 m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id);
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index d2824bd..3a2c019 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -7196,59 +7196,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP
7196 } 7196 }
7197 else // Agent 7197 else // Agent
7198 { 7198 {
7199 IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); 7199 IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>();
7200 InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); 7200 if (invAccess != null)
7201 assetRequestItem = invService.GetItem(assetRequestItem);
7202 if (assetRequestItem == null)
7203 { 7201 {
7204 ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); 7202 if (!invAccess.GetAgentInventoryItem(this, itemID, requestID))
7205 if (lib != null) 7203 return false;
7206 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
7207 if (assetRequestItem == null)
7208 return true;
7209 }
7210 7204
7211 // At this point, we need to apply perms
7212 // only to notecards and scripts. All
7213 // other asset types are always available
7214 //
7215 if (assetRequestItem.AssetType == (int)AssetType.LSLText)
7216 {
7217 if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId))
7218 {
7219 SendAgentAlertMessage("Insufficient permissions to view script", false);
7220 return true;
7221 }
7222 }
7223 else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
7224 {
7225 if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId))
7226 {
7227 SendAgentAlertMessage("Insufficient permissions to view notecard", false);
7228 return true;
7229 }
7230 } 7205 }
7206 else
7207 return false;
7231 7208
7232 if (assetRequestItem.AssetID != requestID)
7233 {
7234 m_log.WarnFormat(
7235 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
7236 Name, requestID, itemID, assetRequestItem.AssetID);
7237 return true;
7238 }
7239 } 7209 }
7240 } 7210 }
7241 } 7211 }
7242 7212
7243 //m_assetCache.AddAssetRequest(this, transfer);
7244
7245 MakeAssetRequest(transfer, taskID); 7213 MakeAssetRequest(transfer, taskID);
7246 7214
7247 /* RequestAsset = OnRequestAsset;
7248 if (RequestAsset != null)
7249 {
7250 RequestAsset(this, transfer);
7251 }*/
7252 return true; 7215 return true;
7253 } 7216 }
7254 7217
@@ -11459,15 +11422,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11459 else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) 11422 else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
11460 { 11423 {
11461 requestID = new UUID(transferRequest.TransferInfo.Params, 80); 11424 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
11462 //m_log.Debug("[XXX] inventory asset request " + requestID);
11463 //if (taskID == UUID.Zero) // Agent
11464 // if (m_scene is HGScene)
11465 // {
11466 // m_log.Debug("[XXX] hg asset request " + requestID);
11467 // // We may need to fetch the asset from the user's asset server into the local asset server
11468 // HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper;
11469 // mapper.Get(requestID, AgentId);
11470 // }
11471 } 11425 }
11472 11426
11473// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); 11427// m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID);
@@ -11488,44 +11442,17 @@ namespace OpenSim.Region.ClientStack.LindenUDP
11488 UUID requestID = UUID.Zero; 11442 UUID requestID = UUID.Zero;
11489 byte source = (byte)SourceType.Asset; 11443 byte source = (byte)SourceType.Asset;
11490 11444
11491 if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) 11445 if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
11492 || (transferRequest.TransferInfo.SourceType == 2222))
11493 { 11446 {
11494 requestID = new UUID(transferRequest.TransferInfo.Params, 0); 11447 requestID = new UUID(transferRequest.TransferInfo.Params, 0);
11495 } 11448 }
11496 else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) 11449 else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
11497 || (transferRequest.TransferInfo.SourceType == 3333))
11498 { 11450 {
11499 requestID = new UUID(transferRequest.TransferInfo.Params, 80); 11451 requestID = new UUID(transferRequest.TransferInfo.Params, 80);
11500 source = (byte)SourceType.SimInventoryItem; 11452 source = (byte)SourceType.SimInventoryItem;
11501 //m_log.Debug("asset request " + requestID); 11453 //m_log.Debug("asset request " + requestID);
11502 } 11454 }
11503 11455
11504 if (null == asset)
11505 {
11506 if ((m_hyperAssets != null) && (transferRequest.TransferInfo.SourceType < 2000))
11507 {
11508 // Try the user's inventory, but only if it's different from the regions'
11509 string userAssets = m_hyperAssets.GetUserAssetServer(AgentId);
11510 if ((userAssets != string.Empty) && (userAssets != m_hyperAssets.GetSimAssetServer()))
11511 {
11512 m_log.DebugFormat("[CLIENT]: asset {0} not found in local asset storage. Trying user's storage.", id);
11513 if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset)
11514 transferRequest.TransferInfo.SourceType = 2222; // marker
11515 else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem)
11516 transferRequest.TransferInfo.SourceType = 3333; // marker
11517
11518 m_assetService.Get(userAssets + "/" + id, transferRequest, AssetReceived);
11519 return;
11520 }
11521 }
11522
11523 //m_log.DebugFormat("[ASSET CACHE]: Asset transfer request for asset which is {0} already known to be missing. Dropping", requestID);
11524
11525 // FIXME: We never tell the client about assets which do not exist when requested by this transfer mechanism, which can't be right.
11526 return;
11527 }
11528
11529 // Scripts cannot be retrieved by direct request 11456 // Scripts cannot be retrieved by direct request
11530 if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) 11457 if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10)
11531 return; 11458 return;