diff options
author | Melanie Thielker | 2009-05-11 22:54:09 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-05-11 22:54:09 +0000 |
commit | 16efb78698fc505fb33ad87962b39047939d636c (patch) | |
tree | b5a52ac4bb450bec6a8f6e52a5a7e97db1335488 | |
parent | resolve a circular dependency (diff) | |
download | opensim-SC-16efb78698fc505fb33ad87962b39047939d636c.zip opensim-SC-16efb78698fc505fb33ad87962b39047939d636c.tar.gz opensim-SC-16efb78698fc505fb33ad87962b39047939d636c.tar.bz2 opensim-SC-16efb78698fc505fb33ad87962b39047939d636c.tar.xz |
Changes to the new user system to add the modularity developed for the asset
system
Diffstat (limited to '')
7 files changed, 60 insertions, 8 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs index 1aaf552..bd4638a 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Asset/LocalAssetServiceConnector.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Asset | |||
67 | IConfig assetConfig = source.Configs["AssetService"]; | 67 | IConfig assetConfig = source.Configs["AssetService"]; |
68 | if (assetConfig == null) | 68 | if (assetConfig == null) |
69 | { | 69 | { |
70 | m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpanSim.ini"); | 70 | m_log.Error("[ASSET CONNECTOR]: AssetService missing from OpenSim.ini"); |
71 | return; | 71 | return; |
72 | } | 72 | } |
73 | 73 | ||
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs index 1528ef2..637931e 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/User/LocalUserServiceConnector.cs | |||
@@ -25,16 +25,23 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
29 | using System.Reflection; | ||
30 | using log4net; | ||
28 | using Nini.Config; | 31 | using Nini.Config; |
29 | using OpenSim.Region.Framework.Interfaces; | 32 | using OpenSim.Region.Framework.Interfaces; |
30 | using OpenSim.Region.Framework.Scenes; | 33 | using OpenSim.Region.Framework.Scenes; |
34 | using OpenSim.Servers.Base; | ||
31 | using OpenSim.Services.Interfaces; | 35 | using OpenSim.Services.Interfaces; |
32 | using OpenSim.Services.UserService; | ||
33 | 36 | ||
34 | namespace OpenSim.Region.CoreModules.ServiceConnectors.User | 37 | namespace OpenSim.Region.CoreModules.ServiceConnectors.User |
35 | { | 38 | { |
36 | public class LocalUserServicesConnector : ISharedRegionModule | 39 | public class LocalUserServicesConnector : ISharedRegionModule |
37 | { | 40 | { |
41 | private static readonly ILog m_log = | ||
42 | LogManager.GetLogger( | ||
43 | MethodBase.GetCurrentMethod().DeclaringType); | ||
44 | |||
38 | private IUserService m_UserService; | 45 | private IUserService m_UserService; |
39 | 46 | ||
40 | private bool m_Enabled = false; | 47 | private bool m_Enabled = false; |
@@ -52,8 +59,34 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.User | |||
52 | string name = moduleConfig.GetString("UserServices", ""); | 59 | string name = moduleConfig.GetString("UserServices", ""); |
53 | if (name == Name) | 60 | if (name == Name) |
54 | { | 61 | { |
62 | IConfig userConfig = source.Configs["UserService"]; | ||
63 | if (userConfig == null) | ||
64 | { | ||
65 | m_log.Error("[USER CONNECTOR]: UserService missing from OpenSim.ini"); | ||
66 | return; | ||
67 | } | ||
68 | |||
69 | string serviceDll = userConfig.GetString("LocalServiceModule", | ||
70 | String.Empty); | ||
71 | |||
72 | if (serviceDll == String.Empty) | ||
73 | { | ||
74 | m_log.Error("[USER CONNECTOR]: No LocalServiceModule named in section UserService"); | ||
75 | return; | ||
76 | } | ||
77 | |||
78 | Object[] args = new Object[] { source }; | ||
79 | m_UserService = | ||
80 | ServerUtils.LoadPlugin<IUserService>(serviceDll, | ||
81 | args); | ||
82 | |||
83 | if (m_UserService == null) | ||
84 | { | ||
85 | m_log.Error("[USER CONNECTOR]: Can't load user service"); | ||
86 | return; | ||
87 | } | ||
55 | m_Enabled = true; | 88 | m_Enabled = true; |
56 | m_UserService = new UserService(source); | 89 | m_log.Info("[USER CONNECTOR]: Local user connector enabled"); |
57 | } | 90 | } |
58 | } | 91 | } |
59 | } | 92 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs index 58e52ac..e56aac5 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/User/RemoteUserServiceConnector.cs | |||
@@ -29,7 +29,6 @@ using Nini.Config; | |||
29 | using OpenSim.Region.Framework.Interfaces; | 29 | using OpenSim.Region.Framework.Interfaces; |
30 | using OpenSim.Region.Framework.Scenes; | 30 | using OpenSim.Region.Framework.Scenes; |
31 | using OpenSim.Services.Interfaces; | 31 | using OpenSim.Services.Interfaces; |
32 | using OpenSim.Services.UserService; | ||
33 | 32 | ||
34 | namespace OpenSim.Region.CoreModules.ServiceConnectors.User | 33 | namespace OpenSim.Region.CoreModules.ServiceConnectors.User |
35 | { | 34 | { |
diff --git a/OpenSim/Servers/User/UserServerConnector.cs b/OpenSim/Servers/User/UserServerConnector.cs index c20cc31..15b09bc 100644 --- a/OpenSim/Servers/User/UserServerConnector.cs +++ b/OpenSim/Servers/User/UserServerConnector.cs | |||
@@ -25,9 +25,10 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using Nini.Config; | 29 | using Nini.Config; |
30 | using OpenSim.Servers.Base; | ||
29 | using OpenSim.Services.Interfaces; | 31 | using OpenSim.Services.Interfaces; |
30 | using OpenSim.Services.UserService; | ||
31 | using OpenSim.Framework.Servers.HttpServer; | 32 | using OpenSim.Framework.Servers.HttpServer; |
32 | 33 | ||
33 | namespace OpenSim.Servers.UserServer | 34 | namespace OpenSim.Servers.UserServer |
@@ -38,7 +39,19 @@ namespace OpenSim.Servers.UserServer | |||
38 | 39 | ||
39 | public UserServiceConnector(IConfigSource config, IHttpServer server) | 40 | public UserServiceConnector(IConfigSource config, IHttpServer server) |
40 | { | 41 | { |
41 | m_UserService = new UserService(config); | 42 | IConfig serverConfig = config.Configs["UserService"]; |
43 | if (serverConfig == null) | ||
44 | throw new Exception("No section 'Server' in config file"); | ||
45 | |||
46 | string userService = serverConfig.GetString("LocalServiceModule", | ||
47 | String.Empty); | ||
48 | |||
49 | if (userService == String.Empty) | ||
50 | throw new Exception("No UserService in config file"); | ||
51 | |||
52 | Object[] args = new Object[] { config }; | ||
53 | m_UserService = | ||
54 | ServerUtils.LoadPlugin<IUserService>(userService, args); | ||
42 | } | 55 | } |
43 | } | 56 | } |
44 | } | 57 | } |
diff --git a/bin/OpenSim.Servers.UserServer.ini.example b/bin/OpenSim.Servers.UserServer.ini.example index 39d0ace..55ff4e8 100644 --- a/bin/OpenSim.Servers.UserServer.ini.example +++ b/bin/OpenSim.Servers.UserServer.ini.example | |||
@@ -2,5 +2,6 @@ | |||
2 | port = 8002 | 2 | port = 8002 |
3 | 3 | ||
4 | [UserService] | 4 | [UserService] |
5 | LocalServiceModule = "OpenSim.Services.UserService.dll:UserService" | ||
5 | StorageProvider = "OpenSim.Data.MySQL.dll" | 6 | StorageProvider = "OpenSim.Data.MySQL.dll" |
6 | ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim;" | 7 | ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=opensim;" |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index de8139b..de1fcce 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -1277,6 +1277,11 @@ | |||
1277 | 1277 | ||
1278 | ;AssetCaching = "CoreAssetCache" | 1278 | ;AssetCaching = "CoreAssetCache" |
1279 | 1279 | ||
1280 | ; Choose one | ||
1281 | ;UserServices = "LocalUserServicesConnector" | ||
1282 | ;UserServices = "RemoteUserServicesConnector" | ||
1283 | |||
1284 | |||
1280 | [AssetService] | 1285 | [AssetService] |
1281 | ; Parameters for local assets | 1286 | ; Parameters for local assets |
1282 | ;LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" | 1287 | ;LocalServiceModule = "OpenSim.Services.AssetService.dll:AssetService" |
@@ -1297,3 +1302,6 @@ | |||
1297 | [AssetCache] | 1302 | [AssetCache] |
1298 | ; Number of buckets for assets | 1303 | ; Number of buckets for assets |
1299 | ;CacheBuckets = 32768 | 1304 | ;CacheBuckets = 32768 |
1305 | |||
1306 | [UserService] | ||
1307 | ;LocalServiceModule = "OpenSim.Services.UserService.dll:UserService" | ||
diff --git a/prebuild.xml b/prebuild.xml index de4918d..081e166 100644 --- a/prebuild.xml +++ b/prebuild.xml | |||
@@ -1374,7 +1374,6 @@ | |||
1374 | <Reference name="OpenSim.Servers.Base"/> | 1374 | <Reference name="OpenSim.Servers.Base"/> |
1375 | <Reference name="OpenSim.Services.Base" /> | 1375 | <Reference name="OpenSim.Services.Base" /> |
1376 | <Reference name="OpenSim.Services.Interfaces"/> | 1376 | <Reference name="OpenSim.Services.Interfaces"/> |
1377 | <Reference name="OpenSim.Services.UserService"/> | ||
1378 | <Reference name="Nini.dll" /> | 1377 | <Reference name="Nini.dll" /> |
1379 | <Reference name="log4net.dll"/> | 1378 | <Reference name="log4net.dll"/> |
1380 | 1379 | ||
@@ -1442,7 +1441,6 @@ | |||
1442 | <Reference name="OpenSim.Servers.Base" /> | 1441 | <Reference name="OpenSim.Servers.Base" /> |
1443 | <Reference name="OpenSim.Services.Base" /> | 1442 | <Reference name="OpenSim.Services.Base" /> |
1444 | <Reference name="OpenSim.Services.Interfaces" /> | 1443 | <Reference name="OpenSim.Services.Interfaces" /> |
1445 | <Reference name="OpenSim.Services.UserService" /> | ||
1446 | <Reference name="OpenSim.Framework.Serialization"/> | 1444 | <Reference name="OpenSim.Framework.Serialization"/> |
1447 | <Reference name="OpenSim.Framework.Console"/> | 1445 | <Reference name="OpenSim.Framework.Console"/> |
1448 | <Reference name="OpenSim.Framework.Servers"/> | 1446 | <Reference name="OpenSim.Framework.Servers"/> |