diff options
author | Diva Canto | 2010-11-25 11:14:16 -0800 |
---|---|---|
committer | Diva Canto | 2010-11-25 11:14:16 -0800 |
commit | ae4b02e1152b775dc1cdccd1abfbff44ab1a8949 (patch) | |
tree | d0b89d3bf8f3256a3043c2d21bd7a22cb23891c0 /OpenSim/Services/HypergridService/HGInventoryService.cs | |
parent | Attempt at fixing failing test. (diff) | |
download | opensim-SC-ae4b02e1152b775dc1cdccd1abfbff44ab1a8949.zip opensim-SC-ae4b02e1152b775dc1cdccd1abfbff44ab1a8949.tar.gz opensim-SC-ae4b02e1152b775dc1cdccd1abfbff44ab1a8949.tar.bz2 opensim-SC-ae4b02e1152b775dc1cdccd1abfbff44ab1a8949.tar.xz |
WARNING: LOTS OF CONFIGURATION CHANGES AFFECTING PRIMARILY HG CONFIGS. Added capability to preserve creator information on HG asset transfers. Added a new HGAssetService that is intended to be the one outside the firewall. It processes and filters the assets that go out of the grid. Also fixed the normal AssetService to do special things for the main instance (console commands, etc). Moved HGInventoryService to OpenSim.Services.HypergridService. Changed the way the login service gets the ServiceURL configs.
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 | //{ |