diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs index 6b72e9b..ce64d4d 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Inventory/LocalInventoryServiceConnector.cs | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | using log4net; | 28 | using log4net; |
29 | using Nini.Config; | 29 | using Nini.Config; |
30 | |||
30 | using System; | 31 | using System; |
31 | using System.Collections.Generic; | 32 | using System.Collections.Generic; |
32 | using System.Reflection; | 33 | using System.Reflection; |
@@ -38,10 +39,10 @@ using OpenSim.Region.Framework.Scenes; | |||
38 | using OpenSim.Services.Interfaces; | 39 | using OpenSim.Services.Interfaces; |
39 | using OpenMetaverse; | 40 | using OpenMetaverse; |
40 | 41 | ||
42 | |||
41 | namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory | 43 | namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory |
42 | { | 44 | { |
43 | public class LocalInventoryServicesConnector : | 45 | public class LocalInventoryServicesConnector : ISharedRegionModule, IInventoryService |
44 | ISharedRegionModule, IInventoryService | ||
45 | { | 46 | { |
46 | private static readonly ILog m_log = | 47 | private static readonly ILog m_log = |
47 | LogManager.GetLogger( | 48 | LogManager.GetLogger( |
@@ -50,6 +51,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory | |||
50 | private IInventoryService m_InventoryService; | 51 | private IInventoryService m_InventoryService; |
51 | 52 | ||
52 | private bool m_Enabled = false; | 53 | private bool m_Enabled = false; |
54 | private bool m_Initialized = false; | ||
53 | 55 | ||
54 | public string Name | 56 | public string Name |
55 | { | 57 | { |
@@ -64,15 +66,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory | |||
64 | string name = moduleConfig.GetString("InventoryServices", ""); | 66 | string name = moduleConfig.GetString("InventoryServices", ""); |
65 | if (name == Name) | 67 | if (name == Name) |
66 | { | 68 | { |
67 | IConfig assetConfig = source.Configs["InventoryService"]; | 69 | IConfig inventoryConfig = source.Configs["InventoryService"]; |
68 | if (assetConfig == null) | 70 | if (inventoryConfig == null) |
69 | { | 71 | { |
70 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); | 72 | m_log.Error("[INVENTORY CONNECTOR]: InventoryService missing from OpenSim.ini"); |
71 | return; | 73 | return; |
72 | } | 74 | } |
73 | 75 | ||
74 | string serviceDll = assetConfig.GetString("LocalServiceModule", | 76 | string serviceDll = inventoryConfig.GetString("LocalServiceModule", String.Empty); |
75 | String.Empty); | ||
76 | 77 | ||
77 | if (serviceDll == String.Empty) | 78 | if (serviceDll == String.Empty) |
78 | { | 79 | { |
@@ -81,14 +82,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory | |||
81 | } | 82 | } |
82 | 83 | ||
83 | Object[] args = new Object[] { source }; | 84 | Object[] args = new Object[] { source }; |
84 | m_InventoryService = | 85 | m_log.DebugFormat("[INVENTORY CONNECTOR]: Service dll = {0}", serviceDll); |
85 | ServerUtils.LoadPlugin<IInventoryService>(serviceDll, | 86 | |
86 | args); | 87 | m_InventoryService = ServerUtils.LoadPlugin<IInventoryService>(serviceDll, args); |
87 | 88 | ||
88 | if (m_InventoryService == null) | 89 | if (m_InventoryService == null) |
89 | { | 90 | { |
90 | m_log.Error("[INVENTORY CONNECTOR]: Can't load asset service"); | 91 | m_log.Error("[INVENTORY CONNECTOR]: Can't load inventory service"); |
91 | return; | 92 | //return; |
93 | throw new Exception("Unable to proceed. Please make sure your ini files in config-include are updated according to .example's"); | ||
92 | } | 94 | } |
93 | 95 | ||
94 | //List<IInventoryDataPlugin> plugins | 96 | //List<IInventoryDataPlugin> plugins |
@@ -121,7 +123,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Inventory | |||
121 | if (!m_Enabled) | 123 | if (!m_Enabled) |
122 | return; | 124 | return; |
123 | 125 | ||
126 | if (!m_Initialized) | ||
127 | { | ||
128 | // ugh! | ||
129 | scene.CommsManager.UserProfileCacheService.SetInventoryService(this); | ||
130 | scene.CommsManager.UserService.SetInventoryService(this); | ||
131 | m_Initialized = true; | ||
132 | } | ||
133 | |||
124 | scene.RegisterModuleInterface<IInventoryService>(this); | 134 | scene.RegisterModuleInterface<IInventoryService>(this); |
135 | |||
125 | } | 136 | } |
126 | 137 | ||
127 | public void RemoveRegion(Scene scene) | 138 | public void RemoveRegion(Scene scene) |