aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/ServiceConnectorsOut
diff options
context:
space:
mode:
authorDiva Canto2009-10-12 17:00:01 -0700
committerDiva Canto2009-10-12 17:00:01 -0700
commitc0beeb929e22509329781cdf85f7a5d90c4b0e36 (patch)
tree42f724d921f08b0d2d14c8f7eb872a118a9adadd /OpenSim/Region/CoreModules/ServiceConnectorsOut
parent0004246: [Patch] FlotsamAssetCache deep scan & cache (diff)
downloadopensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.zip
opensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.tar.gz
opensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.tar.bz2
opensim-SC_OLD-c0beeb929e22509329781cdf85f7a5d90c4b0e36.tar.xz
* Fixes http://opensimulator.org/mantis/view.php?id=4225
* Fixes http://opensimulator.org/mantis/view.php?id=3959 * Allows for viewing inventory textures outside home grid
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs44
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs3
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs2
4 files changed, 49 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
index 7b4e374..0aa753d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Asset/HGAssetBroker.cs
@@ -31,6 +31,7 @@ using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.Reflection; 32using System.Reflection;
33using OpenSim.Framework; 33using OpenSim.Framework;
34using OpenSim.Framework.Communications.Cache;
34using OpenSim.Server.Base; 35using OpenSim.Server.Base;
35using OpenSim.Region.Framework.Interfaces; 36using OpenSim.Region.Framework.Interfaces;
36using OpenSim.Region.Framework.Scenes; 37using OpenSim.Region.Framework.Scenes;
@@ -40,7 +41,7 @@ using OpenMetaverse;
40namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset 41namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
41{ 42{
42 public class HGAssetBroker : 43 public class HGAssetBroker :
43 ISharedRegionModule, IAssetService 44 ISharedRegionModule, IAssetService, IHyperAssetService
44 { 45 {
45 private static readonly ILog m_log = 46 private static readonly ILog m_log =
46 LogManager.GetLogger( 47 LogManager.GetLogger(
@@ -50,6 +51,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
50 private IAssetService m_GridService; 51 private IAssetService m_GridService;
51 private IAssetService m_HGService; 52 private IAssetService m_HGService;
52 53
54 private Scene m_aScene;
55 private string m_LocalAssetServiceURI;
56
53 private bool m_Enabled = false; 57 private bool m_Enabled = false;
54 58
55 public Type ReplaceableInterface 59 public Type ReplaceableInterface
@@ -114,6 +118,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
114 return; 118 return;
115 } 119 }
116 120
121 m_LocalAssetServiceURI = assetConfig.GetString("AssetServerURI", string.Empty);
122 if (m_LocalAssetServiceURI == string.Empty)
123 {
124 IConfig netConfig = source.Configs["Network"];
125 m_LocalAssetServiceURI = netConfig.GetString("asset_server_url", string.Empty);
126 }
127
128 if (m_LocalAssetServiceURI != string.Empty)
129 m_LocalAssetServiceURI = m_LocalAssetServiceURI.Trim('/');
130
117 m_Enabled = true; 131 m_Enabled = true;
118 m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled"); 132 m_log.Info("[HG ASSET CONNECTOR]: HG asset broker enabled");
119 } 133 }
@@ -132,8 +146,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
132 { 146 {
133 if (!m_Enabled) 147 if (!m_Enabled)
134 return; 148 return;
149
150 m_aScene = scene;
135 151
136 scene.RegisterModuleInterface<IAssetService>(this); 152 scene.RegisterModuleInterface<IAssetService>(this);
153 scene.RegisterModuleInterface<IHyperAssetService>(this);
137 } 154 }
138 155
139 public void RemoveRegion(Scene scene) 156 public void RemoveRegion(Scene scene)
@@ -344,5 +361,30 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Asset
344 else 361 else
345 return m_GridService.Delete(id); 362 return m_GridService.Delete(id);
346 } 363 }
364
365 #region IHyperAssetService
366
367 public string GetUserAssetServer(UUID userID)
368 {
369 CachedUserInfo uinfo = m_aScene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
370 if ((uinfo != null) && (uinfo.UserProfile != null))
371 {
372 if ((uinfo.UserProfile.UserAssetURI == string.Empty) || (uinfo.UserProfile.UserAssetURI == ""))
373 return m_LocalAssetServiceURI;
374 return uinfo.UserProfile.UserAssetURI.Trim('/');
375 }
376 else
377 {
378 // we don't know anyting about this user
379 return string.Empty;
380 }
381 }
382
383 public string GetSimAssetServer()
384 {
385 return m_LocalAssetServiceURI;
386 }
387
388 #endregion
347 } 389 }
348} 390}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
index 148331b..1422add 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/HGGridConnector.cs
@@ -759,6 +759,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
759 759
760 } 760 }
761 761
762
762 protected bool IsLocalRegion(ulong handle) 763 protected bool IsLocalRegion(ulong handle)
763 { 764 {
764 return m_LocalScenes.ContainsKey(handle); 765 return m_LocalScenes.ContainsKey(handle);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
index bd32f3b..811569f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/BaseInventoryConnector.cs
@@ -159,6 +159,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
159 /// <returns>true if the item was successfully added</returns> 159 /// <returns>true if the item was successfully added</returns>
160 public bool AddItem(InventoryItemBase item) 160 public bool AddItem(InventoryItemBase item)
161 { 161 {
162 if (item == null)
163 return false;
164
162 if (item.Folder == UUID.Zero) 165 if (item.Folder == UUID.Zero)
163 { 166 {
164 InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType); 167 InventoryFolderBase f = GetFolderForType(item.Owner, (AssetType)item.AssetType);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
index fd1a759..f073f32 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker.cs
@@ -386,7 +386,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
386 return false; 386 return false;
387 387
388 if (IsLocalGridUser(item.Owner)) 388 if (IsLocalGridUser(item.Owner))
389 {
389 return m_GridService.AddItem(item); 390 return m_GridService.AddItem(item);
391 }
390 else 392 else
391 { 393 {
392 UUID sessionID = GetSessionID(item.Owner); 394 UUID sessionID = GetSessionID(item.Owner);