* Completed conceptual LlsdMethod - everything resides in SimpleApp pending guru approval.

This commit is contained in:
lbsa71
2007-07-03 07:06:08 +00:00
parent 315a49e7fd
commit 73a5ec391a
9 changed files with 87 additions and 24 deletions

View File

@@ -64,7 +64,9 @@ namespace SimpleApp
udpServer.LocalWorld = world;
httpServer.AddXmlRPCHandler("login_to_simulator", communicationsManager.UserServices.XmlRpcLoginMethod );
httpServer.AddLlsdMethod<LLSDMapLayerResponse, LLSDMapRequest>("/Caps/test/", LlsdMethodDemo);
RegisterLlsdHandler<LLSDMapLayerResponse, LLSDMapRequest>("/Caps/test/", LlsdMethodDemo);
httpServer.Start();
m_log.WriteLine( LogPriority.NORMAL, "Press enter to quit.");
@@ -81,7 +83,23 @@ namespace SimpleApp
{
return new LLSDMapLayerResponse();
}
ILlsdMethodHandler m_handler;
private void RegisterLlsdHandler<TResponse, TRequest>( string path, LlsdMethod<TResponse, TRequest> method )
where TRequest : new()
{
// path should be handler key, but for now just conceptually store it.
m_handler = new LlsdMethodEntry<TResponse, TRequest>( method );
}
private string ProcessLlsdMethod( string request,string path )
{
LlsdMethodEntry<LLSDMapLayerResponse, LLSDMapRequest> concreteHandler = new LlsdMethodEntry<LLSDMapLayerResponse, LLSDMapRequest>( LlsdMethodDemo );
return m_handler.Handle(request, path);
}
private bool AddNewSessionHandler(ulong regionHandle, Login loginData)
{
m_log.WriteLine(LogPriority.NORMAL, "Region [{0}] recieved Login from [{1}] [{2}]", regionHandle, loginData.First, loginData.Last);