aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2010-04-30 19:29:21 +0100
committerMelanie2010-04-30 19:29:21 +0100
commit23282935f1f25fd44d85193f3c13ea97c755f75c (patch)
tree689d44f5657dd36e74c3b4d4dd508c86ee90cea1 /OpenSim/Region
parentFix a null ref from trying to access a dictionary that was never initialized. (diff)
parent* XInventory fairly tested, including for HG. Almost ready to switch. (diff)
downloadopensim-SC_OLD-23282935f1f25fd44d85193f3c13ea97c755f75c.zip
opensim-SC_OLD-23282935f1f25fd44d85193f3c13ea97c755f75c.tar.gz
opensim-SC_OLD-23282935f1f25fd44d85193f3c13ea97c755f75c.tar.bz2
opensim-SC_OLD-23282935f1f25fd44d85193f3c13ea97c755f75c.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml1
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs212
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs2
5 files changed, 85 insertions, 145 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
index 23d5b3c..febd4ca 100644
--- a/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Friends/FriendsModule.cs
@@ -365,6 +365,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
365 List<UUID> GetOnlineFriends(UUID userID) 365 List<UUID> GetOnlineFriends(UUID userID)
366 { 366 {
367 List<string> friendList = new List<string>(); 367 List<string> friendList = new List<string>();
368 List<UUID> online = new List<UUID>();
368 369
369 foreach (FriendInfo fi in m_Friends[userID].Friends) 370 foreach (FriendInfo fi in m_Friends[userID].Friends)
370 { 371 {
@@ -372,9 +373,11 @@ namespace OpenSim.Region.CoreModules.Avatar.Friends
372 friendList.Add(fi.Friend); 373 friendList.Add(fi.Friend);
373 } 374 }
374 375
375 PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray()); 376 if (friendList.Count == 0)
377 // no friends whatsoever
378 return online;
376 379
377 List<UUID> online = new List<UUID>(); 380 PresenceInfo[] presence = PresenceService.GetAgents(friendList.ToArray());
378 381
379 foreach (PresenceInfo pi in presence) 382 foreach (PresenceInfo pi in presence)
380 { 383 {
diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
index 0a5ff3f..c738296 100644
--- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
+++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml
@@ -47,6 +47,7 @@
47 <RegionModule id="RemoteInventoryServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.RemoteInventoryServicesConnector" /> 47 <RegionModule id="RemoteInventoryServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.RemoteInventoryServicesConnector" />
48 <RegionModule id="RemoteXInventoryServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.RemoteXInventoryServicesConnector" /> 48 <RegionModule id="RemoteXInventoryServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.RemoteXInventoryServicesConnector" />
49 <RegionModule id="HGInventoryBroker" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.HGInventoryBroker" /> 49 <RegionModule id="HGInventoryBroker" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.HGInventoryBroker" />
50 <RegionModule id="HGInventoryBroker2" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory.HGInventoryBroker2" />
50 <RegionModule id="LocalNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.LocalNeighbourServicesConnector" /> 51 <RegionModule id="LocalNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.LocalNeighbourServicesConnector" />
51 <RegionModule id="RemoteNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.RemoteNeighbourServicesConnector" /> 52 <RegionModule id="RemoteNeighbourServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Neighbour.RemoteNeighbourServicesConnector" />
52 <RegionModule id="LocalLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.LocalLandServicesConnector" /> 53 <RegionModule id="LocalLandServicesConnector" type="OpenSim.Region.CoreModules.ServiceConnectorsOut.Land.LocalLandServicesConnector" />
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs
index 3509161..fc3393f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/HGInventoryBroker2.cs
@@ -41,27 +41,22 @@ using OpenMetaverse;
41 41
42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory 42namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
43{ 43{
44 public class HGInventoryBroker2 : INonSharedRegionModule, IInventoryService 44 public class HGInventoryBroker2 : ISharedRegionModule, IInventoryService
45 { 45 {
46 private static readonly ILog m_log = 46 private static readonly ILog m_log =
47 LogManager.GetLogger( 47 LogManager.GetLogger(
48 MethodBase.GetCurrentMethod().DeclaringType); 48 MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 private static bool m_Initialized = false;
51 private static bool m_Enabled = false; 50 private static bool m_Enabled = false;
52 51
53 private static IInventoryService m_LocalGridInventoryService; 52 private static IInventoryService m_LocalGridInventoryService;
54 private static ISessionAuthInventoryService m_HGService; // obsolete
55 private Dictionary<string, IInventoryService> m_connectors = new Dictionary<string, IInventoryService>(); 53 private Dictionary<string, IInventoryService> m_connectors = new Dictionary<string, IInventoryService>();
56 54
57 // A cache of userIDs --> ServiceURLs, for HGBroker only 55 // A cache of userIDs --> ServiceURLs, for HGBroker only
58 protected Dictionary<UUID, string> m_InventoryURLs; 56 protected Dictionary<UUID, string> m_InventoryURLs = new Dictionary<UUID,string>();
59 57
60 private Scene m_Scene;
61 private List<Scene> m_Scenes = new List<Scene>(); 58 private List<Scene> m_Scenes = new List<Scene>();
62 59
63 private IUserAccountService m_UserAccountService;
64
65 public Type ReplaceableInterface 60 public Type ReplaceableInterface
66 { 61 {
67 get { return null; } 62 get { return null; }
@@ -74,65 +69,45 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
74 69
75 public void Initialise(IConfigSource source) 70 public void Initialise(IConfigSource source)
76 { 71 {
77 if (!m_Initialized) 72 IConfig moduleConfig = source.Configs["Modules"];
73 if (moduleConfig != null)
78 { 74 {
79 IConfig moduleConfig = source.Configs["Modules"]; 75 string name = moduleConfig.GetString("InventoryServices", "");
80 if (moduleConfig != null) 76 if (name == Name)
81 { 77 {
82 string name = moduleConfig.GetString("InventoryServices", ""); 78 IConfig inventoryConfig = source.Configs["InventoryService"];
83 if (name == Name) 79 if (inventoryConfig == null)
84 { 80 {
85 IConfig inventoryConfig = source.Configs["InventoryService"]; 81 m_log.Error("[HG INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
86 if (inventoryConfig == null) 82 return;
87 { 83 }
88 m_log.Error("[HG INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
89 return;
90 }
91
92 string localDll = inventoryConfig.GetString("LocalGridInventoryService",
93 String.Empty);
94 string HGDll = inventoryConfig.GetString("HypergridInventoryService",
95 String.Empty);
96
97 if (localDll == String.Empty)
98 {
99 m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService");
100 //return;
101 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
102 }
103
104 if (HGDll == String.Empty)
105 {
106 m_log.Error("[HG INVENTORY CONNECTOR]: No HypergridInventoryService named in section InventoryService");
107 //return;
108 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
109 }
110 84
111 Object[] args = new Object[] { source }; 85 string localDll = inventoryConfig.GetString("LocalGridInventoryService",
112 m_LocalGridInventoryService = 86 String.Empty);
113 ServerUtils.LoadPlugin<IInventoryService>(localDll, 87 //string HGDll = inventoryConfig.GetString("HypergridInventoryService",
114 args); 88 // String.Empty);
115 89
116 m_HGService = 90 if (localDll == String.Empty)
117 ServerUtils.LoadPlugin<ISessionAuthInventoryService>(HGDll, 91 {
118 args); 92 m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService");
93 //return;
94 throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
95 }
119 96
120 if (m_LocalGridInventoryService == null) 97 Object[] args = new Object[] { source };
121 { 98 m_LocalGridInventoryService =
122 m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service"); 99 ServerUtils.LoadPlugin<IInventoryService>(localDll,
123 return; 100 args);
124 }
125 if (m_HGService == null)
126 {
127 m_log.Error("[HG INVENTORY CONNECTOR]: Can't load hypergrid inventory service");
128 return;
129 }
130 101
131 m_Enabled = true; 102 if (m_LocalGridInventoryService == null)
132 m_log.Info("[HG INVENTORY CONNECTOR]: HG inventory broker enabled"); 103 {
104 m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service");
105 return;
133 } 106 }
107
108 m_Enabled = true;
109 m_log.InfoFormat("[HG INVENTORY CONNECTOR]: HG inventory broker enabled with inner connector of type {0}", m_LocalGridInventoryService.GetType());
134 } 110 }
135 m_Initialized = true;
136 } 111 }
137 } 112 }
138 113
@@ -149,13 +124,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
149 if (!m_Enabled) 124 if (!m_Enabled)
150 return; 125 return;
151 126
152 m_Scene = scene;
153 m_Scenes.Add(scene); 127 m_Scenes.Add(scene);
154 m_UserAccountService = m_Scene.UserAccountService;
155 128
156 scene.RegisterModuleInterface<IInventoryService>(this); 129 scene.RegisterModuleInterface<IInventoryService>(this);
157 130
158 scene.EventManager.OnMakeRootAgent += OnMakeRootAgent;
159 scene.EventManager.OnClientClosed += OnClientClosed; 131 scene.EventManager.OnClientClosed += OnClientClosed;
160 132
161 } 133 }
@@ -177,13 +149,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
177 149
178 } 150 }
179 151
180 #region Cache 152 #region URL Cache
181
182 void OnMakeRootAgent(ScenePresence presence)
183 {
184 if (!m_InventoryURLs.ContainsKey(presence.UUID))
185 CacheInventoryServiceURL(presence.Scene, presence.UUID);
186 }
187 153
188 void OnClientClosed(UUID clientID, Scene scene) 154 void OnClientClosed(UUID clientID, Scene scene)
189 { 155 {
@@ -200,10 +166,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
200 return; 166 return;
201 } 167 }
202 } 168 }
203
204 m_log.DebugFormat(
205 "[INVENTORY CACHE]: OnClientClosed in {0}, user {1} out of sim. Dropping inventory URL",
206 scene.RegionInfo.RegionName, clientID);
207 DropInventoryServiceURL(clientID); 169 DropInventoryServiceURL(clientID);
208 } 170 }
209 } 171 }
@@ -213,35 +175,47 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
213 /// and sticks it in the cache 175 /// and sticks it in the cache
214 /// </summary> 176 /// </summary>
215 /// <param name="userID"></param> 177 /// <param name="userID"></param>
216 private void CacheInventoryServiceURL(Scene scene, UUID userID) 178 private void CacheInventoryServiceURL(UUID userID)
217 { 179 {
218 if (scene.UserAccountService.GetUserAccount(scene.RegionInfo.ScopeID, userID) == null) 180 if (m_Scenes[0].UserAccountService.GetUserAccount(m_Scenes[0].RegionInfo.ScopeID, userID) == null)
219 { 181 {
220 // The user does not have a local account; let's cache its service URL 182 // The user does not have a local account; let's cache its service URL
221 string inventoryURL = string.Empty; 183 string inventoryURL = string.Empty;
222 ScenePresence sp = null; 184 ScenePresence sp = null;
223 scene.TryGetScenePresence(userID, out sp); 185 foreach (Scene scene in m_Scenes)
224 if (sp != null)
225 { 186 {
226 AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 187 scene.TryGetScenePresence(userID, out sp);
227 if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI")) 188 if (sp != null)
228 { 189 {
229 inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString(); 190 AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
230 if (inventoryURL != null && inventoryURL != string.Empty) 191 if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
231 { 192 {
232 inventoryURL = inventoryURL.Trim(new char[] { '/' }); 193 inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
233 m_InventoryURLs.Add(userID, inventoryURL); 194 if (inventoryURL != null && inventoryURL != string.Empty)
195 {
196 inventoryURL = inventoryURL.Trim(new char[] { '/' });
197 m_InventoryURLs.Add(userID, inventoryURL);
198 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL);
199 return;
200 }
234 } 201 }
235 } 202 }
236 } 203 }
237 } 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);
238 } 208 }
239 209
240 private void DropInventoryServiceURL(UUID userID) 210 private void DropInventoryServiceURL(UUID userID)
241 { 211 {
242 lock (m_InventoryURLs) 212 lock (m_InventoryURLs)
243 if (m_InventoryURLs.ContainsKey(userID)) 213 if (m_InventoryURLs.ContainsKey(userID))
214 {
215 string url = m_InventoryURLs[userID];
244 m_InventoryURLs.Remove(userID); 216 m_InventoryURLs.Remove(userID);
217 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url);
218 }
245 } 219 }
246 220
247 public string GetInventoryServiceURL(UUID userID) 221 public string GetInventoryServiceURL(UUID userID)
@@ -249,7 +223,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
249 if (m_InventoryURLs.ContainsKey(userID)) 223 if (m_InventoryURLs.ContainsKey(userID))
250 return m_InventoryURLs[userID]; 224 return m_InventoryURLs[userID];
251 225
252 return null; 226 else
227 CacheInventoryServiceURL(userID);
228
229 return m_InventoryURLs[userID];
253 } 230 }
254 #endregion 231 #endregion
255 232
@@ -276,7 +253,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
276 253
277 public InventoryFolderBase GetRootFolder(UUID userID) 254 public InventoryFolderBase GetRootFolder(UUID userID)
278 { 255 {
279 m_log.DebugFormat("[HGInventory]: GetRootFolder for {0}", userID); 256 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
280 257
281 string invURL = GetInventoryServiceURL(userID); 258 string invURL = GetInventoryServiceURL(userID);
282 259
@@ -290,7 +267,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
290 267
291 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type) 268 public InventoryFolderBase GetFolderForType(UUID userID, AssetType type)
292 { 269 {
293 m_log.DebugFormat("[HGInventory]: GetFolderForType {0} type {1}", userID, type); 270 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
294 271
295 string invURL = GetInventoryServiceURL(userID); 272 string invURL = GetInventoryServiceURL(userID);
296 273
@@ -304,7 +281,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
304 281
305 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 282 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
306 { 283 {
307 m_log.Debug("[HGInventory]: GetFolderContent " + folderID); 284 m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID);
308 285
309 string invURL = GetInventoryServiceURL(userID); 286 string invURL = GetInventoryServiceURL(userID);
310 287
@@ -319,7 +296,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
319 296
320 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID) 297 public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
321 { 298 {
322 m_log.Debug("[HGInventory]: GetFolderItems " + folderID); 299 m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID);
323 300
324 string invURL = GetInventoryServiceURL(userID); 301 string invURL = GetInventoryServiceURL(userID);
325 302
@@ -337,7 +314,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
337 if (folder == null) 314 if (folder == null)
338 return false; 315 return false;
339 316
340 m_log.Debug("[HGInventory]: AddFolder " + folder.ID); 317 m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID);
341 318
342 string invURL = GetInventoryServiceURL(folder.Owner); 319 string invURL = GetInventoryServiceURL(folder.Owner);
343 320
@@ -354,7 +331,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
354 if (folder == null) 331 if (folder == null)
355 return false; 332 return false;
356 333
357 m_log.Debug("[HGInventory]: UpdateFolder " + folder.ID); 334 m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID);
358 335
359 string invURL = GetInventoryServiceURL(folder.Owner); 336 string invURL = GetInventoryServiceURL(folder.Owner);
360 337
@@ -373,7 +350,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
373 if (folderIDs.Count == 0) 350 if (folderIDs.Count == 0)
374 return false; 351 return false;
375 352
376 m_log.Debug("[HGInventory]: DeleteFolders for " + ownerID); 353 m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
377 354
378 string invURL = GetInventoryServiceURL(ownerID); 355 string invURL = GetInventoryServiceURL(ownerID);
379 356
@@ -390,7 +367,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
390 if (folder == null) 367 if (folder == null)
391 return false; 368 return false;
392 369
393 m_log.Debug("[HGInventory]: MoveFolder for " + folder.Owner); 370 m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner);
394 371
395 string invURL = GetInventoryServiceURL(folder.Owner); 372 string invURL = GetInventoryServiceURL(folder.Owner);
396 373
@@ -407,7 +384,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
407 if (folder == null) 384 if (folder == null)
408 return false; 385 return false;
409 386
410 m_log.Debug("[HGInventory]: PurgeFolder for " + folder.Owner); 387 m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner);
411 388
412 string invURL = GetInventoryServiceURL(folder.Owner); 389 string invURL = GetInventoryServiceURL(folder.Owner);
413 390
@@ -424,7 +401,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
424 if (item == null) 401 if (item == null)
425 return false; 402 return false;
426 403
427 m_log.Debug("[HGInventory]: AddItem " + item.ID); 404 m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID);
428 405
429 string invURL = GetInventoryServiceURL(item.Owner); 406 string invURL = GetInventoryServiceURL(item.Owner);
430 407
@@ -441,7 +418,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
441 if (item == null) 418 if (item == null)
442 return false; 419 return false;
443 420
444 m_log.Debug("[HGInventory]: UpdateItem " + item.ID); 421 m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID);
445 422
446 string invURL = GetInventoryServiceURL(item.Owner); 423 string invURL = GetInventoryServiceURL(item.Owner);
447 424
@@ -460,7 +437,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
460 if (items.Count == 0) 437 if (items.Count == 0)
461 return true; 438 return true;
462 439
463 m_log.Debug("[HGInventory]: MoveItems for " + ownerID); 440 m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
464 441
465 string invURL = GetInventoryServiceURL(ownerID); 442 string invURL = GetInventoryServiceURL(ownerID);
466 443
@@ -481,7 +458,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
481 if (itemIDs.Count == 0) 458 if (itemIDs.Count == 0)
482 return true; 459 return true;
483 460
484 m_log.Debug("[HGInventory]: DeleteItems for " + ownerID); 461 m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteItems for " + ownerID);
485 462
486 string invURL = GetInventoryServiceURL(ownerID); 463 string invURL = GetInventoryServiceURL(ownerID);
487 464
@@ -497,7 +474,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
497 { 474 {
498 if (item == null) 475 if (item == null)
499 return null; 476 return null;
500 m_log.Debug("[HGInventory]: GetItem " + item.ID); 477 m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
501 478
502 string invURL = GetInventoryServiceURL(item.Owner); 479 string invURL = GetInventoryServiceURL(item.Owner);
503 480
@@ -514,7 +491,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
514 if (folder == null) 491 if (folder == null)
515 return null; 492 return null;
516 493
517 m_log.Debug("[HGInventory]: GetFolder " + folder.ID); 494 m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID);
518 495
519 string invURL = GetInventoryServiceURL(folder.Owner); 496 string invURL = GetInventoryServiceURL(folder.Owner);
520 497
@@ -538,7 +515,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
538 515
539 public int GetAssetPermissions(UUID userID, UUID assetID) 516 public int GetAssetPermissions(UUID userID, UUID assetID)
540 { 517 {
541 m_log.Debug("[HGInventory]: GetAssetPermissions " + assetID); 518 m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID);
542 519
543 string invURL = GetInventoryServiceURL(userID); 520 string invURL = GetInventoryServiceURL(userID);
544 521
@@ -575,44 +552,5 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
575 return connector; 552 return connector;
576 } 553 }
577 554
578
579 private UUID GetSessionID(UUID userID)
580 {
581 ScenePresence sp = null;
582 if (m_Scene.TryGetScenePresence(userID, out sp))
583 {
584 return sp.ControllingClient.SessionId;
585 }
586
587 m_log.DebugFormat("[HG INVENTORY CONNECTOR]: scene presence for {0} not found", userID);
588 return UUID.Zero;
589 }
590
591 private bool IsForeignUser(UUID userID, out string inventoryURL)
592 {
593 inventoryURL = string.Empty;
594 UserAccount account = null;
595 if (m_Scene.UserAccountService != null)
596 account = m_Scene.UserAccountService.GetUserAccount(m_Scene.RegionInfo.ScopeID, userID);
597
598 if (account == null) // foreign user
599 {
600 ScenePresence sp = null;
601 m_Scene.TryGetScenePresence(userID, out sp);
602 if (sp != null)
603 {
604 AgentCircuitData aCircuit = m_Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
605 if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
606 {
607 inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
608 inventoryURL = inventoryURL.Trim(new char[] { '/' });
609 return true;
610 }
611 }
612 }
613 return false;
614 }
615
616
617 } 555 }
618} 556}
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
index ac9e792..277060d 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Inventory/RemoteXInventoryServiceConnector.cs
@@ -172,11 +172,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
172 return m_RemoteConnector.GetFolderForType(userID, type); 172 return m_RemoteConnector.GetFolderForType(userID, type);
173 } 173 }
174 174
175 public Dictionary<AssetType, InventoryFolderBase> GetSystemFolders(UUID userID)
176 {
177 return m_RemoteConnector.GetSystemFolders(userID);
178 }
179
180 public InventoryCollection GetFolderContent(UUID userID, UUID folderID) 175 public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
181 { 176 {
182 return m_RemoteConnector.GetFolderContent(userID, folderID); 177 return m_RemoteConnector.GetFolderContent(userID, folderID);
@@ -267,9 +262,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
267 262
268 public InventoryItemBase GetItem(InventoryItemBase item) 263 public InventoryItemBase GetItem(InventoryItemBase item)
269 { 264 {
265 m_log.DebugFormat("[XINVENTORY CONNECTOR]: GetItem {0}", item.ID);
270 if (item == null) 266 if (item == null)
271 return null; 267 return null;
272 268
269 if (m_RemoteConnector == null)
270 m_log.DebugFormat("[XINVENTORY CONNECTOR]: connector stub is null!!!");
273 return m_RemoteConnector.GetItem(item); 271 return m_RemoteConnector.GetItem(item);
274 } 272 }
275 273
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
index 865f99e..5f3666e 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/RemotePresenceServiceConnector.cs
@@ -76,7 +76,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence
76 76
77 m_PresenceDetector = new PresenceDetector(this); 77 m_PresenceDetector = new PresenceDetector(this);
78 78
79 m_log.Info("[INVENTORY CONNECTOR]: Remote presence enabled"); 79 m_log.Info("[REMOTE PRESENCE CONNECTOR]: Remote presence enabled");
80 } 80 }
81 } 81 }
82 82