aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/HypergridService/HGInventoryService.cs
diff options
context:
space:
mode:
authorMelanie2010-12-03 02:36:13 +0000
committerMelanie2010-12-03 02:36:13 +0000
commit342dc532ec64642d5997f23050a9776f663facdf (patch)
treeb0be3997967aa6e4d79873281f535ad436b841e4 /OpenSim/Services/HypergridService/HGInventoryService.cs
parentChange the way sim health reporting reports sim startup (diff)
parentOnly force prim persistence before delete if the prim is the result of an unp... (diff)
downloadopensim-SC-342dc532ec64642d5997f23050a9776f663facdf.zip
opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.tar.gz
opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.tar.bz2
opensim-SC-342dc532ec64642d5997f23050a9776f663facdf.tar.xz
Merge branch 'master' into careminster-presence-refactor
Also prevent god takes from ending up in Lost and Found
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/HypergridService/HGInventoryService.cs (renamed from OpenSim/Services/InventoryService/HGInventoryService.cs)54
1 files changed, 46 insertions, 8 deletions
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs
index d62c008..9ee1ae4 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/HypergridService/HGInventoryService.cs
@@ -33,11 +33,20 @@ using Nini.Config;
33using System.Reflection; 33using System.Reflection;
34using OpenSim.Services.Base; 34using OpenSim.Services.Base;
35using OpenSim.Services.Interfaces; 35using OpenSim.Services.Interfaces;
36using OpenSim.Services.InventoryService;
36using OpenSim.Data; 37using OpenSim.Data;
37using OpenSim.Framework; 38using OpenSim.Framework;
39using OpenSim.Server.Base;
38 40
39namespace OpenSim.Services.InventoryService 41namespace OpenSim.Services.HypergridService
40{ 42{
43 /// <summary>
44 /// Hypergrid inventory service. It serves the IInventoryService interface,
45 /// but implements it in ways that are appropriate for inter-grid
46 /// inventory exchanges. Specifically, it does not performs deletions
47 /// and it responds to GetRootFolder requests with the ID of the
48 /// Suitcase folder, not the actual "My Inventory" folder.
49 /// </summary>
41 public class HGInventoryService : XInventoryService, IInventoryService 50 public class HGInventoryService : XInventoryService, IInventoryService
42 { 51 {
43 private static readonly ILog m_log = 52 private static readonly ILog m_log =
@@ -46,9 +55,16 @@ namespace OpenSim.Services.InventoryService
46 55
47 protected new IXInventoryData m_Database; 56 protected new IXInventoryData m_Database;
48 57
58 private string m_ProfileServiceURL;
59 private IUserAccountService m_UserAccountService;
60
61 private UserAccountCache m_Cache;
62
49 public HGInventoryService(IConfigSource config) 63 public HGInventoryService(IConfigSource config)
50 : base(config) 64 : base(config)
51 { 65 {
66 m_log.Debug("[HGInventory Service]: Starting");
67
52 string dllName = String.Empty; 68 string dllName = String.Empty;
53 string connString = String.Empty; 69 string connString = String.Empty;
54 //string realm = "Inventory"; // OSG version doesn't use this 70 //string realm = "Inventory"; // OSG version doesn't use this
@@ -68,12 +84,25 @@ namespace OpenSim.Services.InventoryService
68 // 84 //
69 // Try reading the [InventoryService] section, if it exists 85 // Try reading the [InventoryService] section, if it exists
70 // 86 //
71 IConfig authConfig = config.Configs["InventoryService"]; 87 IConfig invConfig = config.Configs["HGInventoryService"];
72 if (authConfig != null) 88 if (invConfig != null)
73 { 89 {
74 dllName = authConfig.GetString("StorageProvider", dllName); 90 dllName = invConfig.GetString("StorageProvider", dllName);
75 connString = authConfig.GetString("ConnectionString", connString); 91 connString = invConfig.GetString("ConnectionString", connString);
92
76 // realm = authConfig.GetString("Realm", realm); 93 // realm = authConfig.GetString("Realm", realm);
94 string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty);
95 if (userAccountsDll == string.Empty)
96 throw new Exception("Please specify UserAccountsService in HGInventoryService configuration");
97
98 Object[] args = new Object[] { config };
99 m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args);
100 if (m_UserAccountService == null)
101 throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll));
102
103 m_ProfileServiceURL = invConfig.GetString("ProfileServerURI", string.Empty);
104
105 m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService);
77 } 106 }
78 107
79 // 108 //
@@ -282,9 +311,18 @@ namespace OpenSim.Services.InventoryService
282 //{ 311 //{
283 //} 312 //}
284 313
285 //public InventoryItemBase GetItem(InventoryItemBase item) 314 public override InventoryItemBase GetItem(InventoryItemBase item)
286 //{ 315 {
287 //} 316 InventoryItemBase it = base.GetItem(item);
317
318 UserAccount user = m_Cache.GetUser(it.CreatorId);
319
320 // Adjust the creator data
321 if (user != null && it != null && (it.CreatorData == null || it.CreatorData == string.Empty))
322 it.CreatorData = m_ProfileServiceURL + "/" + it.CreatorId + ";" + user.FirstName + " " + user.LastName;
323
324 return it;
325 }
288 326
289 //public InventoryFolderBase GetFolder(InventoryFolderBase folder) 327 //public InventoryFolderBase GetFolder(InventoryFolderBase folder)
290 //{ 328 //{