123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- using System;
- using System.Collections;
- using Nini.Config;
- using OpenSim.Server.Base;
- using OpenSim.Services.Interfaces;
- using OpenSim.Framework.Servers.HttpServer;
- using OpenSim.Server.Handlers.Base;
- using OpenSim.Framework.Servers;
- using OpenMetaverse;
- namespace OpenSim.Capabilities.Handlers
- {
- public class GetMeshServerConnector : ServiceConnector
- {
- private IAssetService m_AssetService;
- private string m_ConfigName = "CapsService";
- public GetMeshServerConnector(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("AssetService", String.Empty);
- if (assetService == String.Empty)
- throw new Exception("No AssetService in config file");
- Object[] args = new Object[] { config };
- m_AssetService =
- ServerUtils.LoadPlugin<IAssetService>(assetService, args);
- if (m_AssetService == null)
- throw new Exception(String.Format("Failed to load AssetService from {0}; config is {1}", assetService, m_ConfigName));
- server.AddStreamHandler(
- new GetMeshHandler("/CAPS/GetMesh/" , m_AssetService, "GetMesh", null));
- }
- }
- }
|