aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/OpenSim.Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/OpenSim.Region')
-rw-r--r--OpenSim/OpenSim.Region/Caps.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs
index c672d29..f3ee628 100644
--- a/OpenSim/OpenSim.Region/Caps.cs
+++ b/OpenSim/OpenSim.Region/Caps.cs
@@ -13,6 +13,7 @@ namespace OpenSim.Region
13 private string MainPath = "00334-0000/"; 13 private string MainPath = "00334-0000/";
14 private string MapLayerPath = "00334-0001/"; 14 private string MapLayerPath = "00334-0001/";
15 private BaseHttpServer httpListener; 15 private BaseHttpServer httpListener;
16 // private LLUUID agentID;
16 17
17 public Caps(BaseHttpServer httpServer, string httpListen, uint httpPort) 18 public Caps(BaseHttpServer httpServer, string httpListen, uint httpPort)
18 { 19 {
@@ -26,7 +27,7 @@ namespace OpenSim.Region
26 /// </summary> 27 /// </summary>
27 public void RegisterHandlers() 28 public void RegisterHandlers()
28 { 29 {
29 Console.WriteLine("registering caps handlers"); 30 Console.WriteLine("registering CAPS handlers");
30 httpListener.AddRestHandler("POST", "/CAPS/" + MainPath, CapsRequest); 31 httpListener.AddRestHandler("POST", "/CAPS/" + MainPath, CapsRequest);
31 httpListener.AddRestHandler("POST", "/CAPS/" + MapLayerPath, MapLayer); 32 httpListener.AddRestHandler("POST", "/CAPS/" + MapLayerPath, MapLayer);
32 } 33 }
@@ -40,7 +41,6 @@ namespace OpenSim.Region
40 /// <returns></returns> 41 /// <returns></returns>
41 public string CapsRequest(string request, string path, string param) 42 public string CapsRequest(string request, string path, string param)
42 { 43 {
43 Console.WriteLine("Caps request " + request);
44 string result = "<llsd><map>"; 44 string result = "<llsd><map>";
45 result += this.GetCapabilities(); 45 result += this.GetCapabilities();
46 result += "</map></llsd>"; 46 result += "</map></llsd>";
@@ -53,7 +53,10 @@ namespace OpenSim.Region
53 /// <returns></returns> 53 /// <returns></returns>
54 protected string GetCapabilities() 54 protected string GetCapabilities()
55 { 55 {
56 string capURLS = "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + MapLayerPath + "</string>"; 56 string capURLS="";
57
58 capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + MapLayerPath + "</string>";
59
57 return capURLS; 60 return capURLS;
58 } 61 }
59 62
@@ -66,7 +69,7 @@ namespace OpenSim.Region
66 /// <returns></returns> 69 /// <returns></returns>
67 public string MapLayer(string request, string path, string param) 70 public string MapLayer(string request, string path, string param)
68 { 71 {
69 Console.WriteLine("Caps MapLayer request " + request); 72
70 string res = "<llsd><map><key>AgentData</key><map><key>Flags</key><integer>0</integer></map><key>LayerData</key><array>"; 73 string res = "<llsd><map><key>AgentData</key><map><key>Flags</key><integer>0</integer></map><key>LayerData</key><array>";
71 res += this.BuildLLSDMapLayerResponse(); 74 res += this.BuildLLSDMapLayerResponse();
72 res += "</array></map></llsd>"; 75 res += "</array></map></llsd>";
@@ -79,6 +82,7 @@ namespace OpenSim.Region
79 /// <returns></returns> 82 /// <returns></returns>
80 protected string BuildLLSDMapLayerResponse() 83 protected string BuildLLSDMapLayerResponse()
81 { 84 {
85 string res = "";
82 int left; 86 int left;
83 int right; 87 int right;
84 int top; 88 int top;
@@ -91,7 +95,8 @@ namespace OpenSim.Region
91 right = 1500; 95 right = 1500;
92 image = new LLUUID("00000000-0000-0000-9999-000000000006"); 96 image = new LLUUID("00000000-0000-0000-9999-000000000006");
93 97
94 string res= "<map><key>Left</key><integer>"+left+"</integer><key>Bottom</key><integer>"+bottom +"</integer><key>Top</key><integer>"+top+"</integer><key>Right</key><integer>"+right+"</integer><key>ImageID</key><uuid>"+image.ToStringHyphenated()+"</uuid></map>"; 98 res += "<map><key>Left</key><integer>" + left + "</integer><key>Bottom</key><integer>" + bottom + "</integer><key>Top</key><integer>" + top + "</integer><key>Right</key><integer>" + right + "</integer><key>ImageID</key><uuid>" + image.ToStringHyphenated() + "</uuid></map>";
99
95 return res; 100 return res;
96 } 101 }
97 } 102 }