diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Capabilities/Caps.cs | 626 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDArray.cs | 84 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDAssetUploadComplete.cs | 88 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDAssetUploadRequest.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDAssetUploadResponse.cs | 36 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDCapEvent.cs | 82 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDCapsDetails.cs | 34 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDEmpty.cs | 76 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDHelpers.cs | 328 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMapLayer.cs | 92 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs | 82 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMapRequest.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMethod.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDStreamHandler.cs | 84 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDTest.cs | 82 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDType.cs | 118 |
16 files changed, 948 insertions, 948 deletions
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs index 7acbf8e..d2ef526 100644 --- a/OpenSim/Region/Capabilities/Caps.cs +++ b/OpenSim/Region/Capabilities/Caps.cs | |||
@@ -1,313 +1,313 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Text; | 31 | using System.Text; |
32 | using System.IO; | 32 | using System.IO; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | using OpenSim.Framework.Servers; | 34 | using OpenSim.Framework.Servers; |
35 | using OpenSim.Framework.Types; | 35 | using OpenSim.Framework.Types; |
36 | using OpenSim.Framework.Utilities; | 36 | using OpenSim.Framework.Utilities; |
37 | using OpenSim.Region.Caches; | 37 | using OpenSim.Region.Caches; |
38 | 38 | ||
39 | namespace OpenSim.Region.Capabilities | 39 | namespace OpenSim.Region.Capabilities |
40 | { | 40 | { |
41 | public delegate void UpLoadedTexture(LLUUID assetID, LLUUID inventoryItem, byte[] data); | 41 | public delegate void UpLoadedTexture(LLUUID assetID, LLUUID inventoryItem, byte[] data); |
42 | 42 | ||
43 | public class Caps | 43 | public class Caps |
44 | { | 44 | { |
45 | private string m_httpListenerHostName; | 45 | private string m_httpListenerHostName; |
46 | private int m_httpListenPort; | 46 | private int m_httpListenPort; |
47 | private string m_capsObjectPath = "00001-"; | 47 | private string m_capsObjectPath = "00001-"; |
48 | private string m_requestPath = "0000/"; | 48 | private string m_requestPath = "0000/"; |
49 | private string m_mapLayerPath = "0001/"; | 49 | private string m_mapLayerPath = "0001/"; |
50 | private string m_newInventory = "0002/"; | 50 | private string m_newInventory = "0002/"; |
51 | // private string m_requestTexture = "0003/"; | 51 | // private string m_requestTexture = "0003/"; |
52 | //private string eventQueue = "0100/"; | 52 | //private string eventQueue = "0100/"; |
53 | private BaseHttpServer httpListener; | 53 | private BaseHttpServer httpListener; |
54 | private LLUUID agentID; | 54 | private LLUUID agentID; |
55 | private AssetCache assetCache; | 55 | private AssetCache assetCache; |
56 | private int eventQueueCount = 1; | 56 | private int eventQueueCount = 1; |
57 | private Queue<string> CapsEventQueue = new Queue<string>(); | 57 | private Queue<string> CapsEventQueue = new Queue<string>(); |
58 | 58 | ||
59 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) | 59 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) |
60 | { | 60 | { |
61 | assetCache = assetCach; | 61 | assetCache = assetCach; |
62 | m_capsObjectPath = capsPath; | 62 | m_capsObjectPath = capsPath; |
63 | httpListener = httpServer; | 63 | httpListener = httpServer; |
64 | m_httpListenerHostName = httpListen; | 64 | m_httpListenerHostName = httpListen; |
65 | m_httpListenPort = httpPort; | 65 | m_httpListenPort = httpPort; |
66 | agentID = agent; | 66 | agentID = agent; |
67 | } | 67 | } |
68 | 68 | ||
69 | /// <summary> | 69 | /// <summary> |
70 | /// | 70 | /// |
71 | /// </summary> | 71 | /// </summary> |
72 | public void RegisterHandlers() | 72 | public void RegisterHandlers() |
73 | { | 73 | { |
74 | Console.WriteLine("registering CAPS handlers"); | 74 | Console.WriteLine("registering CAPS handlers"); |
75 | string capsBase = "/CAPS/" + m_capsObjectPath; | 75 | string capsBase = "/CAPS/" + m_capsObjectPath; |
76 | 76 | ||
77 | httpListener.AddStreamHandler(new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); | 77 | httpListener.AddStreamHandler(new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); |
78 | httpListener.AddStreamHandler( new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", capsBase + m_newInventory, this.NewAgentInventoryRequest)); | 78 | httpListener.AddStreamHandler( new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", capsBase + m_newInventory, this.NewAgentInventoryRequest)); |
79 | 79 | ||
80 | AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); | 80 | AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); |
81 | // AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue); | 81 | // AddLegacyCapsHandler( httpListener, eventQueue, ProcessEventQueue); |
82 | // AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture); | 82 | // AddLegacyCapsHandler( httpListener, m_requestTexture, RequestTexture); |
83 | } | 83 | } |
84 | 84 | ||
85 | [Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")] | 85 | [Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")] |
86 | private void AddLegacyCapsHandler(BaseHttpServer httpListener, string path, RestMethod restMethod) | 86 | private void AddLegacyCapsHandler(BaseHttpServer httpListener, string path, RestMethod restMethod) |
87 | { | 87 | { |
88 | string capsBase = "/CAPS/" + m_capsObjectPath; | 88 | string capsBase = "/CAPS/" + m_capsObjectPath; |
89 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); | 89 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); |
90 | } | 90 | } |
91 | 91 | ||
92 | /// <summary> | 92 | /// <summary> |
93 | /// | 93 | /// |
94 | /// </summary> | 94 | /// </summary> |
95 | /// <param name="request"></param> | 95 | /// <param name="request"></param> |
96 | /// <param name="path"></param> | 96 | /// <param name="path"></param> |
97 | /// <param name="param"></param> | 97 | /// <param name="param"></param> |
98 | /// <returns></returns> | 98 | /// <returns></returns> |
99 | public string CapsRequest(string request, string path, string param) | 99 | public string CapsRequest(string request, string path, string param) |
100 | { | 100 | { |
101 | // Console.WriteLine("caps request " + request); | 101 | // Console.WriteLine("caps request " + request); |
102 | string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); | 102 | string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); |
103 | return result; | 103 | return result; |
104 | } | 104 | } |
105 | 105 | ||
106 | /// <summary> | 106 | /// <summary> |
107 | /// | 107 | /// |
108 | /// </summary> | 108 | /// </summary> |
109 | /// <returns></returns> | 109 | /// <returns></returns> |
110 | protected LLSDCapsDetails GetCapabilities() | 110 | protected LLSDCapsDetails GetCapabilities() |
111 | { | 111 | { |
112 | LLSDCapsDetails caps = new LLSDCapsDetails(); | 112 | LLSDCapsDetails caps = new LLSDCapsDetails(); |
113 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; | 113 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; |
114 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; | 114 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; |
115 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; | 115 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; |
116 | //caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; | 116 | //caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; |
117 | // caps.ChatSessionRequest = capsBaseUrl + m_requestTexture; | 117 | // caps.ChatSessionRequest = capsBaseUrl + m_requestTexture; |
118 | return caps; | 118 | return caps; |
119 | } | 119 | } |
120 | 120 | ||
121 | /// <summary> | 121 | /// <summary> |
122 | /// | 122 | /// |
123 | /// </summary> | 123 | /// </summary> |
124 | /// <param name="mapReq"></param> | 124 | /// <param name="mapReq"></param> |
125 | /// <returns></returns> | 125 | /// <returns></returns> |
126 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) | 126 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) |
127 | { | 127 | { |
128 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | 128 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
129 | mapResponse.LayerData.Array.Add(this.GetLLSDMapLayerResponse()); | 129 | mapResponse.LayerData.Array.Add(this.GetLLSDMapLayerResponse()); |
130 | return mapResponse; | 130 | return mapResponse; |
131 | } | 131 | } |
132 | 132 | ||
133 | /// <summary> | 133 | /// <summary> |
134 | /// | 134 | /// |
135 | /// </summary> | 135 | /// </summary> |
136 | /// <returns></returns> | 136 | /// <returns></returns> |
137 | protected LLSDMapLayer GetLLSDMapLayerResponse() | 137 | protected LLSDMapLayer GetLLSDMapLayerResponse() |
138 | { | 138 | { |
139 | LLSDMapLayer mapLayer = new LLSDMapLayer(); | 139 | LLSDMapLayer mapLayer = new LLSDMapLayer(); |
140 | mapLayer.Right = 5000; | 140 | mapLayer.Right = 5000; |
141 | mapLayer.Top = 5000; | 141 | mapLayer.Top = 5000; |
142 | mapLayer.ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); | 142 | mapLayer.ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); |
143 | return mapLayer; | 143 | return mapLayer; |
144 | } | 144 | } |
145 | 145 | ||
146 | /// <summary> | 146 | /// <summary> |
147 | /// | 147 | /// |
148 | /// </summary> | 148 | /// </summary> |
149 | /// <param name="request"></param> | 149 | /// <param name="request"></param> |
150 | /// <param name="path"></param> | 150 | /// <param name="path"></param> |
151 | /// <param name="param"></param> | 151 | /// <param name="param"></param> |
152 | /// <returns></returns> | 152 | /// <returns></returns> |
153 | public string RequestTexture(string request, string path, string param) | 153 | public string RequestTexture(string request, string path, string param) |
154 | { | 154 | { |
155 | Console.WriteLine("texture request " + request); | 155 | Console.WriteLine("texture request " + request); |
156 | // Needs implementing (added to remove compiler warning) | 156 | // Needs implementing (added to remove compiler warning) |
157 | return ""; | 157 | return ""; |
158 | } | 158 | } |
159 | 159 | ||
160 | #region EventQueue (Currently not enabled) | 160 | #region EventQueue (Currently not enabled) |
161 | /// <summary> | 161 | /// <summary> |
162 | /// | 162 | /// |
163 | /// </summary> | 163 | /// </summary> |
164 | /// <param name="request"></param> | 164 | /// <param name="request"></param> |
165 | /// <param name="path"></param> | 165 | /// <param name="path"></param> |
166 | /// <param name="param"></param> | 166 | /// <param name="param"></param> |
167 | /// <returns></returns> | 167 | /// <returns></returns> |
168 | public string ProcessEventQueue(string request, string path, string param) | 168 | public string ProcessEventQueue(string request, string path, string param) |
169 | { | 169 | { |
170 | string res = ""; | 170 | string res = ""; |
171 | 171 | ||
172 | if (this.CapsEventQueue.Count > 0) | 172 | if (this.CapsEventQueue.Count > 0) |
173 | { | 173 | { |
174 | lock (this.CapsEventQueue) | 174 | lock (this.CapsEventQueue) |
175 | { | 175 | { |
176 | string item = CapsEventQueue.Dequeue(); | 176 | string item = CapsEventQueue.Dequeue(); |
177 | res = item; | 177 | res = item; |
178 | } | 178 | } |
179 | } | 179 | } |
180 | else | 180 | else |
181 | { | 181 | { |
182 | res = this.CreateEmptyEventResponse(); | 182 | res = this.CreateEmptyEventResponse(); |
183 | } | 183 | } |
184 | return res; | 184 | return res; |
185 | } | 185 | } |
186 | 186 | ||
187 | /// <summary> | 187 | /// <summary> |
188 | /// | 188 | /// |
189 | /// </summary> | 189 | /// </summary> |
190 | /// <param name="caps"></param> | 190 | /// <param name="caps"></param> |
191 | /// <param name="ipAddressPort"></param> | 191 | /// <param name="ipAddressPort"></param> |
192 | /// <returns></returns> | 192 | /// <returns></returns> |
193 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) | 193 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) |
194 | { | 194 | { |
195 | LLSDCapEvent eventItem = new LLSDCapEvent(); | 195 | LLSDCapEvent eventItem = new LLSDCapEvent(); |
196 | eventItem.id = eventQueueCount; | 196 | eventItem.id = eventQueueCount; |
197 | //should be creating a EstablishAgentComms item, but there isn't a class for it yet | 197 | //should be creating a EstablishAgentComms item, but there isn't a class for it yet |
198 | eventItem.events.Array.Add(new LLSDEmpty()); | 198 | eventItem.events.Array.Add(new LLSDEmpty()); |
199 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); | 199 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); |
200 | eventQueueCount++; | 200 | eventQueueCount++; |
201 | 201 | ||
202 | this.CapsEventQueue.Enqueue(res); | 202 | this.CapsEventQueue.Enqueue(res); |
203 | return res; | 203 | return res; |
204 | } | 204 | } |
205 | 205 | ||
206 | /// <summary> | 206 | /// <summary> |
207 | /// | 207 | /// |
208 | /// </summary> | 208 | /// </summary> |
209 | /// <returns></returns> | 209 | /// <returns></returns> |
210 | public string CreateEmptyEventResponse() | 210 | public string CreateEmptyEventResponse() |
211 | { | 211 | { |
212 | LLSDCapEvent eventItem = new LLSDCapEvent(); | 212 | LLSDCapEvent eventItem = new LLSDCapEvent(); |
213 | eventItem.id = eventQueueCount; | 213 | eventItem.id = eventQueueCount; |
214 | eventItem.events.Array.Add(new LLSDEmpty()); | 214 | eventItem.events.Array.Add(new LLSDEmpty()); |
215 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); | 215 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); |
216 | eventQueueCount++; | 216 | eventQueueCount++; |
217 | return res; | 217 | return res; |
218 | } | 218 | } |
219 | #endregion | 219 | #endregion |
220 | 220 | ||
221 | /// <summary> | 221 | /// <summary> |
222 | /// | 222 | /// |
223 | /// </summary> | 223 | /// </summary> |
224 | /// <param name="llsdRequest"></param> | 224 | /// <param name="llsdRequest"></param> |
225 | /// <returns></returns> | 225 | /// <returns></returns> |
226 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) | 226 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) |
227 | { | 227 | { |
228 | string capsBase = "/CAPS/" + m_capsObjectPath; | 228 | string capsBase = "/CAPS/" + m_capsObjectPath; |
229 | LLUUID newAsset = LLUUID.Random(); | 229 | LLUUID newAsset = LLUUID.Random(); |
230 | LLUUID newInvItem = LLUUID.Random(); | 230 | LLUUID newInvItem = LLUUID.Random(); |
231 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 231 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
232 | 232 | ||
233 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, capsBase + uploaderPath, this.httpListener); | 233 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, capsBase + uploaderPath, this.httpListener); |
234 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 234 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
235 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; | 235 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; |
236 | 236 | ||
237 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 237 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
238 | uploadResponse.uploader = uploaderURL; | 238 | uploadResponse.uploader = uploaderURL; |
239 | uploadResponse.state = "upload"; | 239 | uploadResponse.state = "upload"; |
240 | uploader.OnUpLoad += this.UploadCompleteHandler; | 240 | uploader.OnUpLoad += this.UploadCompleteHandler; |
241 | return uploadResponse; | 241 | return uploadResponse; |
242 | } | 242 | } |
243 | 243 | ||
244 | /// <summary> | 244 | /// <summary> |
245 | /// | 245 | /// |
246 | /// </summary> | 246 | /// </summary> |
247 | /// <param name="assetID"></param> | 247 | /// <param name="assetID"></param> |
248 | /// <param name="inventoryItem"></param> | 248 | /// <param name="inventoryItem"></param> |
249 | /// <param name="data"></param> | 249 | /// <param name="data"></param> |
250 | public void UploadCompleteHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data) | 250 | public void UploadCompleteHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data) |
251 | { | 251 | { |
252 | AssetBase asset; | 252 | AssetBase asset; |
253 | asset = new AssetBase(); | 253 | asset = new AssetBase(); |
254 | asset.FullID = assetID; | 254 | asset.FullID = assetID; |
255 | asset.Type = 0; | 255 | asset.Type = 0; |
256 | asset.InvType = 0; | 256 | asset.InvType = 0; |
257 | asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); | 257 | asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); |
258 | asset.Data = data; | 258 | asset.Data = data; |
259 | this.assetCache.AddAsset(asset); | 259 | this.assetCache.AddAsset(asset); |
260 | } | 260 | } |
261 | 261 | ||
262 | public class AssetUploader | 262 | public class AssetUploader |
263 | { | 263 | { |
264 | public event UpLoadedTexture OnUpLoad; | 264 | public event UpLoadedTexture OnUpLoad; |
265 | 265 | ||
266 | private string uploaderPath = ""; | 266 | private string uploaderPath = ""; |
267 | private LLUUID newAssetID; | 267 | private LLUUID newAssetID; |
268 | private LLUUID inventoryItemID; | 268 | private LLUUID inventoryItemID; |
269 | private BaseHttpServer httpListener; | 269 | private BaseHttpServer httpListener; |
270 | 270 | ||
271 | /// <summary> | 271 | /// <summary> |
272 | /// | 272 | /// |
273 | /// </summary> | 273 | /// </summary> |
274 | /// <param name="assetID"></param> | 274 | /// <param name="assetID"></param> |
275 | /// <param name="inventoryItem"></param> | 275 | /// <param name="inventoryItem"></param> |
276 | /// <param name="path"></param> | 276 | /// <param name="path"></param> |
277 | /// <param name="httpServer"></param> | 277 | /// <param name="httpServer"></param> |
278 | public AssetUploader(LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer) | 278 | public AssetUploader(LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer) |
279 | { | 279 | { |
280 | newAssetID = assetID; | 280 | newAssetID = assetID; |
281 | inventoryItemID = inventoryItem; | 281 | inventoryItemID = inventoryItem; |
282 | uploaderPath = path; | 282 | uploaderPath = path; |
283 | httpListener = httpServer; | 283 | httpListener = httpServer; |
284 | } | 284 | } |
285 | 285 | ||
286 | /// <summary> | 286 | /// <summary> |
287 | /// | 287 | /// |
288 | /// </summary> | 288 | /// </summary> |
289 | /// <param name="data"></param> | 289 | /// <param name="data"></param> |
290 | /// <param name="path"></param> | 290 | /// <param name="path"></param> |
291 | /// <param name="param"></param> | 291 | /// <param name="param"></param> |
292 | /// <returns></returns> | 292 | /// <returns></returns> |
293 | public string uploaderCaps(byte[] data, string path, string param) | 293 | public string uploaderCaps(byte[] data, string path, string param) |
294 | { | 294 | { |
295 | LLUUID inv = this.inventoryItemID; | 295 | LLUUID inv = this.inventoryItemID; |
296 | string res = ""; | 296 | string res = ""; |
297 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); | 297 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); |
298 | uploadComplete.new_asset = newAssetID.ToStringHyphenated(); | 298 | uploadComplete.new_asset = newAssetID.ToStringHyphenated(); |
299 | uploadComplete.new_inventory_item = inv; | 299 | uploadComplete.new_inventory_item = inv; |
300 | uploadComplete.state = "complete"; | 300 | uploadComplete.state = "complete"; |
301 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); | 301 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); |
302 | 302 | ||
303 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 303 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
304 | 304 | ||
305 | if (OnUpLoad != null) | 305 | if (OnUpLoad != null) |
306 | { | 306 | { |
307 | OnUpLoad(newAssetID, inv, data); | 307 | OnUpLoad(newAssetID, inv, data); |
308 | } | 308 | } |
309 | return res; | 309 | return res; |
310 | } | 310 | } |
311 | } | 311 | } |
312 | } | 312 | } |
313 | } | 313 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDArray.cs b/OpenSim/Region/Capabilities/LLSDArray.cs index e04849f..d3e1979 100644 --- a/OpenSim/Region/Capabilities/LLSDArray.cs +++ b/OpenSim/Region/Capabilities/LLSDArray.cs | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System.Collections; | 28 | using System.Collections; |
29 | 29 | ||
30 | namespace OpenSim.Region.Capabilities | 30 | namespace OpenSim.Region.Capabilities |
31 | { | 31 | { |
32 | [LLSDType("ARRAY")] | 32 | [LLSDType("ARRAY")] |
33 | public class LLSDArray | 33 | public class LLSDArray |
34 | { | 34 | { |
35 | public ArrayList Array = new ArrayList(); | 35 | public ArrayList Array = new ArrayList(); |
36 | 36 | ||
37 | public LLSDArray() | 37 | public LLSDArray() |
38 | { | 38 | { |
39 | 39 | ||
40 | } | 40 | } |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Region/Capabilities/LLSDAssetUploadComplete.cs index 1b78353..5718b8f 100644 --- a/OpenSim/Region/Capabilities/LLSDAssetUploadComplete.cs +++ b/OpenSim/Region/Capabilities/LLSDAssetUploadComplete.cs | |||
@@ -1,44 +1,44 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Region.Capabilities | 30 | namespace OpenSim.Region.Capabilities |
31 | { | 31 | { |
32 | [LLSDType("MAP")] | 32 | [LLSDType("MAP")] |
33 | public class LLSDAssetUploadComplete | 33 | public class LLSDAssetUploadComplete |
34 | { | 34 | { |
35 | public string new_asset = ""; | 35 | public string new_asset = ""; |
36 | public LLUUID new_inventory_item = LLUUID.Zero; | 36 | public LLUUID new_inventory_item = LLUUID.Zero; |
37 | public string state = ""; | 37 | public string state = ""; |
38 | 38 | ||
39 | public LLSDAssetUploadComplete() | 39 | public LLSDAssetUploadComplete() |
40 | { | 40 | { |
41 | 41 | ||
42 | } | 42 | } |
43 | } | 43 | } |
44 | } | 44 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDAssetUploadRequest.cs b/OpenSim/Region/Capabilities/LLSDAssetUploadRequest.cs index 7ef77cb..0096fb1 100644 --- a/OpenSim/Region/Capabilities/LLSDAssetUploadRequest.cs +++ b/OpenSim/Region/Capabilities/LLSDAssetUploadRequest.cs | |||
@@ -1,21 +1,21 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | 5 | ||
6 | namespace OpenSim.Region.Capabilities | 6 | namespace OpenSim.Region.Capabilities |
7 | { | 7 | { |
8 | [LLSDMap] | 8 | [LLSDMap] |
9 | public class LLSDAssetUploadRequest | 9 | public class LLSDAssetUploadRequest |
10 | { | 10 | { |
11 | public string asset_type = ""; | 11 | public string asset_type = ""; |
12 | public string description = ""; | 12 | public string description = ""; |
13 | public LLUUID folder_id = LLUUID.Zero; | 13 | public LLUUID folder_id = LLUUID.Zero; |
14 | public string inventory_type = ""; | 14 | public string inventory_type = ""; |
15 | public string name = ""; | 15 | public string name = ""; |
16 | 16 | ||
17 | public LLSDAssetUploadRequest() | 17 | public LLSDAssetUploadRequest() |
18 | { | 18 | { |
19 | } | 19 | } |
20 | } | 20 | } |
21 | } | 21 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Region/Capabilities/LLSDAssetUploadResponse.cs index 1a620ae..2a2a5d1 100644 --- a/OpenSim/Region/Capabilities/LLSDAssetUploadResponse.cs +++ b/OpenSim/Region/Capabilities/LLSDAssetUploadResponse.cs | |||
@@ -1,18 +1,18 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | 4 | ||
5 | namespace OpenSim.Region.Capabilities | 5 | namespace OpenSim.Region.Capabilities |
6 | { | 6 | { |
7 | [LLSDMap] | 7 | [LLSDMap] |
8 | public class LLSDAssetUploadResponse | 8 | public class LLSDAssetUploadResponse |
9 | { | 9 | { |
10 | public string uploader = ""; | 10 | public string uploader = ""; |
11 | public string state = ""; | 11 | public string state = ""; |
12 | 12 | ||
13 | public LLSDAssetUploadResponse() | 13 | public LLSDAssetUploadResponse() |
14 | { | 14 | { |
15 | 15 | ||
16 | } | 16 | } |
17 | } | 17 | } |
18 | } | 18 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDCapEvent.cs b/OpenSim/Region/Capabilities/LLSDCapEvent.cs index 51b4fe0..2c2689b 100644 --- a/OpenSim/Region/Capabilities/LLSDCapEvent.cs +++ b/OpenSim/Region/Capabilities/LLSDCapEvent.cs | |||
@@ -1,41 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | namespace OpenSim.Region.Capabilities | 28 | namespace OpenSim.Region.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDCapEvent | 31 | public class LLSDCapEvent |
32 | { | 32 | { |
33 | public int id = 0; | 33 | public int id = 0; |
34 | public LLSDArray events = new LLSDArray(); | 34 | public LLSDArray events = new LLSDArray(); |
35 | 35 | ||
36 | public LLSDCapEvent() | 36 | public LLSDCapEvent() |
37 | { | 37 | { |
38 | 38 | ||
39 | } | 39 | } |
40 | } | 40 | } |
41 | } | 41 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs index ecb2328..132b8f7 100644 --- a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs +++ b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs | |||
@@ -1,17 +1,17 @@ | |||
1 | namespace OpenSim.Region.Capabilities | 1 | namespace OpenSim.Region.Capabilities |
2 | { | 2 | { |
3 | [LLSDType("MAP")] | 3 | [LLSDType("MAP")] |
4 | public class LLSDCapsDetails | 4 | public class LLSDCapsDetails |
5 | { | 5 | { |
6 | public string MapLayer = ""; | 6 | public string MapLayer = ""; |
7 | public string NewFileAgentInventory = ""; | 7 | public string NewFileAgentInventory = ""; |
8 | //public string EventQueueGet = ""; | 8 | //public string EventQueueGet = ""; |
9 | //public string RequestTextureDownload = ""; | 9 | //public string RequestTextureDownload = ""; |
10 | //public string ChatSessionRequest = ""; | 10 | //public string ChatSessionRequest = ""; |
11 | 11 | ||
12 | public LLSDCapsDetails() | 12 | public LLSDCapsDetails() |
13 | { | 13 | { |
14 | 14 | ||
15 | } | 15 | } |
16 | } | 16 | } |
17 | } | 17 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDEmpty.cs b/OpenSim/Region/Capabilities/LLSDEmpty.cs index d79c09e..ca27c9d 100644 --- a/OpenSim/Region/Capabilities/LLSDEmpty.cs +++ b/OpenSim/Region/Capabilities/LLSDEmpty.cs | |||
@@ -1,38 +1,38 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | namespace OpenSim.Region.Capabilities | 28 | namespace OpenSim.Region.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDEmpty | 31 | public class LLSDEmpty |
32 | { | 32 | { |
33 | public LLSDEmpty() | 33 | public LLSDEmpty() |
34 | { | 34 | { |
35 | 35 | ||
36 | } | 36 | } |
37 | } | 37 | } |
38 | } | 38 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDHelpers.cs b/OpenSim/Region/Capabilities/LLSDHelpers.cs index 19ef0c9..efeb9b1 100644 --- a/OpenSim/Region/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Region/Capabilities/LLSDHelpers.cs | |||
@@ -1,164 +1,164 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Reflection; | 31 | using System.Reflection; |
32 | using System.Xml; | 32 | using System.Xml; |
33 | using libsecondlife; | 33 | using libsecondlife; |
34 | 34 | ||
35 | namespace OpenSim.Region.Capabilities | 35 | namespace OpenSim.Region.Capabilities |
36 | { | 36 | { |
37 | public class LLSDHelpers | 37 | public class LLSDHelpers |
38 | { | 38 | { |
39 | public static string SerialiseLLSDReply(object obj) | 39 | public static string SerialiseLLSDReply(object obj) |
40 | { | 40 | { |
41 | StringWriter sw = new StringWriter(); | 41 | StringWriter sw = new StringWriter(); |
42 | XmlTextWriter writer = new XmlTextWriter(sw); | 42 | XmlTextWriter writer = new XmlTextWriter(sw); |
43 | writer.Formatting = Formatting.None; | 43 | writer.Formatting = Formatting.None; |
44 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | 44 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); |
45 | SerializeLLSDType(writer, obj); | 45 | SerializeLLSDType(writer, obj); |
46 | writer.WriteEndElement(); | 46 | writer.WriteEndElement(); |
47 | writer.Close(); | 47 | writer.Close(); |
48 | return sw.ToString(); | 48 | return sw.ToString(); |
49 | } | 49 | } |
50 | 50 | ||
51 | public static void SerializeLLSDType(XmlTextWriter writer, object obj) | 51 | public static void SerializeLLSDType(XmlTextWriter writer, object obj) |
52 | { | 52 | { |
53 | Type myType = obj.GetType(); | 53 | Type myType = obj.GetType(); |
54 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); | 54 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); |
55 | if (llsdattributes.Length > 0) | 55 | if (llsdattributes.Length > 0) |
56 | { | 56 | { |
57 | switch (llsdattributes[0].ObjectType) | 57 | switch (llsdattributes[0].ObjectType) |
58 | { | 58 | { |
59 | case "MAP": | 59 | case "MAP": |
60 | writer.WriteStartElement(String.Empty, "map", String.Empty); | 60 | writer.WriteStartElement(String.Empty, "map", String.Empty); |
61 | FieldInfo[] fields = myType.GetFields(); | 61 | FieldInfo[] fields = myType.GetFields(); |
62 | for (int i = 0; i < fields.Length; i++) | 62 | for (int i = 0; i < fields.Length; i++) |
63 | { | 63 | { |
64 | object fieldValue = fields[i].GetValue(obj); | 64 | object fieldValue = fields[i].GetValue(obj); |
65 | LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false); | 65 | LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false); |
66 | if (fieldAttributes.Length > 0) | 66 | if (fieldAttributes.Length > 0) |
67 | { | 67 | { |
68 | writer.WriteStartElement(String.Empty, "key", String.Empty); | 68 | writer.WriteStartElement(String.Empty, "key", String.Empty); |
69 | writer.WriteString(fields[i].Name); | 69 | writer.WriteString(fields[i].Name); |
70 | writer.WriteEndElement(); | 70 | writer.WriteEndElement(); |
71 | SerializeLLSDType(writer, fieldValue); | 71 | SerializeLLSDType(writer, fieldValue); |
72 | } | 72 | } |
73 | else | 73 | else |
74 | { | 74 | { |
75 | writer.WriteStartElement(String.Empty, "key", String.Empty); | 75 | writer.WriteStartElement(String.Empty, "key", String.Empty); |
76 | writer.WriteString(fields[i].Name); | 76 | writer.WriteString(fields[i].Name); |
77 | writer.WriteEndElement(); | 77 | writer.WriteEndElement(); |
78 | LLSD.LLSDWriteOne(writer, fieldValue); | 78 | LLSD.LLSDWriteOne(writer, fieldValue); |
79 | } | 79 | } |
80 | } | 80 | } |
81 | writer.WriteEndElement(); | 81 | writer.WriteEndElement(); |
82 | break; | 82 | break; |
83 | case "ARRAY": | 83 | case "ARRAY": |
84 | // LLSDArray arrayObject = obj as LLSDArray; | 84 | // LLSDArray arrayObject = obj as LLSDArray; |
85 | // ArrayList a = arrayObject.Array; | 85 | // ArrayList a = arrayObject.Array; |
86 | ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj); | 86 | ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj); |
87 | if (a != null) | 87 | if (a != null) |
88 | { | 88 | { |
89 | writer.WriteStartElement(String.Empty, "array", String.Empty); | 89 | writer.WriteStartElement(String.Empty, "array", String.Empty); |
90 | foreach (object item in a) | 90 | foreach (object item in a) |
91 | { | 91 | { |
92 | SerializeLLSDType(writer, item); | 92 | SerializeLLSDType(writer, item); |
93 | } | 93 | } |
94 | writer.WriteEndElement(); | 94 | writer.WriteEndElement(); |
95 | } | 95 | } |
96 | break; | 96 | break; |
97 | } | 97 | } |
98 | } | 98 | } |
99 | else | 99 | else |
100 | { | 100 | { |
101 | LLSD.LLSDWriteOne(writer, obj); | 101 | LLSD.LLSDWriteOne(writer, obj); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | public static object DeserialiseLLSDMap(Hashtable llsd, object obj) | 105 | public static object DeserialiseLLSDMap(Hashtable llsd, object obj) |
106 | { | 106 | { |
107 | Type myType = obj.GetType(); | 107 | Type myType = obj.GetType(); |
108 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); | 108 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); |
109 | if (llsdattributes.Length > 0) | 109 | if (llsdattributes.Length > 0) |
110 | { | 110 | { |
111 | switch (llsdattributes[0].ObjectType) | 111 | switch (llsdattributes[0].ObjectType) |
112 | { | 112 | { |
113 | case "MAP": | 113 | case "MAP": |
114 | IDictionaryEnumerator enumerator = llsd.GetEnumerator(); | 114 | IDictionaryEnumerator enumerator = llsd.GetEnumerator(); |
115 | while (enumerator.MoveNext()) | 115 | while (enumerator.MoveNext()) |
116 | { | 116 | { |
117 | FieldInfo field = myType.GetField((string)enumerator.Key); | 117 | FieldInfo field = myType.GetField((string)enumerator.Key); |
118 | if (field != null) | 118 | if (field != null) |
119 | { | 119 | { |
120 | if (enumerator.Value is Hashtable) | 120 | if (enumerator.Value is Hashtable) |
121 | { | 121 | { |
122 | object fieldValue = field.GetValue(obj); | 122 | object fieldValue = field.GetValue(obj); |
123 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); | 123 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); |
124 | } | 124 | } |
125 | else if (enumerator.Value is ArrayList) | 125 | else if (enumerator.Value is ArrayList) |
126 | { | 126 | { |
127 | object fieldValue = field.GetValue(obj); | 127 | object fieldValue = field.GetValue(obj); |
128 | fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); | 128 | fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); |
129 | //TODO | 129 | //TODO |
130 | // the LLSD map/array types in the array need to be deserialised | 130 | // the LLSD map/array types in the array need to be deserialised |
131 | // but first we need to know the right class to deserialise them into. | 131 | // but first we need to know the right class to deserialise them into. |
132 | } | 132 | } |
133 | else | 133 | else |
134 | { | 134 | { |
135 | field.SetValue(obj, enumerator.Value); | 135 | field.SetValue(obj, enumerator.Value); |
136 | } | 136 | } |
137 | } | 137 | } |
138 | } | 138 | } |
139 | break; | 139 | break; |
140 | } | 140 | } |
141 | } | 141 | } |
142 | return obj; | 142 | return obj; |
143 | } | 143 | } |
144 | } | 144 | } |
145 | 145 | ||
146 | 146 | ||
147 | 147 | ||
148 | 148 | ||
149 | 149 | ||
150 | 150 | ||
151 | 151 | ||
152 | 152 | ||
153 | 153 | ||
154 | 154 | ||
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
158 | 158 | ||
159 | 159 | ||
160 | 160 | ||
161 | 161 | ||
162 | 162 | ||
163 | 163 | ||
164 | } | 164 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDMapLayer.cs b/OpenSim/Region/Capabilities/LLSDMapLayer.cs index 566d0e9..e0c006c 100644 --- a/OpenSim/Region/Capabilities/LLSDMapLayer.cs +++ b/OpenSim/Region/Capabilities/LLSDMapLayer.cs | |||
@@ -1,46 +1,46 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using libsecondlife; | 28 | using libsecondlife; |
29 | 29 | ||
30 | namespace OpenSim.Region.Capabilities | 30 | namespace OpenSim.Region.Capabilities |
31 | { | 31 | { |
32 | [LLSDType("MAP")] | 32 | [LLSDType("MAP")] |
33 | public class LLSDMapLayer | 33 | public class LLSDMapLayer |
34 | { | 34 | { |
35 | public int Left = 0; | 35 | public int Left = 0; |
36 | public int Right = 0; | 36 | public int Right = 0; |
37 | public int Top = 0; | 37 | public int Top = 0; |
38 | public int Bottom = 0; | 38 | public int Bottom = 0; |
39 | public LLUUID ImageID = LLUUID.Zero; | 39 | public LLUUID ImageID = LLUUID.Zero; |
40 | 40 | ||
41 | public LLSDMapLayer() | 41 | public LLSDMapLayer() |
42 | { | 42 | { |
43 | 43 | ||
44 | } | 44 | } |
45 | } | 45 | } |
46 | } | 46 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs index ce746ae..8b9837b 100644 --- a/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs +++ b/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs | |||
@@ -1,41 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | namespace OpenSim.Region.Capabilities | 28 | namespace OpenSim.Region.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDMapLayerResponse | 31 | public class LLSDMapLayerResponse |
32 | { | 32 | { |
33 | public LLSDMapRequest AgentData = new LLSDMapRequest(); | 33 | public LLSDMapRequest AgentData = new LLSDMapRequest(); |
34 | public LLSDArray LayerData = new LLSDArray(); | 34 | public LLSDArray LayerData = new LLSDArray(); |
35 | 35 | ||
36 | public LLSDMapLayerResponse() | 36 | public LLSDMapLayerResponse() |
37 | { | 37 | { |
38 | 38 | ||
39 | } | 39 | } |
40 | } | 40 | } |
41 | } | 41 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDMapRequest.cs b/OpenSim/Region/Capabilities/LLSDMapRequest.cs index fb739cd..8ac7943 100644 --- a/OpenSim/Region/Capabilities/LLSDMapRequest.cs +++ b/OpenSim/Region/Capabilities/LLSDMapRequest.cs | |||
@@ -1,13 +1,13 @@ | |||
1 | namespace OpenSim.Region.Capabilities | 1 | namespace OpenSim.Region.Capabilities |
2 | { | 2 | { |
3 | [LLSDType("MAP")] | 3 | [LLSDType("MAP")] |
4 | public class LLSDMapRequest | 4 | public class LLSDMapRequest |
5 | { | 5 | { |
6 | public int Flags = 0; | 6 | public int Flags = 0; |
7 | 7 | ||
8 | public LLSDMapRequest() | 8 | public LLSDMapRequest() |
9 | { | 9 | { |
10 | 10 | ||
11 | } | 11 | } |
12 | } | 12 | } |
13 | } | 13 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDMethod.cs b/OpenSim/Region/Capabilities/LLSDMethod.cs index 5f42f44..068d539 100644 --- a/OpenSim/Region/Capabilities/LLSDMethod.cs +++ b/OpenSim/Region/Capabilities/LLSDMethod.cs | |||
@@ -1,8 +1,8 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | 4 | ||
5 | namespace OpenSim.Region.Capabilities | 5 | namespace OpenSim.Region.Capabilities |
6 | { | 6 | { |
7 | public delegate TResponse LLSDMethod<TRequest, TResponse>(TRequest request); | 7 | public delegate TResponse LLSDMethod<TRequest, TResponse>(TRequest request); |
8 | } | 8 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDStreamHandler.cs b/OpenSim/Region/Capabilities/LLSDStreamHandler.cs index 7d99b6e..d98e23f 100644 --- a/OpenSim/Region/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Region/Capabilities/LLSDStreamHandler.cs | |||
@@ -1,42 +1,42 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Text; | 3 | using System.Text; |
4 | using OpenSim.Framework.Servers; | 4 | using OpenSim.Framework.Servers; |
5 | using System.IO; | 5 | using System.IO; |
6 | using System.Collections; | 6 | using System.Collections; |
7 | using libsecondlife; | 7 | using libsecondlife; |
8 | 8 | ||
9 | namespace OpenSim.Region.Capabilities | 9 | namespace OpenSim.Region.Capabilities |
10 | { | 10 | { |
11 | public class LLSDStreamhandler<TRequest, TResponse> : BaseStreamHandler | 11 | public class LLSDStreamhandler<TRequest, TResponse> : BaseStreamHandler |
12 | where TRequest : new() | 12 | where TRequest : new() |
13 | { | 13 | { |
14 | private LLSDMethod<TRequest, TResponse> m_method; | 14 | private LLSDMethod<TRequest, TResponse> m_method; |
15 | 15 | ||
16 | public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) | 16 | public LLSDStreamhandler(string httpMethod, string path, LLSDMethod<TRequest, TResponse> method) |
17 | : base(httpMethod, path ) | 17 | : base(httpMethod, path ) |
18 | { | 18 | { |
19 | m_method = method; | 19 | m_method = method; |
20 | } | 20 | } |
21 | 21 | ||
22 | public override byte[] Handle(string path, Stream request) | 22 | public override byte[] Handle(string path, Stream request) |
23 | { | 23 | { |
24 | //Encoding encoding = Encoding.UTF8; | 24 | //Encoding encoding = Encoding.UTF8; |
25 | //StreamReader streamReader = new StreamReader(request, false); | 25 | //StreamReader streamReader = new StreamReader(request, false); |
26 | 26 | ||
27 | //string requestBody = streamReader.ReadToEnd(); | 27 | //string requestBody = streamReader.ReadToEnd(); |
28 | //streamReader.Close(); | 28 | //streamReader.Close(); |
29 | 29 | ||
30 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize( request ); | 30 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize( request ); |
31 | TRequest llsdRequest = new TRequest(); | 31 | TRequest llsdRequest = new TRequest(); |
32 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); | 32 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); |
33 | 33 | ||
34 | TResponse response = m_method(llsdRequest); | 34 | TResponse response = m_method(llsdRequest); |
35 | 35 | ||
36 | Encoding encoding = new UTF8Encoding(false); | 36 | Encoding encoding = new UTF8Encoding(false); |
37 | 37 | ||
38 | return encoding.GetBytes( LLSDHelpers.SerialiseLLSDReply(response) ); | 38 | return encoding.GetBytes( LLSDHelpers.SerialiseLLSDReply(response) ); |
39 | 39 | ||
40 | } | 40 | } |
41 | } | 41 | } |
42 | } | 42 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDTest.cs b/OpenSim/Region/Capabilities/LLSDTest.cs index f23e327..78ccf67 100644 --- a/OpenSim/Region/Capabilities/LLSDTest.cs +++ b/OpenSim/Region/Capabilities/LLSDTest.cs | |||
@@ -1,41 +1,41 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | namespace OpenSim.Region.Capabilities | 28 | namespace OpenSim.Region.Capabilities |
29 | { | 29 | { |
30 | [LLSDType("MAP")] | 30 | [LLSDType("MAP")] |
31 | public class LLSDTest | 31 | public class LLSDTest |
32 | { | 32 | { |
33 | public int Test1 = 20; | 33 | public int Test1 = 20; |
34 | public int Test2 = 10; | 34 | public int Test2 = 10; |
35 | 35 | ||
36 | public LLSDTest() | 36 | public LLSDTest() |
37 | { | 37 | { |
38 | 38 | ||
39 | } | 39 | } |
40 | } | 40 | } |
41 | } | 41 | } |
diff --git a/OpenSim/Region/Capabilities/LLSDType.cs b/OpenSim/Region/Capabilities/LLSDType.cs index c58a937..04f4d9a 100644 --- a/OpenSim/Region/Capabilities/LLSDType.cs +++ b/OpenSim/Region/Capabilities/LLSDType.cs | |||
@@ -1,59 +1,59 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | 2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
5 | * Redistribution and use in source and binary forms, with or without | 5 | * Redistribution and use in source and binary forms, with or without |
6 | * modification, are permitted provided that the following conditions are met: | 6 | * modification, are permitted provided that the following conditions are met: |
7 | * * Redistributions of source code must retain the above copyright | 7 | * * Redistributions of source code must retain the above copyright |
8 | * notice, this list of conditions and the following disclaimer. | 8 | * notice, this list of conditions and the following disclaimer. |
9 | * * Redistributions in binary form must reproduce the above copyright | 9 | * * Redistributions in binary form must reproduce the above copyright |
10 | * notice, this list of conditions and the following disclaimer in the | 10 | * notice, this list of conditions and the following disclaimer in the |
11 | * documentation and/or other materials provided with the distribution. | 11 | * documentation and/or other materials provided with the distribution. |
12 | * * Neither the name of the OpenSim Project nor the | 12 | * * Neither the name of the OpenSim Project nor the |
13 | * names of its contributors may be used to endorse or promote products | 13 | * names of its contributors may be used to endorse or promote products |
14 | * derived from this software without specific prior written permission. | 14 | * derived from this software without specific prior written permission. |
15 | * | 15 | * |
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | 16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY |
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | 17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | 19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY |
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | 20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | using System; | 28 | using System; |
29 | 29 | ||
30 | namespace OpenSim.Region.Capabilities | 30 | namespace OpenSim.Region.Capabilities |
31 | { | 31 | { |
32 | [AttributeUsage(AttributeTargets.Class)] | 32 | [AttributeUsage(AttributeTargets.Class)] |
33 | public class LLSDType : Attribute | 33 | public class LLSDType : Attribute |
34 | { | 34 | { |
35 | protected string myType; | 35 | protected string myType; |
36 | 36 | ||
37 | public LLSDType(string type) | 37 | public LLSDType(string type) |
38 | { | 38 | { |
39 | myType = type; | 39 | myType = type; |
40 | 40 | ||
41 | } | 41 | } |
42 | 42 | ||
43 | public string ObjectType | 43 | public string ObjectType |
44 | { | 44 | { |
45 | get | 45 | get |
46 | { | 46 | { |
47 | return myType; | 47 | return myType; |
48 | } | 48 | } |
49 | } | 49 | } |
50 | } | 50 | } |
51 | 51 | ||
52 | [AttributeUsage(AttributeTargets.Class)] | 52 | [AttributeUsage(AttributeTargets.Class)] |
53 | public class LLSDMap : LLSDType | 53 | public class LLSDMap : LLSDType |
54 | { | 54 | { |
55 | public LLSDMap() : base( "MAP" ) | 55 | public LLSDMap() : base( "MAP" ) |
56 | { | 56 | { |
57 | } | 57 | } |
58 | } | 58 | } |
59 | } | 59 | } |