diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Services/HypergridService/HGInventoryService.cs (renamed from OpenSim/Services/InventoryService/HGInventoryService.cs) | 47 |
1 files changed, 39 insertions, 8 deletions
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/HypergridService/HGInventoryService.cs index d62c008..a04f0c4 100644 --- a/OpenSim/Services/InventoryService/HGInventoryService.cs +++ b/OpenSim/Services/HypergridService/HGInventoryService.cs | |||
@@ -33,10 +33,12 @@ using Nini.Config; | |||
33 | using System.Reflection; | 33 | using System.Reflection; |
34 | using OpenSim.Services.Base; | 34 | using OpenSim.Services.Base; |
35 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
36 | using OpenSim.Services.InventoryService; | ||
36 | using OpenSim.Data; | 37 | using OpenSim.Data; |
37 | using OpenSim.Framework; | 38 | using OpenSim.Framework; |
39 | using OpenSim.Server.Base; | ||
38 | 40 | ||
39 | namespace OpenSim.Services.InventoryService | 41 | namespace OpenSim.Services.HypergridService |
40 | { | 42 | { |
41 | public class HGInventoryService : XInventoryService, IInventoryService | 43 | public class HGInventoryService : XInventoryService, IInventoryService |
42 | { | 44 | { |
@@ -46,9 +48,16 @@ namespace OpenSim.Services.InventoryService | |||
46 | 48 | ||
47 | protected new IXInventoryData m_Database; | 49 | protected new IXInventoryData m_Database; |
48 | 50 | ||
51 | private string m_ProfileServiceURL; | ||
52 | private IUserAccountService m_UserAccountService; | ||
53 | |||
54 | private UserAccountCache m_Cache; | ||
55 | |||
49 | public HGInventoryService(IConfigSource config) | 56 | public HGInventoryService(IConfigSource config) |
50 | : base(config) | 57 | : base(config) |
51 | { | 58 | { |
59 | m_log.Debug("[HGInventory Service]: Starting"); | ||
60 | |||
52 | string dllName = String.Empty; | 61 | string dllName = String.Empty; |
53 | string connString = String.Empty; | 62 | string connString = String.Empty; |
54 | //string realm = "Inventory"; // OSG version doesn't use this | 63 | //string realm = "Inventory"; // OSG version doesn't use this |
@@ -68,12 +77,25 @@ namespace OpenSim.Services.InventoryService | |||
68 | // | 77 | // |
69 | // Try reading the [InventoryService] section, if it exists | 78 | // Try reading the [InventoryService] section, if it exists |
70 | // | 79 | // |
71 | IConfig authConfig = config.Configs["InventoryService"]; | 80 | IConfig invConfig = config.Configs["HGInventoryService"]; |
72 | if (authConfig != null) | 81 | if (invConfig != null) |
73 | { | 82 | { |
74 | dllName = authConfig.GetString("StorageProvider", dllName); | 83 | dllName = invConfig.GetString("StorageProvider", dllName); |
75 | connString = authConfig.GetString("ConnectionString", connString); | 84 | connString = invConfig.GetString("ConnectionString", connString); |
85 | |||
76 | // realm = authConfig.GetString("Realm", realm); | 86 | // realm = authConfig.GetString("Realm", realm); |
87 | string userAccountsDll = invConfig.GetString("UserAccountsService", string.Empty); | ||
88 | if (userAccountsDll == string.Empty) | ||
89 | throw new Exception("Please specify UserAccountsService in HGInventoryService configuration"); | ||
90 | |||
91 | Object[] args = new Object[] { config }; | ||
92 | m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(userAccountsDll, args); | ||
93 | if (m_UserAccountService == null) | ||
94 | throw new Exception(String.Format("Unable to create UserAccountService from {0}", userAccountsDll)); | ||
95 | |||
96 | m_ProfileServiceURL = invConfig.GetString("ProfileServerURI", string.Empty); | ||
97 | |||
98 | m_Cache = UserAccountCache.CreateUserAccountCache(m_UserAccountService); | ||
77 | } | 99 | } |
78 | 100 | ||
79 | // | 101 | // |
@@ -282,9 +304,18 @@ namespace OpenSim.Services.InventoryService | |||
282 | //{ | 304 | //{ |
283 | //} | 305 | //} |
284 | 306 | ||
285 | //public InventoryItemBase GetItem(InventoryItemBase item) | 307 | public override InventoryItemBase GetItem(InventoryItemBase item) |
286 | //{ | 308 | { |
287 | //} | 309 | InventoryItemBase it = base.GetItem(item); |
310 | |||
311 | UserAccount user = m_Cache.GetUser(it.CreatorId); | ||
312 | |||
313 | // Adjust the creator data | ||
314 | if (user != null && it != null && (it.CreatorData == null || it.CreatorData == string.Empty)) | ||
315 | it.CreatorData = m_ProfileServiceURL + "/" + it.CreatorId + ";" + user.FirstName + " " + user.LastName; | ||
316 | |||
317 | return it; | ||
318 | } | ||
288 | 319 | ||
289 | //public InventoryFolderBase GetFolder(InventoryFolderBase folder) | 320 | //public InventoryFolderBase GetFolder(InventoryFolderBase folder) |
290 | //{ | 321 | //{ |