aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
authorMelanie2010-07-08 17:32:57 +0100
committerMelanie2010-07-08 17:32:57 +0100
commit5f400a50beb2b9d523e5a0fac643ca1cb247c9a6 (patch)
treeda874e34ef1c790f9b8ce9dc0533ac98755d783c /OpenSim/Region/ClientStack
parentminimizes temp garbage for llParseStringKeepNulls() (diff)
parentllVecNorm() now returns a zero-length vector when one is supplied as input. A... (diff)
downloadopensim-SC_OLD-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.zip
opensim-SC_OLD-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.tar.gz
opensim-SC_OLD-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.tar.bz2
opensim-SC_OLD-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/J2KImage.cs16
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs69
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs5
3 files changed, 22 insertions, 68 deletions
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;