123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- using System;
- using Nini.Config;
- using OpenSim.Server.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Framework.ServiceAuth;
- using OpenSim.Framework.Servers.HttpServer;
- using OpenSim.Server.Handlers.Base;
- namespace OpenSim.Server.Handlers.Friends
- {
- public class FriendsServiceConnector : ServiceConnector
- {
- private IFriendsService m_FriendsService;
- private string m_ConfigName = "FriendsService";
- public FriendsServiceConnector(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 theService = serverConfig.GetString("LocalServiceModule",
- String.Empty);
- if (theService == String.Empty)
- throw new Exception("No LocalServiceModule in config file");
- Object[] args = new Object[] { config };
- m_FriendsService = ServerUtils.LoadPlugin<IFriendsService>(theService, args);
- IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
- server.AddStreamHandler(new FriendsServerPostHandler(m_FriendsService, auth));
- }
- }
- }
|