aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Examples/SimpleApp/Program.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Examples/SimpleApp/Program.cs')
-rw-r--r--OpenSim/Region/Examples/SimpleApp/Program.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 2c5fb4d..6bf6657 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -64,7 +64,9 @@ namespace SimpleApp
64 udpServer.LocalWorld = world; 64 udpServer.LocalWorld = world;
65 65
66 httpServer.AddXmlRPCHandler("login_to_simulator", communicationsManager.UserServices.XmlRpcLoginMethod ); 66 httpServer.AddXmlRPCHandler("login_to_simulator", communicationsManager.UserServices.XmlRpcLoginMethod );
67 httpServer.AddLlsdMethod<LLSDMapLayerResponse, LLSDMapRequest>("/Caps/test/", LlsdMethodDemo); 67
68 RegisterLlsdHandler<LLSDMapLayerResponse, LLSDMapRequest>("/Caps/test/", LlsdMethodDemo);
69
68 httpServer.Start(); 70 httpServer.Start();
69 71
70 m_log.WriteLine( LogPriority.NORMAL, "Press enter to quit."); 72 m_log.WriteLine( LogPriority.NORMAL, "Press enter to quit.");
@@ -81,7 +83,23 @@ namespace SimpleApp
81 { 83 {
82 return new LLSDMapLayerResponse(); 84 return new LLSDMapLayerResponse();
83 } 85 }
86
87 ILlsdMethodHandler m_handler;
84 88
89 private void RegisterLlsdHandler<TResponse, TRequest>( string path, LlsdMethod<TResponse, TRequest> method )
90 where TRequest : new()
91 {
92 // path should be handler key, but for now just conceptually store it.
93 m_handler = new LlsdMethodEntry<TResponse, TRequest>( method );
94 }
95
96 private string ProcessLlsdMethod( string request,string path )
97 {
98 LlsdMethodEntry<LLSDMapLayerResponse, LLSDMapRequest> concreteHandler = new LlsdMethodEntry<LLSDMapLayerResponse, LLSDMapRequest>( LlsdMethodDemo );
99
100 return m_handler.Handle(request, path);
101 }
102
85 private bool AddNewSessionHandler(ulong regionHandle, Login loginData) 103 private bool AddNewSessionHandler(ulong regionHandle, Login loginData)
86 { 104 {
87 m_log.WriteLine(LogPriority.NORMAL, "Region [{0}] recieved Login from [{1}] [{2}]", regionHandle, loginData.First, loginData.Last); 105 m_log.WriteLine(LogPriority.NORMAL, "Region [{0}] recieved Login from [{1}] [{2}]", regionHandle, loginData.First, loginData.Last);