using System;
using System.Collections.Generic;
using System.Text;
using OpenSim.Servers;
using libsecondlife;
namespace OpenSim.Region
{
public class Caps
{
private string httpListenerAddress;
private uint httpListenPort;
private string MainPath = "00334-0000/";
private string MapLayerPath = "00334-0001/";
private BaseHttpServer httpListener;
public Caps(BaseHttpServer httpServer, string httpListen, uint httpPort)
{
httpListener = httpServer;
httpListenerAddress = httpListen;
httpListenPort = httpPort;
}
///
///
///
public void RegisterHandlers()
{
Console.WriteLine("registering caps handlers");
httpListener.AddRestHandler("POST", "/CAPS/" + MainPath, CapsRequest);
httpListener.AddRestHandler("POST", "/CAPS/" + MapLayerPath, MapLayer);
}
///
///
///
///
///
///
///
public string CapsRequest(string request, string path, string param)
{
Console.WriteLine("Caps request " + request);
string result = "";
return result;
}
///
///
///
///
protected string GetCapabilities()
{
string capURLS = "MapLayerhttp://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + MapLayerPath + "";
return capURLS;
}
///
///
///
///
///
///
///
public string MapLayer(string request, string path, string param)
{
Console.WriteLine("Caps MapLayer request " + request);
string res = "";
return res;
}
///
///
///
///
protected string BuildLLSDMapLayerResponse()
{
int left;
int right;
int top;
int bottom;
LLUUID image = null;
left = 500;
bottom = 500;
top = 1500;
right = 1500;
image = new LLUUID("00000000-0000-0000-9999-000000000006");
string res= "Left"+left+"Bottom"+bottom +"Top"+top+"Right"+right+"ImageID"+image.ToStringHyphenated()+"";
return res;
}
}
}