diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 69 |
1 files changed, 11 insertions, 58 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 4dfd5d1..9f29420 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -358,7 +358,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
358 | protected uint m_agentFOVCounter; | 358 | protected uint m_agentFOVCounter; |
359 | 359 | ||
360 | protected IAssetService m_assetService; | 360 | protected IAssetService m_assetService; |
361 | private IHyperAssetService m_hyperAssets; | ||
362 | private const bool m_checkPackets = true; | 361 | private const bool m_checkPackets = true; |
363 | 362 | ||
364 | private Timer m_propertiesPacketTimer; | 363 | private Timer m_propertiesPacketTimer; |
@@ -435,7 +434,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
435 | // m_attachmentsSent = new HashSet<uint>(); | 434 | // m_attachmentsSent = new HashSet<uint>(); |
436 | 435 | ||
437 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 436 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
438 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); | ||
439 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 437 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
440 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); | 438 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); |
441 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); | 439 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); |
@@ -7209,59 +7207,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7209 | } | 7207 | } |
7210 | else // Agent | 7208 | else // Agent |
7211 | { | 7209 | { |
7212 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); | 7210 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
7213 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); | 7211 | if (invAccess != null) |
7214 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
7215 | if (assetRequestItem == null) | ||
7216 | { | 7212 | { |
7217 | ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); | 7213 | if (!invAccess.GetAgentInventoryItem(this, itemID, requestID)) |
7218 | if (lib != null) | 7214 | return false; |
7219 | assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); | ||
7220 | if (assetRequestItem == null) | ||
7221 | return true; | ||
7222 | } | ||
7223 | 7215 | ||
7224 | // At this point, we need to apply perms | ||
7225 | // only to notecards and scripts. All | ||
7226 | // other asset types are always available | ||
7227 | // | ||
7228 | if (assetRequestItem.AssetType == (int)AssetType.LSLText) | ||
7229 | { | ||
7230 | if (!((Scene)m_scene).Permissions.CanViewScript(itemID, UUID.Zero, AgentId)) | ||
7231 | { | ||
7232 | SendAgentAlertMessage("Insufficient permissions to view script", false); | ||
7233 | return true; | ||
7234 | } | ||
7235 | } | ||
7236 | else if (assetRequestItem.AssetType == (int)AssetType.Notecard) | ||
7237 | { | ||
7238 | if (!((Scene)m_scene).Permissions.CanViewNotecard(itemID, UUID.Zero, AgentId)) | ||
7239 | { | ||
7240 | SendAgentAlertMessage("Insufficient permissions to view notecard", false); | ||
7241 | return true; | ||
7242 | } | ||
7243 | } | 7216 | } |
7217 | else | ||
7218 | return false; | ||
7244 | 7219 | ||
7245 | if (assetRequestItem.AssetID != requestID) | ||
7246 | { | ||
7247 | m_log.WarnFormat( | ||
7248 | "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", | ||
7249 | Name, requestID, itemID, assetRequestItem.AssetID); | ||
7250 | return true; | ||
7251 | } | ||
7252 | } | 7220 | } |
7253 | } | 7221 | } |
7254 | } | 7222 | } |
7255 | 7223 | ||
7256 | //m_assetCache.AddAssetRequest(this, transfer); | ||
7257 | |||
7258 | MakeAssetRequest(transfer, taskID); | 7224 | MakeAssetRequest(transfer, taskID); |
7259 | 7225 | ||
7260 | /* RequestAsset = OnRequestAsset; | ||
7261 | if (RequestAsset != null) | ||
7262 | { | ||
7263 | RequestAsset(this, transfer); | ||
7264 | }*/ | ||
7265 | return true; | 7226 | return true; |
7266 | } | 7227 | } |
7267 | 7228 | ||
@@ -11498,15 +11459,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11498 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | 11459 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) |
11499 | { | 11460 | { |
11500 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); | 11461 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); |
11501 | //m_log.Debug("[XXX] inventory asset request " + requestID); | ||
11502 | //if (taskID == UUID.Zero) // Agent | ||
11503 | // if (m_scene is HGScene) | ||
11504 | // { | ||
11505 | // m_log.Debug("[XXX] hg asset request " + requestID); | ||
11506 | // // We may need to fetch the asset from the user's asset server into the local asset server | ||
11507 | // HGAssetMapper mapper = ((HGScene)m_scene).AssetMapper; | ||
11508 | // mapper.Get(requestID, AgentId); | ||
11509 | // } | ||
11510 | } | 11462 | } |
11511 | 11463 | ||
11512 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); | 11464 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); |
@@ -11525,18 +11477,19 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11525 | /// <param name="asset"></param> | 11477 | /// <param name="asset"></param> |
11526 | protected void AssetReceived(string id, Object sender, AssetBase asset) | 11478 | protected void AssetReceived(string id, Object sender, AssetBase asset) |
11527 | { | 11479 | { |
11480 | if (asset == null) | ||
11481 | return; | ||
11482 | |||
11528 | TransferRequestPacket transferRequest = (TransferRequestPacket)sender; | 11483 | TransferRequestPacket transferRequest = (TransferRequestPacket)sender; |
11529 | 11484 | ||
11530 | UUID requestID = UUID.Zero; | 11485 | UUID requestID = UUID.Zero; |
11531 | byte source = (byte)SourceType.Asset; | 11486 | byte source = (byte)SourceType.Asset; |
11532 | 11487 | ||
11533 | if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) | 11488 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) |
11534 | || (transferRequest.TransferInfo.SourceType == 2222)) | ||
11535 | { | 11489 | { |
11536 | requestID = new UUID(transferRequest.TransferInfo.Params, 0); | 11490 | requestID = new UUID(transferRequest.TransferInfo.Params, 0); |
11537 | } | 11491 | } |
11538 | else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | 11492 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) |
11539 | || (transferRequest.TransferInfo.SourceType == 3333)) | ||
11540 | { | 11493 | { |
11541 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); | 11494 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); |
11542 | source = (byte)SourceType.SimInventoryItem; | 11495 | source = (byte)SourceType.SimInventoryItem; |