diff options
Diffstat (limited to 'OpenSim')
16 files changed, 149 insertions, 146 deletions
diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 1cc19c5..b91496b 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | |||
@@ -73,7 +73,18 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
73 | { | 73 | { |
74 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) | 74 | if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) |
75 | { | 75 | { |
76 | StreamReader str = new StreamReader(req.Request.Body); | 76 | StreamReader str; |
77 | try | ||
78 | { | ||
79 | str = new StreamReader(req.Request.Body); | ||
80 | } | ||
81 | catch (System.ArgumentException) | ||
82 | { | ||
83 | // Stream was not readable means a child agent | ||
84 | // was closed due to logout, leaving the | ||
85 | // Event Queue request orphaned. | ||
86 | continue; | ||
87 | } | ||
77 | 88 | ||
78 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); | 89 | Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); |
79 | m_server.DoHTTPGruntWork(responsedata, | 90 | m_server.DoHTTPGruntWork(responsedata, |
@@ -106,4 +117,4 @@ namespace OpenSim.Framework.Servers.HttpServer | |||
106 | m_request.Enqueue(pPollServiceHttpRequest); | 117 | m_request.Enqueue(pPollServiceHttpRequest); |
107 | } | 118 | } |
108 | } | 119 | } |
109 | } \ No newline at end of file | 120 | } |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs index 5c17b0e..9dd6663 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs | |||
@@ -55,7 +55,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
55 | public IJ2KDecoder J2KDecoder; | 55 | public IJ2KDecoder J2KDecoder; |
56 | public IAssetService AssetService; | 56 | public IAssetService AssetService; |
57 | public UUID AgentID; | 57 | public UUID AgentID; |
58 | public IHyperAssetService HyperAssets; | 58 | public IInventoryAccessModule InventoryAccessModule; |
59 | public OpenJPEG.J2KLayerInfo[] Layers; | 59 | public OpenJPEG.J2KLayerInfo[] Layers; |
60 | public bool IsDecoded; | 60 | public bool IsDecoded; |
61 | public bool HasAsset; | 61 | public bool HasAsset; |
@@ -378,14 +378,18 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
378 | UUID assetID = UUID.Zero; | 378 | UUID assetID = UUID.Zero; |
379 | if (asset != null) | 379 | if (asset != null) |
380 | assetID = asset.FullID; | 380 | assetID = asset.FullID; |
381 | else if ((HyperAssets != null) && (sender != HyperAssets)) | 381 | else if ((InventoryAccessModule != null) && (sender != InventoryAccessModule)) |
382 | { | 382 | { |
383 | // Try the user's inventory, but only if it's different from the regions' | 383 | // Unfortunately we need this here, there's no other way. |
384 | string userAssets = HyperAssets.GetUserAssetServer(AgentID); | 384 | // This is due to the fact that textures opened directly from the agent's inventory |
385 | if ((userAssets != string.Empty) && (userAssets != HyperAssets.GetSimAssetServer())) | 385 | // don't have any distinguishing feature. As such, in order to serve those when the |
386 | // foreign user is visiting, we need to try again after the first fail to the local | ||
387 | // asset service. | ||
388 | string assetServerURL = string.Empty; | ||
389 | if (InventoryAccessModule.IsForeignUser(AgentID, out assetServerURL)) | ||
386 | { | 390 | { |
387 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); | 391 | m_log.DebugFormat("[J2KIMAGE]: texture {0} not found in local asset storage. Trying user's storage.", id); |
388 | AssetService.Get(userAssets + "/" + id, HyperAssets, AssetReceived); | 392 | AssetService.Get(assetServerURL + "/" + id, InventoryAccessModule, AssetReceived); |
389 | return; | 393 | return; |
390 | } | 394 | } |
391 | } | 395 | } |
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; |
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 938cf50..9e0db12 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs | |||
@@ -58,8 +58,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
58 | private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); | 58 | private C5.IntervalHeap<J2KImage> m_priorityQueue = new C5.IntervalHeap<J2KImage>(10, new J2KImageComparer()); |
59 | private object m_syncRoot = new object(); | 59 | private object m_syncRoot = new object(); |
60 | 60 | ||
61 | private IHyperAssetService m_hyperAssets; | ||
62 | |||
63 | public LLClientView Client { get { return m_client; } } | 61 | public LLClientView Client { get { return m_client; } } |
64 | public AssetBase MissingImage { get { return m_missingImage; } } | 62 | public AssetBase MissingImage { get { return m_missingImage; } } |
65 | 63 | ||
@@ -75,7 +73,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
75 | m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); | 73 | m_log.Error("[ClientView] - Couldn't set missing image asset, falling back to missing image packet. This is known to crash the client"); |
76 | 74 | ||
77 | m_j2kDecodeModule = pJ2kDecodeModule; | 75 | m_j2kDecodeModule = pJ2kDecodeModule; |
78 | m_hyperAssets = client.Scene.RequestModuleInterface<IHyperAssetService>(); | ||
79 | } | 76 | } |
80 | 77 | ||
81 | /// <summary> | 78 | /// <summary> |
@@ -149,7 +146,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
149 | imgrequest.J2KDecoder = m_j2kDecodeModule; | 146 | imgrequest.J2KDecoder = m_j2kDecodeModule; |
150 | imgrequest.AssetService = m_assetCache; | 147 | imgrequest.AssetService = m_assetCache; |
151 | imgrequest.AgentID = m_client.AgentId; | 148 | imgrequest.AgentID = m_client.AgentId; |
152 | imgrequest.HyperAssets = m_hyperAssets; | 149 | imgrequest.InventoryAccessModule = m_client.Scene.RequestModuleInterface<IInventoryAccessModule>(); |
153 | imgrequest.DiscardLevel = newRequest.DiscardLevel; | 150 | imgrequest.DiscardLevel = newRequest.DiscardLevel; |
154 | imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); | 151 | imgrequest.StartPacket = Math.Max(1, newRequest.PacketNumber); |
155 | imgrequest.Priority = newRequest.Priority; | 152 | imgrequest.Priority = newRequest.Priority; |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs index c1e92f5..b13b9d8 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs | |||
@@ -157,6 +157,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
157 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); | 157 | Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); |
158 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); | 158 | HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); |
159 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); | 159 | uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); |
160 | if (ids.ContainsKey(assetID)) | ||
161 | ids.Remove(assetID); | ||
160 | foreach (UUID uuid in ids.Keys) | 162 | foreach (UUID uuid in ids.Keys) |
161 | FetchAsset(userAssetURL, uuid); | 163 | FetchAsset(userAssetURL, uuid); |
162 | 164 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index b0555da..8ccc941 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs | |||
@@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
131 | return ret; | 131 | return ret; |
132 | } | 132 | } |
133 | 133 | ||
134 | // DO NOT OVERRIDE THIS METHOD | 134 | // DO NOT OVERRIDE THE BASE METHOD |
135 | public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, | 135 | public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, |
136 | SceneObjectGroup objectGroup, IClientAPI remoteClient) | 136 | SceneObjectGroup objectGroup, IClientAPI remoteClient) |
137 | { | 137 | { |
@@ -139,7 +139,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
139 | 139 | ||
140 | if (!assetID.Equals(UUID.Zero)) | 140 | if (!assetID.Equals(UUID.Zero)) |
141 | { | 141 | { |
142 | UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); | 142 | if (remoteClient != null) |
143 | UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); | ||
143 | } | 144 | } |
144 | else | 145 | else |
145 | m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); | 146 | m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); |
@@ -192,9 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
192 | m_assMapper.Post(item.AssetID, receiver, userAssetServer); | 193 | m_assMapper.Post(item.AssetID, receiver, userAssetServer); |
193 | } | 194 | } |
194 | 195 | ||
195 | #endregion | 196 | public override bool IsForeignUser(UUID userID, out string assetServerURL) |
196 | |||
197 | public bool IsForeignUser(UUID userID, out string assetServerURL) | ||
198 | { | 197 | { |
199 | assetServerURL = string.Empty; | 198 | assetServerURL = string.Empty; |
200 | UserAccount account = null; | 199 | UserAccount account = null; |
@@ -217,5 +216,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
217 | 216 | ||
218 | return false; | 217 | return false; |
219 | } | 218 | } |
219 | |||
220 | #endregion | ||
221 | |||
222 | protected override InventoryItemBase GetItem(UUID agentID, UUID itemID) | ||
223 | { | ||
224 | InventoryItemBase item = base.GetItem(agentID, itemID); | ||
225 | |||
226 | string userAssetServer = string.Empty; | ||
227 | if (IsForeignUser(agentID, out userAssetServer)) | ||
228 | m_assMapper.Get(item.AssetID, agentID, userAssetServer); | ||
229 | |||
230 | return item; | ||
231 | } | ||
220 | } | 232 | } |
221 | } | 233 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 12b6aa0..90b7b51 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs | |||
@@ -639,6 +639,57 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
639 | { | 639 | { |
640 | } | 640 | } |
641 | 641 | ||
642 | public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID) | ||
643 | { | ||
644 | InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID); | ||
645 | if (assetRequestItem == null) | ||
646 | { | ||
647 | ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>(); | ||
648 | if (lib != null) | ||
649 | assetRequestItem = lib.LibraryRootFolder.FindItem(itemID); | ||
650 | if (assetRequestItem == null) | ||
651 | return false; | ||
652 | } | ||
653 | |||
654 | // At this point, we need to apply perms | ||
655 | // only to notecards and scripts. All | ||
656 | // other asset types are always available | ||
657 | // | ||
658 | if (assetRequestItem.AssetType == (int)AssetType.LSLText) | ||
659 | { | ||
660 | if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId)) | ||
661 | { | ||
662 | remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false); | ||
663 | return false; | ||
664 | } | ||
665 | } | ||
666 | else if (assetRequestItem.AssetType == (int)AssetType.Notecard) | ||
667 | { | ||
668 | if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId)) | ||
669 | { | ||
670 | remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false); | ||
671 | return false; | ||
672 | } | ||
673 | } | ||
674 | |||
675 | if (assetRequestItem.AssetID != requestID) | ||
676 | { | ||
677 | m_log.WarnFormat( | ||
678 | "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}", | ||
679 | Name, requestID, itemID, assetRequestItem.AssetID); | ||
680 | return false; | ||
681 | } | ||
682 | |||
683 | return true; | ||
684 | } | ||
685 | |||
686 | |||
687 | public virtual bool IsForeignUser(UUID userID, out string assetServerURL) | ||
688 | { | ||
689 | assetServerURL = string.Empty; | ||
690 | return false; | ||
691 | } | ||
692 | |||
642 | #endregion | 693 | #endregion |
643 | 694 | ||
644 | #region Misc | 695 | #region Misc |
@@ -661,6 +712,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess | |||
661 | return asset; | 712 | return asset; |
662 | } | 713 | } |
663 | 714 | ||
715 | protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID) | ||
716 | { | ||
717 | IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>(); | ||
718 | InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID); | ||
719 | assetRequestItem = invService.GetItem(assetRequestItem); | ||
720 | return assetRequestItem; | ||
721 | } | ||
722 | |||
664 | #endregion | 723 | #endregion |
665 | } | 724 | } |
666 | } | 725 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs index ebd6bbd..034e692 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs | |||
@@ -41,7 +41,7 @@ using OpenMetaverse; | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | 41 | namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset |
42 | { | 42 | { |
43 | public class HGAssetBroker : | 43 | public class HGAssetBroker : |
44 | ISharedRegionModule, IAssetService, IHyperAssetService | 44 | ISharedRegionModule, IAssetService |
45 | { | 45 | { |
46 | private static readonly ILog m_log = | 46 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 47 | LogManager.GetLogger( |
@@ -150,7 +150,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset | |||
150 | m_aScene = scene; | 150 | m_aScene = scene; |
151 | 151 | ||
152 | scene.RegisterModuleInterface<IAssetService>(this); | 152 | scene.RegisterModuleInterface<IAssetService>(this); |
153 | scene.RegisterModuleInterface<IHyperAssetService>(this); | ||
154 | } | 153 | } |
155 | 154 | ||
156 | public void RemoveRegion(Scene scene) | 155 | public void RemoveRegion(Scene scene) |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs index e09db15..4ec5253 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs | |||
@@ -202,9 +202,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
202 | } | 202 | } |
203 | } | 203 | } |
204 | } | 204 | } |
205 | |||
206 | // else put a null; it means that the methods should forward to local grid's inventory | ||
207 | m_InventoryURLs.Add(userID, null); | ||
208 | } | 205 | } |
209 | 206 | ||
210 | private void DropInventoryServiceURL(UUID userID) | 207 | private void DropInventoryServiceURL(UUID userID) |
@@ -223,10 +220,13 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
223 | if (m_InventoryURLs.ContainsKey(userID)) | 220 | if (m_InventoryURLs.ContainsKey(userID)) |
224 | return m_InventoryURLs[userID]; | 221 | return m_InventoryURLs[userID]; |
225 | 222 | ||
226 | else | 223 | CacheInventoryServiceURL(userID); |
227 | CacheInventoryServiceURL(userID); | 224 | |
225 | if (m_InventoryURLs.ContainsKey(userID)) | ||
226 | return m_InventoryURLs[userID]; | ||
228 | 227 | ||
229 | return m_InventoryURLs[userID]; | 228 | return null; //it means that the methods should forward to local grid's inventory |
229 | |||
230 | } | 230 | } |
231 | #endregion | 231 | #endregion |
232 | 232 | ||
diff --git a/OpenSim/Region/DataSnapshot/SnapshotStore.cs b/OpenSim/Region/DataSnapshot/SnapshotStore.cs index 976c2c1..70cb205 100644 --- a/OpenSim/Region/DataSnapshot/SnapshotStore.cs +++ b/OpenSim/Region/DataSnapshot/SnapshotStore.cs | |||
@@ -258,21 +258,16 @@ namespace OpenSim.Region.DataSnapshot | |||
258 | 258 | ||
259 | private String GetRegionCategory(Scene scene) | 259 | private String GetRegionCategory(Scene scene) |
260 | { | 260 | { |
261 | //Boolean choice between: | 261 | if (scene.RegionInfo.RegionSettings.Maturity == 0) |
262 | // "PG" - Mormontown | 262 | return "PG"; |
263 | // "Mature" - Sodom and Gomorrah | 263 | |
264 | if (scene.RegionInfo.RegionSettings.Maturity == 1) | 264 | if (scene.RegionInfo.RegionSettings.Maturity == 1) |
265 | { | ||
266 | return "Mature"; | 265 | return "Mature"; |
267 | } | 266 | |
268 | else if (scene.RegionInfo.RegionSettings.Maturity == 0) | 267 | if (scene.RegionInfo.RegionSettings.Maturity == 2) |
269 | { | 268 | return "Adult"; |
270 | return "PG"; | 269 | |
271 | } | 270 | return "Unknown"; |
272 | else | ||
273 | { | ||
274 | return "Unknown"; | ||
275 | } | ||
276 | } | 271 | } |
277 | 272 | ||
278 | private XmlNode GetGridSnapshotData(XmlDocument factory) | 273 | private XmlNode GetGridSnapshotData(XmlDocument factory) |
diff --git a/OpenSim/Region/Framework/Interfaces/IHyperService.cs b/OpenSim/Region/Framework/Interfaces/IHyperService.cs deleted file mode 100644 index 51ea28a..0000000 --- a/OpenSim/Region/Framework/Interfaces/IHyperService.cs +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSimulator Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | using System; | ||
28 | using OpenMetaverse; | ||
29 | |||
30 | namespace OpenSim.Region.Framework.Interfaces | ||
31 | { | ||
32 | public interface IHyperAssetService | ||
33 | { | ||
34 | string GetUserAssetServer(UUID userID); | ||
35 | string GetSimAssetServer(); | ||
36 | } | ||
37 | } | ||
diff --git a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs index 97f4188..05fc2ad 100644 --- a/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IInventoryAccessModule.cs | |||
@@ -43,5 +43,9 @@ namespace OpenSim.Region.Framework.Interfaces | |||
43 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, | 43 | UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, |
44 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); | 44 | bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment); |
45 | void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); | 45 | void TransferInventoryAssets(InventoryItemBase item, UUID sender, UUID receiver); |
46 | bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID); | ||
47 | |||
48 | // Must be here because of textures in user's inventory | ||
49 | bool IsForeignUser(UUID userID, out string assetServerURL); | ||
46 | } | 50 | } |
47 | } | 51 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index b859042..38a5456 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1622,7 +1622,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1622 | } | 1622 | } |
1623 | 1623 | ||
1624 | // Handle god perms | 1624 | // Handle god perms |
1625 | if (remoteClient != null && Permissions.IsGod(remoteClient.AgentId)) | 1625 | if ((remoteClient != null) && Permissions.IsGod(remoteClient.AgentId)) |
1626 | { | 1626 | { |
1627 | permissionToTake = true; | 1627 | permissionToTake = true; |
1628 | permissionToTakeCopy = true; | 1628 | permissionToTakeCopy = true; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index b335ae6..f996ff4 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -518,13 +518,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
518 | 518 | ||
519 | public LSL_Vector llVecNorm(LSL_Vector v) | 519 | public LSL_Vector llVecNorm(LSL_Vector v) |
520 | { | 520 | { |
521 | m_host.AddScriptLPS(1); | 521 | m_host.AddScriptLPS(1); |
522 | double mag = LSL_Vector.Mag(v); | 522 | return LSL_Vector.Norm(v); |
523 | LSL_Vector nor = new LSL_Vector(); | ||
524 | nor.x = v.x / mag; | ||
525 | nor.y = v.y / mag; | ||
526 | nor.z = v.z / mag; | ||
527 | return nor; | ||
528 | } | 523 | } |
529 | 524 | ||
530 | public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b) | 525 | public LSL_Float llVecDist(LSL_Vector a, LSL_Vector b) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs index 5927973..01141ee 100644 --- a/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs +++ b/OpenSim/Region/ScriptEngine/Shared/LSL_Types.cs | |||
@@ -259,10 +259,15 @@ namespace OpenSim.Region.ScriptEngine.Shared | |||
259 | return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); | 259 | return Math.Sqrt(v.x * v.x + v.y * v.y + v.z * v.z); |
260 | } | 260 | } |
261 | 261 | ||
262 | public static Vector3 Norm(Vector3 vector) | 262 | public static Vector3 Norm(Vector3 vector) |
263 | { | 263 | { |
264 | double mag = Mag(vector); | 264 | double mag = Mag(vector); |
265 | return new Vector3(vector.x / mag, vector.y / mag, vector.z / mag); | 265 | if (mag > 0.0) |
266 | { | ||
267 | double invMag = 1.0 / mag; | ||
268 | return vector * invMag; | ||
269 | } | ||
270 | return new Vector3(0, 0, 0); | ||
266 | } | 271 | } |
267 | 272 | ||
268 | #endregion | 273 | #endregion |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 225530f..46d72dc 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -278,7 +278,11 @@ namespace OpenSim.Services.GridService | |||
278 | 278 | ||
279 | foreach (RegionData rdata in rdatas) | 279 | foreach (RegionData rdata in rdatas) |
280 | if (rdata.RegionID != regionID) | 280 | if (rdata.RegionID != regionID) |
281 | rinfos.Add(RegionData2RegionInfo(rdata)); | 281 | { |
282 | int flags = Convert.ToInt32(rdata.Data["flags"]); | ||
283 | if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours | ||
284 | rinfos.Add(RegionData2RegionInfo(rdata)); | ||
285 | } | ||
282 | 286 | ||
283 | } | 287 | } |
284 | m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); | 288 | m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighours", region.RegionName, rinfos.Count); |