diff options
Diffstat (limited to 'OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs')
-rw-r--r-- | OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | 120 |
1 files changed, 12 insertions, 108 deletions
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index d2824bd..0aec01a 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs | |||
@@ -357,7 +357,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
357 | protected uint m_agentFOVCounter; | 357 | protected uint m_agentFOVCounter; |
358 | 358 | ||
359 | protected IAssetService m_assetService; | 359 | protected IAssetService m_assetService; |
360 | private IHyperAssetService m_hyperAssets; | ||
361 | private const bool m_checkPackets = true; | 360 | private const bool m_checkPackets = true; |
362 | 361 | ||
363 | private Timer m_propertiesPacketTimer; | 362 | private Timer m_propertiesPacketTimer; |
@@ -432,7 +431,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
432 | // m_attachmentsSent = new HashSet<uint>(); | 431 | // m_attachmentsSent = new HashSet<uint>(); |
433 | 432 | ||
434 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); | 433 | m_assetService = m_scene.RequestModuleInterface<IAssetService>(); |
435 | m_hyperAssets = m_scene.RequestModuleInterface<IHyperAssetService>(); | ||
436 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); | 434 | m_GroupsModule = scene.RequestModuleInterface<IGroupsModule>(); |
437 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); | 435 | m_imageManager = new LLImageManager(this, m_assetService, Scene.RequestModuleInterface<IJ2KDecoder>()); |
438 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); | 436 | m_channelVersion = Util.StringToBytes256(scene.GetSimulatorVersion()); |
@@ -3680,30 +3678,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
3680 | 3678 | ||
3681 | #endregion Primitive Packet/Data Sending Methods | 3679 | #endregion Primitive Packet/Data Sending Methods |
3682 | 3680 | ||
3683 | /// <summary> | ||
3684 | /// | ||
3685 | /// </summary> | ||
3686 | /// <param name="localID"></param> | ||
3687 | /// <param name="rotation"></param> | ||
3688 | /// <param name="attachPoint"></param> | ||
3689 | public void AttachObject(uint localID, Quaternion rotation, byte attachPoint, UUID ownerID) | ||
3690 | { | ||
3691 | if (attachPoint > 30 && ownerID != AgentId) // Someone else's HUD | ||
3692 | return; | ||
3693 | |||
3694 | ObjectAttachPacket attach = (ObjectAttachPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAttach); | ||
3695 | // TODO: don't create new blocks if recycling an old packet | ||
3696 | attach.AgentData.AgentID = AgentId; | ||
3697 | attach.AgentData.SessionID = m_sessionId; | ||
3698 | attach.AgentData.AttachmentPoint = attachPoint; | ||
3699 | attach.ObjectData = new ObjectAttachPacket.ObjectDataBlock[1]; | ||
3700 | attach.ObjectData[0] = new ObjectAttachPacket.ObjectDataBlock(); | ||
3701 | attach.ObjectData[0].ObjectLocalID = localID; | ||
3702 | attach.ObjectData[0].Rotation = rotation; | ||
3703 | attach.Header.Zerocoded = true; | ||
3704 | OutPacket(attach, ThrottleOutPacketType.Task); | ||
3705 | } | ||
3706 | |||
3707 | void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) | 3681 | void HandleQueueEmpty(ThrottleOutPacketTypeFlags categories) |
3708 | { | 3682 | { |
3709 | if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) | 3683 | if ((categories & ThrottleOutPacketTypeFlags.Task) != 0) |
@@ -5733,7 +5707,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5733 | { | 5707 | { |
5734 | if (att.ObjectData.Length > 0) | 5708 | if (att.ObjectData.Length > 0) |
5735 | { | 5709 | { |
5736 | handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, att.ObjectData[0].Rotation, false); | 5710 | handlerObjectAttach(this, att.ObjectData[0].ObjectLocalID, att.AgentData.AttachmentPoint, false); |
5737 | } | 5711 | } |
5738 | } | 5712 | } |
5739 | } | 5713 | } |
@@ -7196,59 +7170,22 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
7196 | } | 7170 | } |
7197 | else // Agent | 7171 | else // Agent |
7198 | { | 7172 | { |
7199 | IInventoryService invService = m_scene.RequestModuleInterface<IInventoryService>(); | 7173 | IInventoryAccessModule invAccess = m_scene.RequestModuleInterface<IInventoryAccessModule>(); |
7200 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, AgentId); | 7174 | if (invAccess != null) |
7201 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
7202 | if (assetRequestItem == null) | ||
7203 | { | 7175 | { |
7204 | ILibraryService lib = m_scene.RequestModuleInterface<ILibraryService>(); | 7176 | if (!invAccess.GetAgentInventoryItem(this, itemID, requestID)) |
7205 | if (lib != null) | 7177 | return false; |
7206 | assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); | ||
7207 | if (assetRequestItem == null) | ||
7208 | return true; | ||
7209 | } | ||
7210 | 7178 | ||
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 | } | 7179 | } |
7180 | else | ||
7181 | return false; | ||
7231 | 7182 | ||
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 | } | 7183 | } |
7240 | } | 7184 | } |
7241 | } | 7185 | } |
7242 | 7186 | ||
7243 | //m_assetCache.AddAssetRequest(this, transfer); | ||
7244 | |||
7245 | MakeAssetRequest(transfer, taskID); | 7187 | MakeAssetRequest(transfer, taskID); |
7246 | 7188 | ||
7247 | /* RequestAsset = OnRequestAsset; | ||
7248 | if (RequestAsset != null) | ||
7249 | { | ||
7250 | RequestAsset(this, transfer); | ||
7251 | }*/ | ||
7252 | return true; | 7189 | return true; |
7253 | } | 7190 | } |
7254 | 7191 | ||
@@ -11459,15 +11396,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11459 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | 11396 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) |
11460 | { | 11397 | { |
11461 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); | 11398 | 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 | } | 11399 | } |
11472 | 11400 | ||
11473 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); | 11401 | // m_log.DebugFormat("[CLIENT]: {0} requesting asset {1}", Name, requestID); |
@@ -11483,49 +11411,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
11483 | /// <param name="asset"></param> | 11411 | /// <param name="asset"></param> |
11484 | protected void AssetReceived(string id, Object sender, AssetBase asset) | 11412 | protected void AssetReceived(string id, Object sender, AssetBase asset) |
11485 | { | 11413 | { |
11414 | if (asset == null) | ||
11415 | return; | ||
11416 | |||
11486 | TransferRequestPacket transferRequest = (TransferRequestPacket)sender; | 11417 | TransferRequestPacket transferRequest = (TransferRequestPacket)sender; |
11487 | 11418 | ||
11488 | UUID requestID = UUID.Zero; | 11419 | UUID requestID = UUID.Zero; |
11489 | byte source = (byte)SourceType.Asset; | 11420 | byte source = (byte)SourceType.Asset; |
11490 | 11421 | ||
11491 | if ((transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) | 11422 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset) |
11492 | || (transferRequest.TransferInfo.SourceType == 2222)) | ||
11493 | { | 11423 | { |
11494 | requestID = new UUID(transferRequest.TransferInfo.Params, 0); | 11424 | requestID = new UUID(transferRequest.TransferInfo.Params, 0); |
11495 | } | 11425 | } |
11496 | else if ((transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) | 11426 | else if (transferRequest.TransferInfo.SourceType == (int)SourceType.SimInventoryItem) |
11497 | || (transferRequest.TransferInfo.SourceType == 3333)) | ||
11498 | { | 11427 | { |
11499 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); | 11428 | requestID = new UUID(transferRequest.TransferInfo.Params, 80); |
11500 | source = (byte)SourceType.SimInventoryItem; | 11429 | source = (byte)SourceType.SimInventoryItem; |
11501 | //m_log.Debug("asset request " + requestID); | 11430 | //m_log.Debug("asset request " + requestID); |
11502 | } | 11431 | } |
11503 | 11432 | ||
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 | 11433 | // Scripts cannot be retrieved by direct request |
11530 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) | 11434 | if (transferRequest.TransferInfo.SourceType == (int)SourceType.Asset && asset.Type == 10) |
11531 | return; | 11435 | return; |