diff options
author | Teravus Ovares (Dan Olivares) | 2009-08-18 11:09:43 -0400 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2009-08-18 11:09:43 -0400 |
commit | 311b51a1843f43daa7796a46961b65fe702e1b85 (patch) | |
tree | 756554b330c8bdd970f319c3af0327efb9017673 /OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |
parent | * Some Physics Scene Changes to prepare for larger regions (diff) | |
parent | Fixes mantis #4020 (http://opensimulator.org/mantis/view.php?id=4020) (diff) | |
download | opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.zip opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.tar.gz opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.tar.bz2 opensim-SC_OLD-311b51a1843f43daa7796a46961b65fe702e1b85.tar.xz |
*remove conflicts
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | 42 |
1 files changed, 32 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs index f87aab9..bef716b 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteInventoryServiceConnector.cs | |||
@@ -32,6 +32,7 @@ using System.Reflection; | |||
32 | using Nini.Config; | 32 | using Nini.Config; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Statistics; | 34 | using OpenSim.Framework.Statistics; |
35 | using OpenSim.Framework.Communications.Cache; | ||
35 | using OpenSim.Services.Connectors; | 36 | using OpenSim.Services.Connectors; |
36 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
37 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
@@ -48,6 +49,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
48 | private bool m_Enabled = false; | 49 | private bool m_Enabled = false; |
49 | private bool m_Initialized = false; | 50 | private bool m_Initialized = false; |
50 | private Scene m_Scene; | 51 | private Scene m_Scene; |
52 | private UserProfileCacheService m_UserProfileService; | ||
51 | private InventoryServicesConnector m_RemoteConnector; | 53 | private InventoryServicesConnector m_RemoteConnector; |
52 | 54 | ||
53 | public Type ReplaceableInterface | 55 | public Type ReplaceableInterface |
@@ -104,12 +106,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
104 | 106 | ||
105 | public void AddRegion(Scene scene) | 107 | public void AddRegion(Scene scene) |
106 | { | 108 | { |
109 | m_Scene = scene; | ||
110 | m_log.Debug("[XXXX] Adding scene " + m_Scene.RegionInfo.RegionName); | ||
111 | |||
107 | if (!m_Enabled) | 112 | if (!m_Enabled) |
108 | return; | 113 | return; |
109 | 114 | ||
110 | if (!m_Initialized) | 115 | if (!m_Initialized) |
111 | { | 116 | { |
112 | m_Scene = scene; | ||
113 | // ugh! | 117 | // ugh! |
114 | scene.CommsManager.UserProfileCacheService.SetInventoryService(this); | 118 | scene.CommsManager.UserProfileCacheService.SetInventoryService(this); |
115 | scene.CommsManager.UserService.SetInventoryService(this); | 119 | scene.CommsManager.UserService.SetInventoryService(this); |
@@ -130,6 +134,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
130 | 134 | ||
131 | public void RegionLoaded(Scene scene) | 135 | public void RegionLoaded(Scene scene) |
132 | { | 136 | { |
137 | m_UserProfileService = m_Scene.CommsManager.UserProfileCacheService; | ||
138 | if (m_UserProfileService != null) | ||
139 | m_log.Debug("[XXXX] Set m_UserProfileService in " + m_Scene.RegionInfo.RegionName); | ||
140 | |||
133 | if (!m_Enabled) | 141 | if (!m_Enabled) |
134 | return; | 142 | return; |
135 | 143 | ||
@@ -273,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
273 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); | 281 | return m_RemoteConnector.DeleteItem(item.Owner.ToString(), item, sessionID); |
274 | } | 282 | } |
275 | 283 | ||
276 | public override InventoryItemBase QueryItem(InventoryItemBase item) | 284 | public override InventoryItemBase GetItem(InventoryItemBase item) |
277 | { | 285 | { |
278 | if (item == null) | 286 | if (item == null) |
279 | return null; | 287 | return null; |
@@ -282,7 +290,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
282 | return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); | 290 | return m_RemoteConnector.QueryItem(item.Owner.ToString(), item, sessionID); |
283 | } | 291 | } |
284 | 292 | ||
285 | public override InventoryFolderBase QueryFolder(InventoryFolderBase folder) | 293 | public override InventoryFolderBase GetFolder(InventoryFolderBase folder) |
286 | { | 294 | { |
287 | if (folder == null) | 295 | if (folder == null) |
288 | return null; | 296 | return null; |
@@ -296,25 +304,39 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory | |||
296 | return false; | 304 | return false; |
297 | } | 305 | } |
298 | 306 | ||
299 | public override InventoryFolderBase GetRootFolder(UUID userID) | 307 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) |
300 | { | 308 | { |
301 | return null; | 309 | return new List<InventoryItemBase>(); |
302 | } | 310 | } |
303 | 311 | ||
304 | public override List<InventoryItemBase> GetActiveGestures(UUID userId) | 312 | public override int GetAssetPermissions(UUID userID, UUID assetID) |
305 | { | 313 | { |
306 | return new List<InventoryItemBase>(); | 314 | UUID sessionID = GetSessionID(userID); |
315 | return m_RemoteConnector.GetAssetPermissions(userID.ToString(), assetID, sessionID); | ||
307 | } | 316 | } |
308 | 317 | ||
318 | |||
309 | #endregion | 319 | #endregion |
310 | 320 | ||
311 | private UUID GetSessionID(UUID userID) | 321 | private UUID GetSessionID(UUID userID) |
312 | { | 322 | { |
313 | ScenePresence sp = m_Scene.GetScenePresence(userID); | 323 | if (m_Scene == null) |
314 | if (sp != null) | 324 | { |
315 | return sp.ControllingClient.SessionId; | 325 | m_log.Debug("[INVENTORY CONNECTOR]: OOPS! scene is null"); |
326 | } | ||
316 | 327 | ||
328 | if (m_UserProfileService == null) | ||
329 | { | ||
330 | m_log.Debug("[INVENTORY CONNECTOR]: OOPS! UserProfileCacheService is null"); | ||
331 | return UUID.Zero; | ||
332 | } | ||
333 | |||
334 | CachedUserInfo uinfo = m_UserProfileService.GetUserDetails(userID); | ||
335 | if (uinfo != null) | ||
336 | return uinfo.SessionID; | ||
337 | m_log.DebugFormat("[INVENTORY CONNECTOR]: user profile for {0} not found", userID); | ||
317 | return UUID.Zero; | 338 | return UUID.Zero; |
339 | |||
318 | } | 340 | } |
319 | 341 | ||
320 | } | 342 | } |