diff options
author | MW | 2007-06-25 19:23:40 +0000 |
---|---|---|
committer | MW | 2007-06-25 19:23:40 +0000 |
commit | 9a5ec2b84c1eef98363eed95394fe43b4b39d467 (patch) | |
tree | ff8fbebf26b6b8e27d9229a8b01675d7dea114ce /OpenSim | |
parent | Some work in progress LLSD serialise / de-serialise functions. (diff) | |
download | opensim-SC-9a5ec2b84c1eef98363eed95394fe43b4b39d467.zip opensim-SC-9a5ec2b84c1eef98363eed95394fe43b4b39d467.tar.gz opensim-SC-9a5ec2b84c1eef98363eed95394fe43b4b39d467.tar.bz2 opensim-SC-9a5ec2b84c1eef98363eed95394fe43b4b39d467.tar.xz |
Some Caps/LLSD cleaning up.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/OpenSim.Region/Caps.cs | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/OpenSim/OpenSim.Region/Caps.cs b/OpenSim/OpenSim.Region/Caps.cs index 319e027..27d4828 100644 --- a/OpenSim/OpenSim.Region/Caps.cs +++ b/OpenSim/OpenSim.Region/Caps.cs | |||
@@ -63,10 +63,9 @@ namespace OpenSim.Region | |||
63 | /// <returns></returns> | 63 | /// <returns></returns> |
64 | public string CapsRequest(string request, string path, string param) | 64 | public string CapsRequest(string request, string path, string param) |
65 | { | 65 | { |
66 | Console.WriteLine("Caps Request " + request); | 66 | // Console.WriteLine("Caps Request " + request); |
67 | string result = "<llsd><map>"; | 67 | string result = ""; |
68 | result += this.GetCapabilities(); | 68 | result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); |
69 | result += "</map></llsd>"; | ||
70 | return result; | 69 | return result; |
71 | } | 70 | } |
72 | 71 | ||
@@ -74,15 +73,19 @@ namespace OpenSim.Region | |||
74 | /// | 73 | /// |
75 | /// </summary> | 74 | /// </summary> |
76 | /// <returns></returns> | 75 | /// <returns></returns> |
77 | protected string GetCapabilities() | 76 | protected LLSDCapsDetails GetCapabilities() |
78 | { | 77 | { |
79 | string capURLS = ""; | 78 | /* string capURLS = ""; |
80 | |||
81 | capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "</string>"; | 79 | capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "</string>"; |
82 | capURLS += "<key>NewFileAgentInventory</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "</string>"; | 80 | capURLS += "<key>NewFileAgentInventory</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "</string>"; |
83 | //capURLS += "<key>RequestTextureDownload</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "</string>"; | 81 | //capURLS += "<key>RequestTextureDownload</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "</string>"; |
84 | //capURLS += "<key>EventQueueGet</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + "</string>"; | 82 | //capURLS += "<key>EventQueueGet</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + "</string>"; |
85 | return capURLS; | 83 | return capURLS;*/ |
84 | |||
85 | LLSDCapsDetails caps = new LLSDCapsDetails(); | ||
86 | caps.MapLayer = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath; | ||
87 | caps.NewFileAgentInventory = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory; | ||
88 | return caps; | ||
86 | } | 89 | } |
87 | 90 | ||
88 | /// <summary> | 91 | /// <summary> |
@@ -99,9 +102,12 @@ namespace OpenSim.Region | |||
99 | LLSDMapRequest mapReq = new LLSDMapRequest(); | 102 | LLSDMapRequest mapReq = new LLSDMapRequest(); |
100 | LLSDHelpers.DeserialiseLLSDMap(hash, mapReq ); | 103 | LLSDHelpers.DeserialiseLLSDMap(hash, mapReq ); |
101 | 104 | ||
102 | string res = "<llsd><map><key>AgentData</key><map><key>Flags</key><integer>0</integer></map><key>LayerData</key><array>"; | 105 | LLSDMapLayerResponse mapResponse= new LLSDMapLayerResponse(); |
103 | res += this.BuildLLSDMapLayerResponse(); | 106 | mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); |
104 | res += "</array></map></llsd>"; | 107 | string res = LLSDHelpers.SerialiseLLSDReply(mapResponse); |
108 | |||
109 | //Console.WriteLine(" Maplayer response is " + res); | ||
110 | |||
105 | return res; | 111 | return res; |
106 | } | 112 | } |
107 | 113 | ||
@@ -109,24 +115,14 @@ namespace OpenSim.Region | |||
109 | /// | 115 | /// |
110 | /// </summary> | 116 | /// </summary> |
111 | /// <returns></returns> | 117 | /// <returns></returns> |
112 | protected string BuildLLSDMapLayerResponse() | 118 | protected LLSDMapLayer BuildLLSDMapLayerResponse() |
113 | { | 119 | { |
114 | string res = ""; | 120 | LLSDMapLayer mapLayer = new LLSDMapLayer(); |
115 | int left; | 121 | mapLayer.Right = 5000; |
116 | int right; | 122 | mapLayer.Top = 5000; |
117 | int top; | 123 | mapLayer.ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); |
118 | int bottom; | ||
119 | LLUUID image = null; | ||
120 | 124 | ||
121 | left = 0; | 125 | return mapLayer; |
122 | bottom = 0; | ||
123 | top = 5000; | ||
124 | right = 5000; | ||
125 | image = new LLUUID("00000000-0000-0000-9999-000000000006"); | ||
126 | |||
127 | 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>"; | ||
128 | |||
129 | return res; | ||
130 | } | 126 | } |
131 | 127 | ||
132 | public string ProcessEventQueue(string request, string path, string param) | 128 | public string ProcessEventQueue(string request, string path, string param) |
@@ -191,7 +187,7 @@ namespace OpenSim.Region | |||
191 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); | 187 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); |
192 | httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); | 188 | httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); |
193 | string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; | 189 | string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; |
194 | Console.WriteLine("uploader url is " + uploaderURL); | 190 | //Console.WriteLine("uploader url is " + uploaderURL); |
195 | res += "<llsd><map>"; | 191 | res += "<llsd><map>"; |
196 | res += "<key>uploader</key><string>" + uploaderURL + "</string>"; | 192 | res += "<key>uploader</key><string>" + uploaderURL + "</string>"; |
197 | //res += "<key>success</key><boolean>true</boolean>"; | 193 | //res += "<key>success</key><boolean>true</boolean>"; |
@@ -244,7 +240,7 @@ namespace OpenSim.Region | |||
244 | res += "<key>state</key><string>complete</string>"; | 240 | res += "<key>state</key><string>complete</string>"; |
245 | res += "</map></llsd>"; | 241 | res += "</map></llsd>"; |
246 | 242 | ||
247 | Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); | 243 | // Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); |
248 | httpListener.RemoveRestHandler("POST", "/CAPS/" + uploaderPath); | 244 | httpListener.RemoveRestHandler("POST", "/CAPS/" + uploaderPath); |
249 | if (OnUpLoad != null) | 245 | if (OnUpLoad != null) |
250 | { | 246 | { |