123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- 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.BakedTextures
- {
- public class XBakesConnector : ServiceConnector
- {
- private IBakedTextureService m_BakesService;
- private string m_ConfigName = "BakedTextureService";
- public XBakesConnector(IConfigSource config, IHttpServer server, string configName) :
- base(config, server, configName)
- {
- if (configName != String.Empty)
- m_ConfigName = configName;
- IConfig serverConfig = config.Configs[m_ConfigName];
- if (serverConfig == null)
- throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
- string assetService = serverConfig.GetString("LocalServiceModule",
- String.Empty);
- if (assetService == String.Empty)
- throw new Exception("No BakedTextureService in config file");
- Object[] args = new Object[] { config };
- m_BakesService =
- ServerUtils.LoadPlugin<IBakedTextureService>(assetService, args);
- IServiceAuth auth = ServiceAuth.Create(config, m_ConfigName);
-
- server.AddStreamHandler(new BakesServerGetHandler(m_BakesService, auth));
- server.AddStreamHandler(new BakesServerPostHandler(m_BakesService, auth));
- }
- }
- }
|