diff options
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; | |||
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 | { |
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 | //{ |