diff options
Beginning of refactoring RESTComms/LocalComms in the new style of services and connectors. This commit has the beginning of the In connector, not the Out. Nothing of this is finished yet, and it doesn't run. But it should compile ok.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs b/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs new file mode 100644 index 0000000..80b22b0 --- /dev/null +++ b/OpenSim/Server/Handlers/Simulation/SimulationServiceInConnector.cs | |||
@@ -0,0 +1,53 @@ | |||
1 | using System; | ||
2 | using Nini.Config; | ||
3 | using OpenSim.Server.Base; | ||
4 | using OpenSim.Services.Interfaces; | ||
5 | using OpenSim.Framework; | ||
6 | using OpenSim.Framework.Servers.HttpServer; | ||
7 | using OpenSim.Server.Handlers.Base; | ||
8 | |||
9 | namespace OpenSim.Server.Handlers.Simulation | ||
10 | { | ||
11 | public class SimulationServiceInConnector : ServiceConnector | ||
12 | { | ||
13 | private ISimulationService m_SimulationService; | ||
14 | private IAuthenticationService m_AuthenticationService; | ||
15 | |||
16 | public SimulationServiceInConnector(IConfigSource config, IHttpServer server, IScene scene) : | ||
17 | base(config, server) | ||
18 | { | ||
19 | IConfig serverConfig = config.Configs["SimulationService"]; | ||
20 | if (serverConfig == null) | ||
21 | throw new Exception("No section 'SimulationService' in config file"); | ||
22 | |||
23 | bool authentication = serverConfig.GetBoolean("RequireAuthentication", false); | ||
24 | |||
25 | if (authentication) | ||
26 | m_AuthenticationService = scene.RequestModuleInterface<IAuthenticationService>(); | ||
27 | |||
28 | bool foreignGuests = serverConfig.GetBoolean("AllowForeignGuests", false); | ||
29 | |||
30 | //string simService = serverConfig.GetString("LocalServiceModule", | ||
31 | // String.Empty); | ||
32 | |||
33 | //if (simService == String.Empty) | ||
34 | // throw new Exception("No SimulationService in config file"); | ||
35 | |||
36 | //Object[] args = new Object[] { config }; | ||
37 | m_SimulationService = scene.RequestModuleInterface<ISimulationService>(); | ||
38 | //ServerUtils.LoadPlugin<ISimulationService>(simService, args); | ||
39 | if (m_SimulationService == null) | ||
40 | throw new Exception("No Local ISimulationService Module"); | ||
41 | |||
42 | |||
43 | |||
44 | //System.Console.WriteLine("XXXXXXXXXXXXXXXXXXX m_AssetSetvice == null? " + ((m_AssetService == null) ? "yes" : "no")); | ||
45 | server.AddStreamHandler(new AgentGetHandler(m_SimulationService, m_AuthenticationService)); | ||
46 | server.AddStreamHandler(new AgentPostHandler(m_SimulationService, m_AuthenticationService, foreignGuests)); | ||
47 | server.AddStreamHandler(new AgentPutHandler(m_SimulationService, m_AuthenticationService)); | ||
48 | server.AddStreamHandler(new AgentDeleteHandler(m_SimulationService, m_AuthenticationService)); | ||
49 | //server.AddStreamHandler(new ObjectPostHandler(m_SimulationService, authentication)); | ||
50 | //server.AddStreamHandler(new NeighborPostHandler(m_SimulationService, authentication)); | ||
51 | } | ||
52 | } | ||
53 | } | ||