OpenSim
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
HGInventoryBroker.cs
Go to the documentation of this file.
1 /*
2  * Copyright (c) Contributors, http://opensimulator.org/
3  * See CONTRIBUTORS.TXT for a full list of copyright holders.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the OpenSimulator Project nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 using log4net;
29 using Mono.Addins;
30 using Nini.Config;
31 using System;
32 using System.Collections.Generic;
33 using System.Reflection;
34 using OpenSim.Framework;
35 
36 using OpenSim.Server.Base;
37 using OpenSim.Region.Framework.Interfaces;
38 using OpenSim.Region.Framework.Scenes;
39 using OpenSim.Services.Interfaces;
40 using OpenSim.Services.Connectors;
41 using OpenSim.Services.Connectors.SimianGrid;
42 using OpenMetaverse;
43 
44 namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory
45 {
46  [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "HGInventoryBroker")]
48  {
49  private static readonly ILog m_log =
50  LogManager.GetLogger(
51  MethodBase.GetCurrentMethod().DeclaringType);
52 
53  private static bool m_Enabled = false;
54 
55  private static IInventoryService m_LocalGridInventoryService;
56  private Dictionary<string, IInventoryService> m_connectors = new Dictionary<string, IInventoryService>();
57 
58  // A cache of userIDs --> ServiceURLs, for HGBroker only
59  protected Dictionary<UUID, string> m_InventoryURLs = new Dictionary<UUID,string>();
60 
61  private List<Scene> m_Scenes = new List<Scene>();
62 
63  private InventoryCache m_Cache = new InventoryCache();
64 
68  private object m_Lock = new object();
69 
71  protected IUserManagement UserManagementModule
72  {
73  get
74  {
75  if (m_UserManagement == null)
76  {
77  m_UserManagement = m_Scenes[0].RequestModuleInterface<IUserManagement>();
78 
79  if (m_UserManagement == null)
80  m_log.ErrorFormat(
81  "[HG INVENTORY CONNECTOR]: Could not retrieve IUserManagement module from {0}",
82  m_Scenes[0].RegionInfo.RegionName);
83  }
84 
85  return m_UserManagement;
86  }
87  }
88 
89  public Type ReplaceableInterface
90  {
91  get { return null; }
92  }
93 
94  public string Name
95  {
96  get { return "HGInventoryBroker"; }
97  }
98 
99  public void Initialise(IConfigSource source)
100  {
101  IConfig moduleConfig = source.Configs["Modules"];
102  if (moduleConfig != null)
103  {
104  string name = moduleConfig.GetString("InventoryServices", "");
105  if (name == Name)
106  {
107  IConfig inventoryConfig = source.Configs["InventoryService"];
108  if (inventoryConfig == null)
109  {
110  m_log.Error("[HG INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini");
111  return;
112  }
113 
114  string localDll = inventoryConfig.GetString("LocalGridInventoryService",
115  String.Empty);
116  //string HGDll = inventoryConfig.GetString("HypergridInventoryService",
117  // String.Empty);
118 
119  if (localDll == String.Empty)
120  {
121  m_log.Error("[HG INVENTORY CONNECTOR]: No LocalGridInventoryService named in section InventoryService");
122  //return;
123  throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's");
124  }
125 
126  Object[] args = new Object[] { source };
127  m_LocalGridInventoryService =
128  ServerUtils.LoadPlugin<IInventoryService>(localDll,
129  args);
130 
131  if (m_LocalGridInventoryService == null)
132  {
133  m_log.Error("[HG INVENTORY CONNECTOR]: Can't load local inventory service");
134  return;
135  }
136 
137  m_Enabled = true;
138  m_log.InfoFormat("[HG INVENTORY CONNECTOR]: HG inventory broker enabled with inner connector of type {0}", m_LocalGridInventoryService.GetType());
139  }
140  }
141  }
142 
143  public void PostInitialise()
144  {
145  }
146 
147  public void Close()
148  {
149  }
150 
151  public void AddRegion(Scene scene)
152  {
153  if (!m_Enabled)
154  return;
155 
156  m_Scenes.Add(scene);
157 
158  scene.RegisterModuleInterface<IInventoryService>(this);
159 
160  if (m_Scenes.Count == 1)
161  {
162  // FIXME: The local connector needs the scene to extract the UserManager. However, it's not enabled so
163  // we can't just add the region. But this approach is super-messy.
164  if (m_LocalGridInventoryService is RemoteXInventoryServicesConnector)
165  {
166  m_log.DebugFormat(
167  "[HG INVENTORY BROKER]: Manually setting scene in RemoteXInventoryServicesConnector to {0}",
168  scene.RegionInfo.RegionName);
169 
170  ((RemoteXInventoryServicesConnector)m_LocalGridInventoryService).Scene = scene;
171  }
172  else if (m_LocalGridInventoryService is LocalInventoryServicesConnector)
173  {
174  m_log.DebugFormat(
175  "[HG INVENTORY BROKER]: Manually setting scene in LocalInventoryServicesConnector to {0}",
176  scene.RegionInfo.RegionName);
177 
178  ((LocalInventoryServicesConnector)m_LocalGridInventoryService).Scene = scene;
179  }
180 
181  scene.EventManager.OnClientClosed += OnClientClosed;
182  }
183  }
184 
185  public void RemoveRegion(Scene scene)
186  {
187  if (!m_Enabled)
188  return;
189 
190  m_Scenes.Remove(scene);
191  }
192 
193  public void RegionLoaded(Scene scene)
194  {
195  if (!m_Enabled)
196  return;
197 
198  m_log.InfoFormat("[HG INVENTORY CONNECTOR]: Enabled HG inventory for region {0}", scene.RegionInfo.RegionName);
199 
200  }
201 
202  #region URL Cache
203 
204  void OnClientClosed(UUID clientID, Scene scene)
205  {
206  if (m_InventoryURLs.ContainsKey(clientID)) // if it's in cache
207  {
208  ScenePresence sp = null;
209  foreach (Scene s in m_Scenes)
210  {
211  s.TryGetScenePresence(clientID, out sp);
212  if ((sp != null) && !sp.IsChildAgent && (s != scene))
213  {
214  m_log.DebugFormat("[INVENTORY CACHE]: OnClientClosed in {0}, but user {1} still in sim. Keeping inventoryURL in cache",
215  scene.RegionInfo.RegionName, clientID);
216  return;
217  }
218  }
219  DropInventoryServiceURL(clientID);
220  }
221  }
222 
228  private void CacheInventoryServiceURL(UUID userID)
229  {
230  if (UserManagementModule != null && !UserManagementModule.IsLocalGridUser(userID))
231  {
232  // The user is not local; let's cache its service URL
233  string inventoryURL = string.Empty;
234  ScenePresence sp = null;
235  foreach (Scene scene in m_Scenes)
236  {
237  scene.TryGetScenePresence(userID, out sp);
238  if (sp != null)
239  {
240  AgentCircuitData aCircuit = scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
241  if (aCircuit == null)
242  return;
243  if (aCircuit.ServiceURLs == null)
244  return;
245 
246  if (aCircuit.ServiceURLs.ContainsKey("InventoryServerURI"))
247  {
248  inventoryURL = aCircuit.ServiceURLs["InventoryServerURI"].ToString();
249  if (inventoryURL != null && inventoryURL != string.Empty)
250  {
251  inventoryURL = inventoryURL.Trim(new char[] { '/' });
252  m_InventoryURLs[userID] = inventoryURL;
253  m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL);
254  return;
255  }
256  }
257 // else
258 // {
259 // m_log.DebugFormat("[HG INVENTORY CONNECTOR]: User {0} does not have InventoryServerURI. OH NOES!", userID);
260 // return;
261 // }
262  }
263  }
264  if (sp == null)
265  {
266  inventoryURL = UserManagementModule.GetUserServerURL(userID, "InventoryServerURI");
267  if (!string.IsNullOrEmpty(inventoryURL))
268  {
269  inventoryURL = inventoryURL.Trim(new char[] { '/' });
270  m_InventoryURLs.Add(userID, inventoryURL);
271  m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Added {0} to the cache of inventory URLs", inventoryURL);
272  }
273 
274  }
275 
276  }
277  }
278 
279  private void DropInventoryServiceURL(UUID userID)
280  {
281  lock (m_InventoryURLs)
282  if (m_InventoryURLs.ContainsKey(userID))
283  {
284  string url = m_InventoryURLs[userID];
285  m_InventoryURLs.Remove(userID);
286  m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Removed {0} from the cache of inventory URLs", url);
287  }
288  }
289 
290  public string GetInventoryServiceURL(UUID userID)
291  {
292  if (m_InventoryURLs.ContainsKey(userID))
293  return m_InventoryURLs[userID];
294 
295  CacheInventoryServiceURL(userID);
296 
297  if (m_InventoryURLs.ContainsKey(userID))
298  return m_InventoryURLs[userID];
299 
300  return null; //it means that the methods should forward to local grid's inventory
301 
302  }
303  #endregion
304 
305  #region IInventoryService
306 
307  public bool CreateUserInventory(UUID userID)
308  {
309  lock (m_Lock)
310  return m_LocalGridInventoryService.CreateUserInventory(userID);
311  }
312 
313  public List<InventoryFolderBase> GetInventorySkeleton(UUID userID)
314  {
315  string invURL = GetInventoryServiceURL(userID);
316 
317  if (invURL == null) // not there, forward to local inventory connector to resolve
318  lock (m_Lock)
319  return m_LocalGridInventoryService.GetInventorySkeleton(userID);
320 
321  IInventoryService connector = GetConnector(invURL);
322 
323  return connector.GetInventorySkeleton(userID);
324  }
325 
326  public InventoryFolderBase GetRootFolder(UUID userID)
327  {
328  //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetRootFolder for {0}", userID);
329  InventoryFolderBase root = m_Cache.GetRootFolder(userID);
330  if (root != null)
331  return root;
332 
333  string invURL = GetInventoryServiceURL(userID);
334 
335  if (invURL == null) // not there, forward to local inventory connector to resolve
336  lock (m_Lock)
337  return m_LocalGridInventoryService.GetRootFolder(userID);
338 
339  IInventoryService connector = GetConnector(invURL);
340 
341  root = connector.GetRootFolder(userID);
342 
343  m_Cache.Cache(userID, root);
344 
345  return root;
346  }
347 
348  public InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
349  {
350  //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: GetFolderForType {0} type {1}", userID, type);
351  InventoryFolderBase f = m_Cache.GetFolderForType(userID, type);
352  if (f != null)
353  return f;
354 
355  string invURL = GetInventoryServiceURL(userID);
356 
357  if (invURL == null) // not there, forward to local inventory connector to resolve
358  lock (m_Lock)
359  return m_LocalGridInventoryService.GetFolderForType(userID, type);
360 
361  IInventoryService connector = GetConnector(invURL);
362 
363  f = connector.GetFolderForType(userID, type);
364 
365  m_Cache.Cache(userID, type, f);
366 
367  return f;
368  }
369 
370  public InventoryCollection GetFolderContent(UUID userID, UUID folderID)
371  {
372  //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent " + folderID);
373 
374  string invURL = GetInventoryServiceURL(userID);
375 
376  if (invURL == null) // not there, forward to local inventory connector to resolve
377  lock (m_Lock)
378  return m_LocalGridInventoryService.GetFolderContent(userID, folderID);
379 
380  InventoryCollection c = m_Cache.GetFolderContent(userID, folderID);
381  if (c != null)
382  {
383  m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderContent found content in cache " + folderID);
384  return c;
385  }
386 
387  IInventoryService connector = GetConnector(invURL);
388 
389  return connector.GetFolderContent(userID, folderID);
390  }
391 
392  public InventoryCollection[] GetMultipleFoldersContent(UUID userID, UUID[] folderIDs)
393  {
394  string invURL = GetInventoryServiceURL(userID);
395 
396  if (invURL == null) // not there, forward to local inventory connector to resolve
397  lock (m_Lock)
398  return m_LocalGridInventoryService.GetMultipleFoldersContent(userID, folderIDs);
399 
400  else
401  {
402  InventoryCollection[] coll = new InventoryCollection[folderIDs.Length];
403  int i = 0;
404  foreach (UUID fid in folderIDs)
405  coll[i++] = GetFolderContent(userID, fid);
406 
407  return coll;
408  }
409  }
410 
411  public List<InventoryItemBase> GetFolderItems(UUID userID, UUID folderID)
412  {
413  //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems " + folderID);
414 
415  string invURL = GetInventoryServiceURL(userID);
416 
417  if (invURL == null) // not there, forward to local inventory connector to resolve
418  lock (m_Lock)
419  return m_LocalGridInventoryService.GetFolderItems(userID, folderID);
420 
421  List<InventoryItemBase> items = m_Cache.GetFolderItems(userID, folderID);
422  if (items != null)
423  {
424  m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolderItems found items in cache " + folderID);
425  return items;
426  }
427 
428  IInventoryService connector = GetConnector(invURL);
429 
430  return connector.GetFolderItems(userID, folderID);
431  }
432 
433  public bool AddFolder(InventoryFolderBase folder)
434  {
435  if (folder == null)
436  return false;
437 
438  //m_log.Debug("[HG INVENTORY CONNECTOR]: AddFolder " + folder.ID);
439 
440  string invURL = GetInventoryServiceURL(folder.Owner);
441 
442  if (invURL == null) // not there, forward to local inventory connector to resolve
443  lock (m_Lock)
444  return m_LocalGridInventoryService.AddFolder(folder);
445 
446  IInventoryService connector = GetConnector(invURL);
447 
448  return connector.AddFolder(folder);
449  }
450 
451  public bool UpdateFolder(InventoryFolderBase folder)
452  {
453  if (folder == null)
454  return false;
455 
456  //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateFolder " + folder.ID);
457 
458  string invURL = GetInventoryServiceURL(folder.Owner);
459 
460  if (invURL == null) // not there, forward to local inventory connector to resolve
461  lock (m_Lock)
462  return m_LocalGridInventoryService.UpdateFolder(folder);
463 
464  IInventoryService connector = GetConnector(invURL);
465 
466  return connector.UpdateFolder(folder);
467  }
468 
469  public bool DeleteFolders(UUID ownerID, List<UUID> folderIDs)
470  {
471  if (folderIDs == null)
472  return false;
473  if (folderIDs.Count == 0)
474  return false;
475 
476  //m_log.Debug("[HG INVENTORY CONNECTOR]: DeleteFolders for " + ownerID);
477 
478  string invURL = GetInventoryServiceURL(ownerID);
479 
480  if (invURL == null) // not there, forward to local inventory connector to resolve
481  lock (m_Lock)
482  return m_LocalGridInventoryService.DeleteFolders(ownerID, folderIDs);
483 
484  IInventoryService connector = GetConnector(invURL);
485 
486  return connector.DeleteFolders(ownerID, folderIDs);
487  }
488 
489  public bool MoveFolder(InventoryFolderBase folder)
490  {
491  if (folder == null)
492  return false;
493 
494  //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveFolder for " + folder.Owner);
495 
496  string invURL = GetInventoryServiceURL(folder.Owner);
497 
498  if (invURL == null) // not there, forward to local inventory connector to resolve
499  lock (m_Lock)
500  return m_LocalGridInventoryService.MoveFolder(folder);
501 
502  IInventoryService connector = GetConnector(invURL);
503 
504  return connector.MoveFolder(folder);
505  }
506 
507  public bool PurgeFolder(InventoryFolderBase folder)
508  {
509  if (folder == null)
510  return false;
511 
512  //m_log.Debug("[HG INVENTORY CONNECTOR]: PurgeFolder for " + folder.Owner);
513 
514  string invURL = GetInventoryServiceURL(folder.Owner);
515 
516  if (invURL == null) // not there, forward to local inventory connector to resolve
517  lock (m_Lock)
518  return m_LocalGridInventoryService.PurgeFolder(folder);
519 
520  IInventoryService connector = GetConnector(invURL);
521 
522  return connector.PurgeFolder(folder);
523  }
524 
525  public bool AddItem(InventoryItemBase item)
526  {
527  if (item == null)
528  return false;
529 
530  //m_log.Debug("[HG INVENTORY CONNECTOR]: AddItem " + item.ID);
531 
532  string invURL = GetInventoryServiceURL(item.Owner);
533 
534  if (invURL == null) // not there, forward to local inventory connector to resolve
535  lock (m_Lock)
536  return m_LocalGridInventoryService.AddItem(item);
537 
538  IInventoryService connector = GetConnector(invURL);
539 
540  return connector.AddItem(item);
541  }
542 
543  public bool UpdateItem(InventoryItemBase item)
544  {
545  if (item == null)
546  return false;
547 
548  //m_log.Debug("[HG INVENTORY CONNECTOR]: UpdateItem " + item.ID);
549 
550  string invURL = GetInventoryServiceURL(item.Owner);
551 
552  if (invURL == null) // not there, forward to local inventory connector to resolve
553  lock (m_Lock)
554  return m_LocalGridInventoryService.UpdateItem(item);
555 
556  IInventoryService connector = GetConnector(invURL);
557 
558  return connector.UpdateItem(item);
559  }
560 
561  public bool MoveItems(UUID ownerID, List<InventoryItemBase> items)
562  {
563  if (items == null)
564  return false;
565  if (items.Count == 0)
566  return true;
567 
568  //m_log.Debug("[HG INVENTORY CONNECTOR]: MoveItems for " + ownerID);
569 
570  string invURL = GetInventoryServiceURL(ownerID);
571 
572  if (invURL == null) // not there, forward to local inventory connector to resolve
573  lock (m_Lock)
574  return m_LocalGridInventoryService.MoveItems(ownerID, items);
575 
576  IInventoryService connector = GetConnector(invURL);
577 
578  return connector.MoveItems(ownerID, items);
579  }
580 
581  public bool DeleteItems(UUID ownerID, List<UUID> itemIDs)
582  {
583  //m_log.DebugFormat("[HG INVENTORY CONNECTOR]: Delete {0} items for user {1}", itemIDs.Count, ownerID);
584 
585  if (itemIDs == null)
586  return false;
587  if (itemIDs.Count == 0)
588  return true;
589 
590  string invURL = GetInventoryServiceURL(ownerID);
591 
592  if (invURL == null) // not there, forward to local inventory connector to resolve
593  lock (m_Lock)
594  return m_LocalGridInventoryService.DeleteItems(ownerID, itemIDs);
595 
596  IInventoryService connector = GetConnector(invURL);
597 
598  return connector.DeleteItems(ownerID, itemIDs);
599  }
600 
602  {
603  if (item == null)
604  return null;
605  //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
606 
607  string invURL = GetInventoryServiceURL(item.Owner);
608 
609  if (invURL == null) // not there, forward to local inventory connector to resolve
610  lock (m_Lock)
611  return m_LocalGridInventoryService.GetItem(item);
612 
613  IInventoryService connector = GetConnector(invURL);
614 
615  return connector.GetItem(item);
616  }
617 
618  public InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs)
619  {
620  if (itemIDs == null)
621  return new InventoryItemBase[0];
622  //m_log.Debug("[HG INVENTORY CONNECTOR]: GetItem " + item.ID);
623 
624  string invURL = GetInventoryServiceURL(userID);
625 
626  if (invURL == null) // not there, forward to local inventory connector to resolve
627  lock (m_Lock)
628  return m_LocalGridInventoryService.GetMultipleItems(userID, itemIDs);
629 
630  IInventoryService connector = GetConnector(invURL);
631 
632  return connector.GetMultipleItems(userID, itemIDs);
633  }
634 
636  {
637  if (folder == null)
638  return null;
639 
640  //m_log.Debug("[HG INVENTORY CONNECTOR]: GetFolder " + folder.ID);
641 
642  string invURL = GetInventoryServiceURL(folder.Owner);
643 
644  if (invURL == null) // not there, forward to local inventory connector to resolve
645  lock (m_Lock)
646  return m_LocalGridInventoryService.GetFolder(folder);
647 
648  IInventoryService connector = GetConnector(invURL);
649 
650  return connector.GetFolder(folder);
651  }
652 
653  public bool HasInventoryForUser(UUID userID)
654  {
655  return false;
656  }
657 
658  public List<InventoryItemBase> GetActiveGestures(UUID userId)
659  {
660  return new List<InventoryItemBase>();
661  }
662 
663  public int GetAssetPermissions(UUID userID, UUID assetID)
664  {
665  //m_log.Debug("[HG INVENTORY CONNECTOR]: GetAssetPermissions " + assetID);
666 
667  string invURL = GetInventoryServiceURL(userID);
668 
669  if (invURL == null) // not there, forward to local inventory connector to resolve
670  lock (m_Lock)
671  return m_LocalGridInventoryService.GetAssetPermissions(userID, assetID);
672 
673  IInventoryService connector = GetConnector(invURL);
674 
675  return connector.GetAssetPermissions(userID, assetID);
676  }
677 
678  #endregion
679 
680  private IInventoryService GetConnector(string url)
681  {
682  IInventoryService connector = null;
683  lock (m_connectors)
684  {
685  if (m_connectors.ContainsKey(url))
686  {
687  connector = m_connectors[url];
688  }
689  else
690  {
691  // Still not as flexible as I would like this to be,
692  // but good enough for now
693  string connectorType = new HeloServicesConnector(url).Helo();
694  m_log.DebugFormat("[HG INVENTORY SERVICE]: HELO returned {0}", connectorType);
695  if (connectorType == "opensim-simian")
696  {
697  connector = new SimianInventoryServiceConnector(url);
698  }
699  else
700  {
701  RemoteXInventoryServicesConnector rxisc = new RemoteXInventoryServicesConnector(url);
702  rxisc.Scene = m_Scenes[0];
703  connector = rxisc;
704  }
705 
706  m_connectors.Add(url, connector);
707  }
708  }
709 
710  return connector;
711  }
712  }
713 }
void RemoveRegion(Scene scene)
This is called whenever a Scene is removed. For shared modules, this can happen several times...
bool UpdateFolder(InventoryFolderBase folder)
Update a folder in the user's inventory
void Close()
This is the inverse to Initialise. After a Close(), this instance won't be usable anymore...
bool AddFolder(InventoryFolderBase folder)
Add a new folder to the user's inventory
bool CreateUserInventory(UUID userID)
Create the entire inventory for a given user
InventoryFolderBase GetRootFolder(UUID userID)
Retrieve the root inventory folder for the given user.
void RegionLoaded(Scene scene)
This will be called once for every scene loaded. In a shared module this will be multiple times in on...
List< InventoryItemBase > GetFolderItems(UUID userID, UUID folderID)
Gets the items inside a folder
List< InventoryFolderBase > GetInventorySkeleton(UUID userID)
Gets the skeleton of the inventory – folders only
InventoryItemBase GetItem(InventoryItemBase item)
Get an item, given by its UUID
void AddRegion(Scene scene)
This is called whenever a Scene is added. For shared modules, this can happen several times...
bool MoveFolder(InventoryFolderBase folder)
Move an inventory folder to a new location
InventoryCollection[] GetMultipleFoldersContent(UUID userID, UUID[] folderIDs)
Gets everything (folders and items) inside a folder
Cache root and system inventory folders to reduce number of potentially remote inventory calls and as...
bool MoveItems(UUID ownerID, List< InventoryItemBase > items)
Dictionary< string, object > ServiceURLs
int GetAssetPermissions(UUID userID, UUID assetID)
Get the union of permissions of all inventory items that hold the given assetID.
bool AddItem(InventoryItemBase item)
Add a new item to the user's inventory
bool DeleteFolders(UUID ownerID, List< UUID > folderIDs)
Delete an item from the user's inventory
InventoryItemBase[] GetMultipleItems(UUID userID, UUID[] itemIDs)
Get multiple items, given by their UUIDs
virtual UUID Owner
The agent who's inventory this is contained by
bool DeleteItems(UUID ownerID, List< UUID > itemIDs)
Delete an item from the user's inventory
bool PurgeFolder(InventoryFolderBase folder)
Purge an inventory folder of all its items and subfolders.
void Initialise(IConfigSource source)
This is called to initialize the region module. For shared modules, this is called exactly once...
bool HasInventoryForUser(UUID userID)
Does the given user have an inventory structure?
Circuit data for an agent. Connection information shared between regions that accept UDP connections ...
Inventory Item - contains all the properties associated with an individual inventory piece...
InventoryFolderBase GetFolder(InventoryFolderBase folder)
Get a folder, given by its UUID
List< InventoryItemBase > GetActiveGestures(UUID userId)
Get the active gestures of the agent.
Interactive OpenSim region server
Definition: OpenSim.cs:55
InventoryCollection GetFolderContent(UUID userID, UUID folderID)
Gets everything (folders and items) inside a folder
bool UpdateItem(InventoryItemBase item)
Update an item in the user's inventory
This maintains the relationship between a UUID and a user name.
void PostInitialise()
This is called exactly once after all the shared region-modules have been instanciated and IRegionMod...
InventoryFolderBase GetFolderForType(UUID userID, FolderType type)
Gets the user folder for the given folder-type
Used to serialize a whole inventory for transfer over the network.