aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs50
1 files changed, 23 insertions, 27 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
index 5d65f98..b6fa41d 100644
--- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
+++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGAssetMapper.cs
@@ -35,6 +35,7 @@ using OpenSim.Framework;
35using OpenSim.Framework.Communications.Cache; 35using OpenSim.Framework.Communications.Cache;
36using OpenSim.Framework.Communications.Clients; 36using OpenSim.Framework.Communications.Clients;
37using OpenSim.Region.Framework.Scenes.Serialization; 37using OpenSim.Region.Framework.Scenes.Serialization;
38using OpenSim.Services.Interfaces;
38 39
39//using HyperGrid.Framework; 40//using HyperGrid.Framework;
40//using OpenSim.Region.Communications.Hypergrid; 41//using OpenSim.Region.Communications.Hypergrid;
@@ -47,10 +48,21 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 49
49 // This maps between inventory server urls and inventory server clients 50 // This maps between inventory server urls and inventory server clients
50 private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>(); 51// private Dictionary<string, InventoryClient> m_inventoryServers = new Dictionary<string, InventoryClient>();
51
52 52
53 private Scene m_scene; 53 private Scene m_scene;
54
55 private IHyperlinkService m_hyper;
56 IHyperlinkService HyperlinkService
57 {
58 get
59 {
60 if (m_hyper == null)
61 m_hyper = m_scene.RequestModuleInterface<IHyperlinkService>();
62 return m_hyper;
63 }
64 }
65
54 #endregion 66 #endregion
55 67
56 #region Constructor 68 #region Constructor
@@ -72,30 +84,14 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
72 return null; 84 return null;
73 } 85 }
74 86
75 private string UserInventoryURL(UUID userID) 87// private string UserInventoryURL(UUID userID)
76 { 88// {
77 CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID); 89// CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
78 if (uinfo != null) 90// if (uinfo != null)
79 return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI; 91// return (uinfo.UserProfile.UserInventoryURI == "") ? null : uinfo.UserProfile.UserInventoryURI;
80 return null; 92// return null;
81 } 93// }
82 94
83 private bool IsLocalUser(UUID userID)
84 {
85 CachedUserInfo uinfo = m_scene.CommsManager.UserProfileCacheService.GetUserDetails(userID);
86
87 if (uinfo != null)
88 {
89 if (HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile))
90 {
91 m_log.Debug("[HGScene]: Home user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
92 return true;
93 }
94 }
95
96 m_log.Debug("[HGScene]: Foreign user " + uinfo.UserProfile.FirstName + " " + uinfo.UserProfile.SurName);
97 return false;
98 }
99 95
100 public AssetBase FetchAsset(string url, UUID assetID) 96 public AssetBase FetchAsset(string url, UUID assetID)
101 { 97 {
@@ -171,7 +167,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
171 167
172 public void Get(UUID assetID, UUID ownerID) 168 public void Get(UUID assetID, UUID ownerID)
173 { 169 {
174 if (!IsLocalUser(ownerID)) 170 if (!HyperlinkService.IsLocalUser(ownerID))
175 { 171 {
176 // Get the item from the remote asset server onto the local AssetCache 172 // Get the item from the remote asset server onto the local AssetCache
177 // and place an entry in m_assetMap 173 // and place an entry in m_assetMap
@@ -229,7 +225,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
229 225
230 public void Post(UUID assetID, UUID ownerID) 226 public void Post(UUID assetID, UUID ownerID)
231 { 227 {
232 if (!IsLocalUser(ownerID)) 228 if (!HyperlinkService.IsLocalUser(ownerID))
233 { 229 {
234 // Post the item from the local AssetCache onto the remote asset server 230 // Post the item from the local AssetCache onto the remote asset server
235 // and place an entry in m_assetMap 231 // and place an entry in m_assetMap