12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System;
- using Nini.Config;
- using OpenSim.Server.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Framework.Servers.HttpServer;
- using OpenSim.Framework.ServiceAuth;
- using OpenSim.Server.Handlers.Base;
- namespace OpenSim.Server.Handlers.UserAccounts
- {
- public class UserAccountServiceConnector : ServiceConnector
- {
- private IUserAccountService m_UserAccountService;
- private string m_ConfigName = "UserAccountService";
- public UserAccountServiceConnector(IConfigSource config, IHttpServer server, string configName) :
- base(config, server, configName)
- {
- IConfig serverConfig = config.Configs[m_ConfigName];
- if (serverConfig == null)
- throw new Exception(String.Format("No section {0} in config file", m_ConfigName));
- string service = serverConfig.GetString("LocalServiceModule",
- String.Empty);
- if (service == String.Empty)
- throw new Exception("No LocalServiceModule in config file");
- Object[] args = new Object[] { config };
- m_UserAccountService = ServerUtils.LoadPlugin<IUserAccountService>(service, args);
- IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
- server.AddStreamHandler(new UserAccountServerPostHandler(m_UserAccountService, serverConfig, auth));
- }
- }
- }
|