diff options
author | mingchen | 2007-06-27 19:43:46 +0000 |
---|---|---|
committer | mingchen | 2007-06-27 19:43:46 +0000 |
commit | 0232f01a58a3c0a88e95c22589efec21f502f081 (patch) | |
tree | ff210fa6750c23972086ebbf816ead0a0a2f412a /OpenSim/Region/Capabilities | |
parent | *Moved VersionInfo.cs to its correct place in OpenSim.csproj (diff) | |
download | opensim-SC-0232f01a58a3c0a88e95c22589efec21f502f081.zip opensim-SC-0232f01a58a3c0a88e95c22589efec21f502f081.tar.gz opensim-SC-0232f01a58a3c0a88e95c22589efec21f502f081.tar.bz2 opensim-SC-0232f01a58a3c0a88e95c22589efec21f502f081.tar.xz |
*Moved all the classes into their own file from LLSDHelpers.cs
*Some folder renaming to follow project Name
*Updated prebuild.xml
Diffstat (limited to 'OpenSim/Region/Capabilities')
-rw-r--r-- | OpenSim/Region/Capabilities/Caps.cs | 279 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDArray.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDCapEvent.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDCapsDetails.cs | 19 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDEmpty.cs | 42 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDHelpers.cs | 163 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMapLayer.cs | 50 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDMapRequest.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDTest.cs | 45 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDType.cs | 53 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/LLSDUploadReply.cs | 47 | ||||
-rw-r--r-- | OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj | 151 |
13 files changed, 1001 insertions, 0 deletions
diff --git a/OpenSim/Region/Capabilities/Caps.cs b/OpenSim/Region/Capabilities/Caps.cs new file mode 100644 index 0000000..416a6bc --- /dev/null +++ b/OpenSim/Region/Capabilities/Caps.cs | |||
@@ -0,0 +1,279 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | using System.IO; | ||
33 | using System.Xml; | ||
34 | using OpenSim.Framework.Servers; | ||
35 | using OpenSim.Framework; | ||
36 | using OpenSim.Framework.Utilities; | ||
37 | using OpenSim.Framework.Types; | ||
38 | using OpenSim.Region.Caches; | ||
39 | using libsecondlife; | ||
40 | |||
41 | namespace OpenSim.Region.Capabilities | ||
42 | { | ||
43 | public delegate void UpLoadedTexture(LLUUID assetID, LLUUID inventoryItem, byte[] data); | ||
44 | |||
45 | public class Caps | ||
46 | { | ||
47 | private string httpListenerAddress; | ||
48 | private uint httpListenPort; | ||
49 | private string capsObjectPath = "00001-"; | ||
50 | private string requestPath = "0000/"; | ||
51 | private string mapLayerPath = "0001/"; | ||
52 | private string newInventory = "0002/"; | ||
53 | private string requestTexture = "0003/"; | ||
54 | private string eventQueue = "0100/"; | ||
55 | private BaseHttpServer httpListener; | ||
56 | private LLUUID agentID; | ||
57 | private AssetCache assetCache; | ||
58 | private int eventQueueCount = 1; | ||
59 | private Queue<string> CapsEventQueue = new Queue<string>(); | ||
60 | |||
61 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, LLUUID agent) | ||
62 | { | ||
63 | assetCache = assetCach; | ||
64 | capsObjectPath = capsPath; | ||
65 | httpListener = httpServer; | ||
66 | httpListenerAddress = httpListen; | ||
67 | httpListenPort = httpPort; | ||
68 | agentID = agent; | ||
69 | } | ||
70 | |||
71 | /// <summary> | ||
72 | /// | ||
73 | /// </summary> | ||
74 | public void RegisterHandlers() | ||
75 | { | ||
76 | Console.WriteLine("registering CAPS handlers"); | ||
77 | httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + requestPath, CapsRequest); | ||
78 | httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + mapLayerPath, MapLayer); | ||
79 | httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + newInventory, NewAgentInventory); | ||
80 | httpListener.AddRestHandler("POST", "/CAPS/" + capsObjectPath + eventQueue, ProcessEventQueue); | ||
81 | } | ||
82 | |||
83 | /// <summary> | ||
84 | /// | ||
85 | /// </summary> | ||
86 | /// <param name="request"></param> | ||
87 | /// <param name="path"></param> | ||
88 | /// <param name="param"></param> | ||
89 | /// <returns></returns> | ||
90 | public string CapsRequest(string request, string path, string param) | ||
91 | { | ||
92 | // Console.WriteLine("Caps Request " + request); | ||
93 | string result = ""; | ||
94 | result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); | ||
95 | return result; | ||
96 | } | ||
97 | |||
98 | /// <summary> | ||
99 | /// | ||
100 | /// </summary> | ||
101 | /// <returns></returns> | ||
102 | protected LLSDCapsDetails GetCapabilities() | ||
103 | { | ||
104 | /* string capURLS = ""; | ||
105 | capURLS += "<key>MapLayer</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath + "</string>"; | ||
106 | capURLS += "<key>NewFileAgentInventory</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory + "</string>"; | ||
107 | //capURLS += "<key>RequestTextureDownload</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + requestTexture + "</string>"; | ||
108 | //capURLS += "<key>EventQueueGet</key><string>http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + eventQueue + "</string>"; | ||
109 | return capURLS;*/ | ||
110 | |||
111 | LLSDCapsDetails caps = new LLSDCapsDetails(); | ||
112 | caps.MapLayer = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + mapLayerPath; | ||
113 | caps.NewFileAgentInventory = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + capsObjectPath + newInventory; | ||
114 | return caps; | ||
115 | } | ||
116 | |||
117 | /// <summary> | ||
118 | /// | ||
119 | /// </summary> | ||
120 | /// <param name="request"></param> | ||
121 | /// <param name="path"></param> | ||
122 | /// <param name="param"></param> | ||
123 | /// <returns></returns> | ||
124 | public string MapLayer(string request, string path, string param) | ||
125 | { | ||
126 | Encoding _enc = System.Text.Encoding.UTF8; | ||
127 | Hashtable hash =(Hashtable) LLSD.LLSDDeserialize(_enc.GetBytes(request)); | ||
128 | LLSDMapRequest mapReq = new LLSDMapRequest(); | ||
129 | LLSDHelpers.DeserialiseLLSDMap(hash, mapReq ); | ||
130 | |||
131 | LLSDMapLayerResponse mapResponse= new LLSDMapLayerResponse(); | ||
132 | mapResponse.LayerData.Array.Add(this.BuildLLSDMapLayerResponse()); | ||
133 | string res = LLSDHelpers.SerialiseLLSDReply(mapResponse); | ||
134 | |||
135 | //Console.WriteLine(" Maplayer response is " + res); | ||
136 | |||
137 | return res; | ||
138 | } | ||
139 | |||
140 | /// <summary> | ||
141 | /// | ||
142 | /// </summary> | ||
143 | /// <returns></returns> | ||
144 | protected LLSDMapLayer BuildLLSDMapLayerResponse() | ||
145 | { | ||
146 | LLSDMapLayer mapLayer = new LLSDMapLayer(); | ||
147 | mapLayer.Right = 5000; | ||
148 | mapLayer.Top = 5000; | ||
149 | mapLayer.ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); | ||
150 | |||
151 | return mapLayer; | ||
152 | } | ||
153 | |||
154 | public string ProcessEventQueue(string request, string path, string param) | ||
155 | { | ||
156 | string res = ""; | ||
157 | |||
158 | if (this.CapsEventQueue.Count > 0) | ||
159 | { | ||
160 | lock (this.CapsEventQueue) | ||
161 | { | ||
162 | string item = CapsEventQueue.Dequeue(); | ||
163 | res = item; | ||
164 | } | ||
165 | } | ||
166 | else | ||
167 | { | ||
168 | res = this.CreateEmptyEventResponse(); | ||
169 | } | ||
170 | return res; | ||
171 | } | ||
172 | |||
173 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) | ||
174 | { | ||
175 | string res = "<llsd><map><key>id</key><integer>" + eventQueueCount + "</integer>"; | ||
176 | res += "<key>events</key><array><map>"; | ||
177 | res += "<key>message</key><string>EstablishAgentCommunication</string>"; | ||
178 | res += "<key>body</key><map>"; | ||
179 | res += "<key>sim-ip-and-port</key><string>" + ipAddressPort + "</string>"; | ||
180 | res += "<key>seed-capability</key><string>" + caps + "</string>"; | ||
181 | res += "<key>agent-id</key><uuid>" + this.agentID.ToStringHyphenated() + "</uuid>"; | ||
182 | res += "</map>"; | ||
183 | res += "</map></array>"; | ||
184 | res += "</map></llsd>"; | ||
185 | eventQueueCount++; | ||
186 | this.CapsEventQueue.Enqueue(res); | ||
187 | return res; | ||
188 | } | ||
189 | |||
190 | public string CreateEmptyEventResponse() | ||
191 | { | ||
192 | string res = "<llsd><map><key>id</key><integer>" + eventQueueCount + "</integer>"; | ||
193 | res += "<key>events</key><array><map>"; | ||
194 | res += "</map></array>"; | ||
195 | res += "</map></llsd>"; | ||
196 | eventQueueCount++; | ||
197 | return res; | ||
198 | } | ||
199 | |||
200 | public string NewAgentInventory(string request, string path, string param) | ||
201 | { | ||
202 | //Console.WriteLine("received upload request:"+ request); | ||
203 | string res = ""; | ||
204 | LLUUID newAsset = LLUUID.Random(); | ||
205 | LLUUID newInvItem = LLUUID.Random(); | ||
206 | string uploaderPath = capsObjectPath + Util.RandomClass.Next(5000, 8000).ToString("0000"); | ||
207 | AssetUploader uploader = new AssetUploader(newAsset, newInvItem, uploaderPath, this.httpListener); | ||
208 | httpListener.AddRestHandler("POST", "/CAPS/" + uploaderPath, uploader.uploaderCaps); | ||
209 | string uploaderURL = "http://" + httpListenerAddress + ":" + httpListenPort.ToString() + "/CAPS/" + uploaderPath; | ||
210 | //Console.WriteLine("uploader url is " + uploaderURL); | ||
211 | res += "<llsd><map>"; | ||
212 | res += "<key>uploader</key><string>" + uploaderURL + "</string>"; | ||
213 | //res += "<key>success</key><boolean>true</boolean>"; | ||
214 | res += "<key>state</key><string>upload</string>"; | ||
215 | res += "</map></llsd>"; | ||
216 | uploader.OnUpLoad += this.UploadHandler; | ||
217 | return res; | ||
218 | } | ||
219 | |||
220 | public void UploadHandler(LLUUID assetID, LLUUID inventoryItem, byte[] data) | ||
221 | { | ||
222 | // Console.WriteLine("upload handler called"); | ||
223 | AssetBase asset; | ||
224 | asset = new AssetBase(); | ||
225 | asset.FullID = assetID; | ||
226 | asset.Type = 0; | ||
227 | asset.InvType = 0; | ||
228 | asset.Name = "UploadedTexture" + Util.RandomClass.Next(1, 1000).ToString("000"); | ||
229 | asset.Data = data; | ||
230 | this.assetCache.AddAsset(asset); | ||
231 | } | ||
232 | |||
233 | public class AssetUploader | ||
234 | { | ||
235 | public event UpLoadedTexture OnUpLoad; | ||
236 | |||
237 | private string uploaderPath = ""; | ||
238 | private LLUUID newAssetID; | ||
239 | private LLUUID inventoryItemID; | ||
240 | private BaseHttpServer httpListener; | ||
241 | public AssetUploader(LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer) | ||
242 | { | ||
243 | newAssetID = assetID; | ||
244 | inventoryItemID = inventoryItem; | ||
245 | uploaderPath = path; | ||
246 | httpListener = httpServer; | ||
247 | |||
248 | } | ||
249 | |||
250 | public string uploaderCaps(string request, string path, string param) | ||
251 | { | ||
252 | Encoding _enc = System.Text.Encoding.UTF8; | ||
253 | byte[] data = _enc.GetBytes(request); | ||
254 | //Console.WriteLine("recieved upload " + Util.FieldToString(data)); | ||
255 | LLUUID inv = this.inventoryItemID; | ||
256 | string res = ""; | ||
257 | res += "<llsd><map>"; | ||
258 | res += "<key>new_asset</key><string>" + newAssetID.ToStringHyphenated() + "</string>"; | ||
259 | res += "<key>new_inventory_item</key><uuid>" + inv.ToStringHyphenated() + "</uuid>"; | ||
260 | res += "<key>state</key><string>complete</string>"; | ||
261 | res += "</map></llsd>"; | ||
262 | |||
263 | // Console.WriteLine("asset " + newAssetID.ToStringHyphenated() + " , inventory item " + inv.ToStringHyphenated()); | ||
264 | httpListener.RemoveRestHandler("POST", "/CAPS/" + uploaderPath); | ||
265 | if (OnUpLoad != null) | ||
266 | { | ||
267 | OnUpLoad(newAssetID, inv, data); | ||
268 | } | ||
269 | |||
270 | /*FileStream fs = File.Create("upload.jp2"); | ||
271 | BinaryWriter bw = new BinaryWriter(fs); | ||
272 | bw.Write(data); | ||
273 | bw.Close(); | ||
274 | fs.Close();*/ | ||
275 | return res; | ||
276 | } | ||
277 | } | ||
278 | } | ||
279 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDArray.cs b/OpenSim/Region/Capabilities/LLSDArray.cs new file mode 100644 index 0000000..76d5a2c --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDArray.cs | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | |||
33 | namespace OpenSim.Region.Capabilities | ||
34 | { | ||
35 | [LLSDType("ARRAY")] | ||
36 | public class LLSDArray | ||
37 | { | ||
38 | public ArrayList Array = new ArrayList(); | ||
39 | |||
40 | public LLSDArray() | ||
41 | { | ||
42 | |||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDCapEvent.cs b/OpenSim/Region/Capabilities/LLSDCapEvent.cs new file mode 100644 index 0000000..d47d25c --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDCapEvent.cs | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Region.Capabilities | ||
33 | { | ||
34 | [LLSDType("MAP")] | ||
35 | public class LLSDCapEvent | ||
36 | { | ||
37 | public int id = 0; | ||
38 | public LLSDArray events = new LLSDArray(); | ||
39 | |||
40 | public LLSDCapEvent() | ||
41 | { | ||
42 | |||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDCapsDetails.cs b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs new file mode 100644 index 0000000..d6db606 --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDCapsDetails.cs | |||
@@ -0,0 +1,19 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Region.Capabilities | ||
6 | { | ||
7 | [LLSDType("MAP")] | ||
8 | public class LLSDCapsDetails | ||
9 | { | ||
10 | public string MapLayer = ""; | ||
11 | public string NewFileAgentInventory = ""; | ||
12 | //public string EventQueueGet = ""; | ||
13 | |||
14 | public LLSDCapsDetails() | ||
15 | { | ||
16 | |||
17 | } | ||
18 | } | ||
19 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDEmpty.cs b/OpenSim/Region/Capabilities/LLSDEmpty.cs new file mode 100644 index 0000000..68f1ce9 --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDEmpty.cs | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Region.Capabilities | ||
33 | { | ||
34 | [LLSDType("MAP")] | ||
35 | public class LLSDEmpty | ||
36 | { | ||
37 | public LLSDEmpty() | ||
38 | { | ||
39 | |||
40 | } | ||
41 | } | ||
42 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDHelpers.cs b/OpenSim/Region/Capabilities/LLSDHelpers.cs new file mode 100644 index 0000000..80916b4 --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDHelpers.cs | |||
@@ -0,0 +1,163 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections; | ||
30 | using System.Collections.Generic; | ||
31 | using System.Text; | ||
32 | using System.IO; | ||
33 | using System.Xml; | ||
34 | using libsecondlife; | ||
35 | |||
36 | namespace OpenSim.Region.Capabilities | ||
37 | { | ||
38 | public class LLSDHelpers | ||
39 | { | ||
40 | public static string SerialiseLLSDReply(object obj) | ||
41 | { | ||
42 | StringWriter sw = new StringWriter(); | ||
43 | XmlTextWriter writer = new XmlTextWriter(sw); | ||
44 | writer.Formatting = Formatting.None; | ||
45 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | ||
46 | LLSDHelpers.SerializeLLSDType(writer, obj); | ||
47 | writer.WriteEndElement(); | ||
48 | writer.Close(); | ||
49 | return sw.ToString(); | ||
50 | } | ||
51 | |||
52 | public static void SerializeLLSDType(XmlTextWriter writer, object obj) | ||
53 | { | ||
54 | Type myType = obj.GetType(); | ||
55 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); | ||
56 | if (llsdattributes.Length > 0) | ||
57 | { | ||
58 | switch (llsdattributes[0].ObjectType) | ||
59 | { | ||
60 | case "MAP": | ||
61 | writer.WriteStartElement(String.Empty, "map", String.Empty); | ||
62 | System.Reflection.FieldInfo[] fields = myType.GetFields(); | ||
63 | for (int i = 0; i < fields.Length; i++) | ||
64 | { | ||
65 | object fieldValue = fields[i].GetValue(obj); | ||
66 | LLSDType[] fieldAttributes = (LLSDType[])fieldValue.GetType().GetCustomAttributes(typeof(LLSDType), false); | ||
67 | if (fieldAttributes.Length > 0) | ||
68 | { | ||
69 | writer.WriteStartElement(String.Empty, "key", String.Empty); | ||
70 | writer.WriteString(fields[i].Name); | ||
71 | writer.WriteEndElement(); | ||
72 | SerializeLLSDType(writer, fieldValue); | ||
73 | } | ||
74 | else | ||
75 | { | ||
76 | //Console.WriteLine("LLSD field name" + fields[i].Name + " , " + fields[i].GetValue(obj).GetType()); | ||
77 | writer.WriteStartElement(String.Empty, "key", String.Empty); | ||
78 | writer.WriteString(fields[i].Name); | ||
79 | writer.WriteEndElement(); | ||
80 | LLSD.LLSDWriteOne(writer, fieldValue); | ||
81 | } | ||
82 | } | ||
83 | writer.WriteEndElement(); | ||
84 | break; | ||
85 | case "ARRAY": | ||
86 | // LLSDArray arrayObject = obj as LLSDArray; | ||
87 | // ArrayList a = arrayObject.Array; | ||
88 | ArrayList a = (ArrayList)obj.GetType().GetField("Array").GetValue(obj); | ||
89 | writer.WriteStartElement(String.Empty, "array", String.Empty); | ||
90 | foreach (object item in a) | ||
91 | { | ||
92 | SerializeLLSDType(writer, item); | ||
93 | } | ||
94 | writer.WriteEndElement(); | ||
95 | break; | ||
96 | } | ||
97 | } | ||
98 | else | ||
99 | { | ||
100 | LLSD.LLSDWriteOne(writer, obj); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | public static object DeserialiseLLSDMap(Hashtable llsd, object obj) | ||
105 | { | ||
106 | Type myType = obj.GetType(); | ||
107 | LLSDType[] llsdattributes = (LLSDType[])myType.GetCustomAttributes(typeof(LLSDType), false); | ||
108 | if (llsdattributes.Length > 0) | ||
109 | { | ||
110 | switch (llsdattributes[0].ObjectType) | ||
111 | { | ||
112 | case "MAP": | ||
113 | IDictionaryEnumerator enumerator = llsd.GetEnumerator(); | ||
114 | while (enumerator.MoveNext()) | ||
115 | { | ||
116 | System.Reflection.FieldInfo field = myType.GetField((string)enumerator.Key); | ||
117 | if (field != null) | ||
118 | { | ||
119 | if (enumerator.Value is Hashtable) | ||
120 | { | ||
121 | object fieldValue = field.GetValue(obj); | ||
122 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); | ||
123 | } | ||
124 | else if (enumerator.Value is ArrayList) | ||
125 | { | ||
126 | object fieldValue = field.GetValue(obj); | ||
127 | fieldValue.GetType().GetField("Array").SetValue(fieldValue, enumerator.Value); | ||
128 | //TODO | ||
129 | // the LLSD map/array types in the array need to be deserialised | ||
130 | // but first we need to know the right class to deserialise them into. | ||
131 | } | ||
132 | else | ||
133 | { | ||
134 | field.SetValue(obj, enumerator.Value); | ||
135 | } | ||
136 | } | ||
137 | } | ||
138 | break; | ||
139 | } | ||
140 | } | ||
141 | return obj; | ||
142 | } | ||
143 | } | ||
144 | |||
145 | |||
146 | |||
147 | |||
148 | |||
149 | |||
150 | |||
151 | |||
152 | |||
153 | |||
154 | |||
155 | |||
156 | |||
157 | |||
158 | |||
159 | |||
160 | |||
161 | |||
162 | |||
163 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDMapLayer.cs b/OpenSim/Region/Capabilities/LLSDMapLayer.cs new file mode 100644 index 0000000..b097ec3 --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDMapLayer.cs | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | using libsecondlife; | ||
33 | |||
34 | namespace OpenSim.Region.Capabilities | ||
35 | { | ||
36 | [LLSDType("MAP")] | ||
37 | public class LLSDMapLayer | ||
38 | { | ||
39 | public int Left = 0; | ||
40 | public int Right = 0; | ||
41 | public int Top = 0; | ||
42 | public int Bottom = 0; | ||
43 | public LLUUID ImageID = LLUUID.Zero; | ||
44 | |||
45 | public LLSDMapLayer() | ||
46 | { | ||
47 | |||
48 | } | ||
49 | } | ||
50 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs new file mode 100644 index 0000000..ee37a5b --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDMapLayerResponse.cs | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Region.Capabilities | ||
33 | { | ||
34 | [LLSDType("MAP")] | ||
35 | public class LLSDMapLayerResponse | ||
36 | { | ||
37 | public LLSDMapRequest AgentData = new LLSDMapRequest(); | ||
38 | public LLSDArray LayerData = new LLSDArray(); | ||
39 | |||
40 | public LLSDMapLayerResponse() | ||
41 | { | ||
42 | |||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDMapRequest.cs b/OpenSim/Region/Capabilities/LLSDMapRequest.cs new file mode 100644 index 0000000..b15f1be --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDMapRequest.cs | |||
@@ -0,0 +1,17 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | |||
5 | namespace OpenSim.Region.Capabilities | ||
6 | { | ||
7 | [LLSDType("MAP")] | ||
8 | public class LLSDMapRequest | ||
9 | { | ||
10 | public int Flags = 0; | ||
11 | |||
12 | public LLSDMapRequest() | ||
13 | { | ||
14 | |||
15 | } | ||
16 | } | ||
17 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDTest.cs b/OpenSim/Region/Capabilities/LLSDTest.cs new file mode 100644 index 0000000..3948f2c --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDTest.cs | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Region.Capabilities | ||
33 | { | ||
34 | [LLSDType("MAP")] | ||
35 | public class LLSDTest | ||
36 | { | ||
37 | public int Test1 = 20; | ||
38 | public int Test2 = 10; | ||
39 | |||
40 | public LLSDTest() | ||
41 | { | ||
42 | |||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDType.cs b/OpenSim/Region/Capabilities/LLSDType.cs new file mode 100644 index 0000000..7da5861 --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDType.cs | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Region.Capabilities | ||
33 | { | ||
34 | [AttributeUsage(AttributeTargets.Class)] | ||
35 | public class LLSDType : Attribute | ||
36 | { | ||
37 | private string myType; | ||
38 | |||
39 | public LLSDType(string type) | ||
40 | { | ||
41 | myType = type; | ||
42 | |||
43 | } | ||
44 | |||
45 | public string ObjectType | ||
46 | { | ||
47 | get | ||
48 | { | ||
49 | return myType; | ||
50 | } | ||
51 | } | ||
52 | } | ||
53 | } | ||
diff --git a/OpenSim/Region/Capabilities/LLSDUploadReply.cs b/OpenSim/Region/Capabilities/LLSDUploadReply.cs new file mode 100644 index 0000000..83cf166 --- /dev/null +++ b/OpenSim/Region/Capabilities/LLSDUploadReply.cs | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
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 | ||
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 | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | using libsecondlife; | ||
33 | namespace OpenSim.Region.Capabilities | ||
34 | { | ||
35 | [LLSDType("MAP")] | ||
36 | public class LLSDUploadReply | ||
37 | { | ||
38 | public string new_asset = ""; | ||
39 | public LLUUID new_inventory_item = LLUUID.Zero; | ||
40 | public string state = ""; | ||
41 | |||
42 | public LLSDUploadReply() | ||
43 | { | ||
44 | |||
45 | } | ||
46 | } | ||
47 | } | ||
diff --git a/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj b/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj new file mode 100644 index 0000000..0d8fac5 --- /dev/null +++ b/OpenSim/Region/Capabilities/OpenSim.Region.Capabilities.csproj | |||
@@ -0,0 +1,151 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <ProjectType>Local</ProjectType> | ||
4 | <ProductVersion>8.0.50727</ProductVersion> | ||
5 | <SchemaVersion>2.0</SchemaVersion> | ||
6 | <ProjectGuid>{39038E85-0000-0000-0000-000000000000}</ProjectGuid> | ||
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
9 | <ApplicationIcon></ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | ||
11 | </AssemblyKeyContainerName> | ||
12 | <AssemblyName>OpenSim.Region.Capabilities</AssemblyName> | ||
13 | <DefaultClientScript>JScript</DefaultClientScript> | ||
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | ||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | ||
16 | <DelaySign>false</DelaySign> | ||
17 | <OutputType>Library</OutputType> | ||
18 | <AppDesignerFolder></AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Region.Capabilities</RootNamespace> | ||
20 | <StartupObject></StartupObject> | ||
21 | <FileUpgradeFlags> | ||
22 | </FileUpgradeFlags> | ||
23 | </PropertyGroup> | ||
24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
25 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
26 | <BaseAddress>285212672</BaseAddress> | ||
27 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
28 | <ConfigurationOverrideFile> | ||
29 | </ConfigurationOverrideFile> | ||
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
31 | <DocumentationFile></DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | ||
33 | <FileAlignment>4096</FileAlignment> | ||
34 | <Optimize>False</Optimize> | ||
35 | <OutputPath>..\..\..\bin\</OutputPath> | ||
36 | <RegisterForComInterop>False</RegisterForComInterop> | ||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
39 | <WarningLevel>4</WarningLevel> | ||
40 | <NoWarn></NoWarn> | ||
41 | </PropertyGroup> | ||
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
44 | <BaseAddress>285212672</BaseAddress> | ||
45 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
46 | <ConfigurationOverrideFile> | ||
47 | </ConfigurationOverrideFile> | ||
48 | <DefineConstants>TRACE</DefineConstants> | ||
49 | <DocumentationFile></DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | ||
51 | <FileAlignment>4096</FileAlignment> | ||
52 | <Optimize>True</Optimize> | ||
53 | <OutputPath>..\..\..\bin\</OutputPath> | ||
54 | <RegisterForComInterop>False</RegisterForComInterop> | ||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
57 | <WarningLevel>4</WarningLevel> | ||
58 | <NoWarn></NoWarn> | ||
59 | </PropertyGroup> | ||
60 | <ItemGroup> | ||
61 | <Reference Include="libsecondlife.dll" > | ||
62 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> | ||
63 | <Private>False</Private> | ||
64 | </Reference> | ||
65 | <Reference Include="OpenSim.Framework.Types" > | ||
66 | <HintPath>OpenSim.Framework.Types.dll</HintPath> | ||
67 | <Private>False</Private> | ||
68 | </Reference> | ||
69 | <Reference Include="OpenSim.Framework.Utilities" > | ||
70 | <HintPath>OpenSim.Framework.Utilities.dll</HintPath> | ||
71 | <Private>False</Private> | ||
72 | </Reference> | ||
73 | <Reference Include="System" > | ||
74 | <HintPath>System.dll</HintPath> | ||
75 | <Private>False</Private> | ||
76 | </Reference> | ||
77 | <Reference Include="System.Xml" > | ||
78 | <HintPath>System.Xml.dll</HintPath> | ||
79 | <Private>False</Private> | ||
80 | </Reference> | ||
81 | <Reference Include="XMLRPC.dll" > | ||
82 | <HintPath>..\..\..\bin\XMLRPC.dll</HintPath> | ||
83 | <Private>False</Private> | ||
84 | </Reference> | ||
85 | </ItemGroup> | ||
86 | <ItemGroup> | ||
87 | <ProjectReference Include="..\..\Framework\General\OpenSim.Framework.csproj"> | ||
88 | <Name>OpenSim.Framework</Name> | ||
89 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | ||
90 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
91 | <Private>False</Private> | ||
92 | </ProjectReference> | ||
93 | <ProjectReference Include="..\..\Framework\Servers\OpenSim.Framework.Servers.csproj"> | ||
94 | <Name>OpenSim.Framework.Servers</Name> | ||
95 | <Project>{2CC71860-0000-0000-0000-000000000000}</Project> | ||
96 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
97 | <Private>False</Private> | ||
98 | </ProjectReference> | ||
99 | <ProjectReference Include="..\Caches\OpenSim.Region.Caches.csproj"> | ||
100 | <Name>OpenSim.Region.Caches</Name> | ||
101 | <Project>{61FCCDB3-0000-0000-0000-000000000000}</Project> | ||
102 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
103 | <Private>False</Private> | ||
104 | </ProjectReference> | ||
105 | </ItemGroup> | ||
106 | <ItemGroup> | ||
107 | <Compile Include="LLSDCapsDetails.cs"> | ||
108 | <SubType>Code</SubType> | ||
109 | </Compile> | ||
110 | <Compile Include="LLSDMapRequest.cs"> | ||
111 | <SubType>Code</SubType> | ||
112 | </Compile> | ||
113 | <Compile Include="LLSDMapLayerResponse.cs"> | ||
114 | <SubType>Code</SubType> | ||
115 | </Compile> | ||
116 | <Compile Include="Caps.cs"> | ||
117 | <SubType>Code</SubType> | ||
118 | </Compile> | ||
119 | <Compile Include="LLSDArray.cs"> | ||
120 | <SubType>Code</SubType> | ||
121 | </Compile> | ||
122 | <Compile Include="LLSDCapEvent.cs"> | ||
123 | <SubType>Code</SubType> | ||
124 | </Compile> | ||
125 | <Compile Include="LLSDEmpty.cs"> | ||
126 | <SubType>Code</SubType> | ||
127 | </Compile> | ||
128 | <Compile Include="LLSDHelpers.cs"> | ||
129 | <SubType>Code</SubType> | ||
130 | </Compile> | ||
131 | <Compile Include="LLSDMapLayer.cs"> | ||
132 | <SubType>Code</SubType> | ||
133 | </Compile> | ||
134 | <Compile Include="LLSDTest.cs"> | ||
135 | <SubType>Code</SubType> | ||
136 | </Compile> | ||
137 | <Compile Include="LLSDType.cs"> | ||
138 | <SubType>Code</SubType> | ||
139 | </Compile> | ||
140 | <Compile Include="LLSDUploadReply.cs"> | ||
141 | <SubType>Code</SubType> | ||
142 | </Compile> | ||
143 | </ItemGroup> | ||
144 | <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
145 | <PropertyGroup> | ||
146 | <PreBuildEvent> | ||
147 | </PreBuildEvent> | ||
148 | <PostBuildEvent> | ||
149 | </PostBuildEvent> | ||
150 | </PropertyGroup> | ||
151 | </Project> | ||