diff options
author | Sean Dague | 2007-07-30 20:11:40 +0000 |
---|---|---|
committer | Sean Dague | 2007-07-30 20:11:40 +0000 |
commit | 74bb5282a09ec095a7ff810c62f79cc64e187686 (patch) | |
tree | e0a9b703bfcbbab59b04351dd71508fa913e741a /OpenSim/Framework | |
parent | added OnDisconnectUser event to required classes (diff) | |
download | opensim-SC_OLD-74bb5282a09ec095a7ff810c62f79cc64e187686.zip opensim-SC_OLD-74bb5282a09ec095a7ff810c62f79cc64e187686.tar.gz opensim-SC_OLD-74bb5282a09ec095a7ff810c62f79cc64e187686.tar.bz2 opensim-SC_OLD-74bb5282a09ec095a7ff810c62f79cc64e187686.tar.xz |
mass update of files to have native line endings
Diffstat (limited to '')
27 files changed, 2148 insertions, 2148 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index 5aacecb..05fa963 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -1,362 +1,362 @@ | |||
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.Framework.Communications.Caches; | 37 | using OpenSim.Framework.Communications.Caches; |
38 | 38 | ||
39 | namespace OpenSim.Region.Capabilities | 39 | namespace OpenSim.Region.Capabilities |
40 | { | 40 | { |
41 | public delegate void UpLoadedTexture(string assetName, LLUUID assetID, LLUUID inventoryItem, byte[] data); | 41 | public delegate void UpLoadedTexture(string assetName, 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 m_notecardUpdatePath = "0004/"; | 52 | private string m_notecardUpdatePath = "0004/"; |
53 | //private string eventQueue = "0100/"; | 53 | //private string eventQueue = "0100/"; |
54 | private BaseHttpServer httpListener; | 54 | private BaseHttpServer httpListener; |
55 | private LLUUID agentID; | 55 | private LLUUID agentID; |
56 | private AssetCache assetCache; | 56 | private AssetCache assetCache; |
57 | private int eventQueueCount = 1; | 57 | private int eventQueueCount = 1; |
58 | private Queue<string> CapsEventQueue = new Queue<string>(); | 58 | private Queue<string> CapsEventQueue = new Queue<string>(); |
59 | 59 | ||
60 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) | 60 | public Caps(AssetCache assetCach, BaseHttpServer httpServer, string httpListen, int httpPort, string capsPath, LLUUID agent) |
61 | { | 61 | { |
62 | assetCache = assetCach; | 62 | assetCache = assetCach; |
63 | m_capsObjectPath = capsPath; | 63 | m_capsObjectPath = capsPath; |
64 | httpListener = httpServer; | 64 | httpListener = httpServer; |
65 | m_httpListenerHostName = httpListen; | 65 | m_httpListenerHostName = httpListen; |
66 | m_httpListenPort = httpPort; | 66 | m_httpListenPort = httpPort; |
67 | agentID = agent; | 67 | agentID = agent; |
68 | } | 68 | } |
69 | 69 | ||
70 | /// <summary> | 70 | /// <summary> |
71 | /// | 71 | /// |
72 | /// </summary> | 72 | /// </summary> |
73 | public void RegisterHandlers() | 73 | public void RegisterHandlers() |
74 | { | 74 | { |
75 | Console.WriteLine("registering CAPS handlers"); | 75 | Console.WriteLine("registering CAPS handlers"); |
76 | string capsBase = "/CAPS/" + m_capsObjectPath; | 76 | string capsBase = "/CAPS/" + m_capsObjectPath; |
77 | 77 | ||
78 | httpListener.AddStreamHandler(new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); | 78 | httpListener.AddStreamHandler(new LLSDStreamhandler<LLSDMapRequest, LLSDMapLayerResponse>("POST", capsBase + m_mapLayerPath, this.GetMapLayer )); |
79 | httpListener.AddStreamHandler( new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", capsBase + m_newInventory, this.NewAgentInventoryRequest)); | 79 | httpListener.AddStreamHandler( new LLSDStreamhandler<LLSDAssetUploadRequest, LLSDAssetUploadResponse>("POST", capsBase + m_newInventory, this.NewAgentInventoryRequest)); |
80 | 80 | ||
81 | AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); | 81 | AddLegacyCapsHandler(httpListener, m_requestPath, CapsRequest); |
82 | AddLegacyCapsHandler(httpListener, m_notecardUpdatePath, NoteCardAgentInventory); | 82 | AddLegacyCapsHandler(httpListener, m_notecardUpdatePath, NoteCardAgentInventory); |
83 | } | 83 | } |
84 | 84 | ||
85 | 85 | ||
86 | //[Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")] | 86 | //[Obsolete("Use BaseHttpServer.AddStreamHandler(new LLSDStreamHandler( LLSDMethod delegate )) instead.")] |
87 | //Commented out the obsolete as at this time the first caps request can not use the new Caps method | 87 | //Commented out the obsolete as at this time the first caps request can not use the new Caps method |
88 | //as the sent type is a array and not a map and the deserialising doesn't deal properly with arrays. | 88 | //as the sent type is a array and not a map and the deserialising doesn't deal properly with arrays. |
89 | private void AddLegacyCapsHandler(BaseHttpServer httpListener, string path, RestMethod restMethod) | 89 | private void AddLegacyCapsHandler(BaseHttpServer httpListener, string path, RestMethod restMethod) |
90 | { | 90 | { |
91 | string capsBase = "/CAPS/" + m_capsObjectPath; | 91 | string capsBase = "/CAPS/" + m_capsObjectPath; |
92 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); | 92 | httpListener.AddStreamHandler(new RestStreamHandler("POST", capsBase + path, restMethod)); |
93 | } | 93 | } |
94 | 94 | ||
95 | /// <summary> | 95 | /// <summary> |
96 | /// | 96 | /// |
97 | /// </summary> | 97 | /// </summary> |
98 | /// <param name="request"></param> | 98 | /// <param name="request"></param> |
99 | /// <param name="path"></param> | 99 | /// <param name="path"></param> |
100 | /// <param name="param"></param> | 100 | /// <param name="param"></param> |
101 | /// <returns></returns> | 101 | /// <returns></returns> |
102 | public string CapsRequest(string request, string path, string param) | 102 | public string CapsRequest(string request, string path, string param) |
103 | { | 103 | { |
104 | //Console.WriteLine("caps request " + request); | 104 | //Console.WriteLine("caps request " + request); |
105 | string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); | 105 | string result = LLSDHelpers.SerialiseLLSDReply(this.GetCapabilities()); |
106 | return result; | 106 | return result; |
107 | } | 107 | } |
108 | 108 | ||
109 | /// <summary> | 109 | /// <summary> |
110 | /// | 110 | /// |
111 | /// </summary> | 111 | /// </summary> |
112 | /// <returns></returns> | 112 | /// <returns></returns> |
113 | protected LLSDCapsDetails GetCapabilities() | 113 | protected LLSDCapsDetails GetCapabilities() |
114 | { | 114 | { |
115 | LLSDCapsDetails caps = new LLSDCapsDetails(); | 115 | LLSDCapsDetails caps = new LLSDCapsDetails(); |
116 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; | 116 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + m_capsObjectPath; |
117 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; | 117 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; |
118 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; | 118 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; |
119 | //caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; | 119 | //caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; |
120 | caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; | 120 | caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; |
121 | return caps; | 121 | return caps; |
122 | } | 122 | } |
123 | 123 | ||
124 | /// <summary> | 124 | /// <summary> |
125 | /// | 125 | /// |
126 | /// </summary> | 126 | /// </summary> |
127 | /// <param name="mapReq"></param> | 127 | /// <param name="mapReq"></param> |
128 | /// <returns></returns> | 128 | /// <returns></returns> |
129 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) | 129 | public LLSDMapLayerResponse GetMapLayer(LLSDMapRequest mapReq) |
130 | { | 130 | { |
131 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); | 131 | LLSDMapLayerResponse mapResponse = new LLSDMapLayerResponse(); |
132 | mapResponse.LayerData.Array.Add(this.GetLLSDMapLayerResponse()); | 132 | mapResponse.LayerData.Array.Add(this.GetLLSDMapLayerResponse()); |
133 | return mapResponse; | 133 | return mapResponse; |
134 | } | 134 | } |
135 | 135 | ||
136 | /// <summary> | 136 | /// <summary> |
137 | /// | 137 | /// |
138 | /// </summary> | 138 | /// </summary> |
139 | /// <returns></returns> | 139 | /// <returns></returns> |
140 | protected LLSDMapLayer GetLLSDMapLayerResponse() | 140 | protected LLSDMapLayer GetLLSDMapLayerResponse() |
141 | { | 141 | { |
142 | LLSDMapLayer mapLayer = new LLSDMapLayer(); | 142 | LLSDMapLayer mapLayer = new LLSDMapLayer(); |
143 | mapLayer.Right = 5000; | 143 | mapLayer.Right = 5000; |
144 | mapLayer.Top = 5000; | 144 | mapLayer.Top = 5000; |
145 | mapLayer.ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); | 145 | mapLayer.ImageID = new LLUUID("00000000-0000-0000-9999-000000000006"); |
146 | return mapLayer; | 146 | return mapLayer; |
147 | } | 147 | } |
148 | 148 | ||
149 | /// <summary> | 149 | /// <summary> |
150 | /// | 150 | /// |
151 | /// </summary> | 151 | /// </summary> |
152 | /// <param name="request"></param> | 152 | /// <param name="request"></param> |
153 | /// <param name="path"></param> | 153 | /// <param name="path"></param> |
154 | /// <param name="param"></param> | 154 | /// <param name="param"></param> |
155 | /// <returns></returns> | 155 | /// <returns></returns> |
156 | public string RequestTexture(string request, string path, string param) | 156 | public string RequestTexture(string request, string path, string param) |
157 | { | 157 | { |
158 | Console.WriteLine("texture request " + request); | 158 | Console.WriteLine("texture request " + request); |
159 | // Needs implementing (added to remove compiler warning) | 159 | // Needs implementing (added to remove compiler warning) |
160 | return ""; | 160 | return ""; |
161 | } | 161 | } |
162 | 162 | ||
163 | #region EventQueue (Currently not enabled) | 163 | #region EventQueue (Currently not enabled) |
164 | /// <summary> | 164 | /// <summary> |
165 | /// | 165 | /// |
166 | /// </summary> | 166 | /// </summary> |
167 | /// <param name="request"></param> | 167 | /// <param name="request"></param> |
168 | /// <param name="path"></param> | 168 | /// <param name="path"></param> |
169 | /// <param name="param"></param> | 169 | /// <param name="param"></param> |
170 | /// <returns></returns> | 170 | /// <returns></returns> |
171 | public string ProcessEventQueue(string request, string path, string param) | 171 | public string ProcessEventQueue(string request, string path, string param) |
172 | { | 172 | { |
173 | string res = ""; | 173 | string res = ""; |
174 | 174 | ||
175 | if (this.CapsEventQueue.Count > 0) | 175 | if (this.CapsEventQueue.Count > 0) |
176 | { | 176 | { |
177 | lock (this.CapsEventQueue) | 177 | lock (this.CapsEventQueue) |
178 | { | 178 | { |
179 | string item = CapsEventQueue.Dequeue(); | 179 | string item = CapsEventQueue.Dequeue(); |
180 | res = item; | 180 | res = item; |
181 | } | 181 | } |
182 | } | 182 | } |
183 | else | 183 | else |
184 | { | 184 | { |
185 | res = this.CreateEmptyEventResponse(); | 185 | res = this.CreateEmptyEventResponse(); |
186 | } | 186 | } |
187 | return res; | 187 | return res; |
188 | } | 188 | } |
189 | 189 | ||
190 | /// <summary> | 190 | /// <summary> |
191 | /// | 191 | /// |
192 | /// </summary> | 192 | /// </summary> |
193 | /// <param name="caps"></param> | 193 | /// <param name="caps"></param> |
194 | /// <param name="ipAddressPort"></param> | 194 | /// <param name="ipAddressPort"></param> |
195 | /// <returns></returns> | 195 | /// <returns></returns> |
196 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) | 196 | public string CreateEstablishAgentComms(string caps, string ipAddressPort) |
197 | { | 197 | { |
198 | LLSDCapEvent eventItem = new LLSDCapEvent(); | 198 | LLSDCapEvent eventItem = new LLSDCapEvent(); |
199 | eventItem.id = eventQueueCount; | 199 | eventItem.id = eventQueueCount; |
200 | //should be creating a EstablishAgentComms item, but there isn't a class for it yet | 200 | //should be creating a EstablishAgentComms item, but there isn't a class for it yet |
201 | eventItem.events.Array.Add(new LLSDEmpty()); | 201 | eventItem.events.Array.Add(new LLSDEmpty()); |
202 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); | 202 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); |
203 | eventQueueCount++; | 203 | eventQueueCount++; |
204 | 204 | ||
205 | this.CapsEventQueue.Enqueue(res); | 205 | this.CapsEventQueue.Enqueue(res); |
206 | return res; | 206 | return res; |
207 | } | 207 | } |
208 | 208 | ||
209 | /// <summary> | 209 | /// <summary> |
210 | /// | 210 | /// |
211 | /// </summary> | 211 | /// </summary> |
212 | /// <returns></returns> | 212 | /// <returns></returns> |
213 | public string CreateEmptyEventResponse() | 213 | public string CreateEmptyEventResponse() |
214 | { | 214 | { |
215 | LLSDCapEvent eventItem = new LLSDCapEvent(); | 215 | LLSDCapEvent eventItem = new LLSDCapEvent(); |
216 | eventItem.id = eventQueueCount; | 216 | eventItem.id = eventQueueCount; |
217 | eventItem.events.Array.Add(new LLSDEmpty()); | 217 | eventItem.events.Array.Add(new LLSDEmpty()); |
218 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); | 218 | string res = LLSDHelpers.SerialiseLLSDReply(eventItem); |
219 | eventQueueCount++; | 219 | eventQueueCount++; |
220 | return res; | 220 | return res; |
221 | } | 221 | } |
222 | #endregion | 222 | #endregion |
223 | 223 | ||
224 | /// <summary> | 224 | /// <summary> |
225 | /// | 225 | /// |
226 | /// </summary> | 226 | /// </summary> |
227 | /// <param name="request"></param> | 227 | /// <param name="request"></param> |
228 | /// <param name="path"></param> | 228 | /// <param name="path"></param> |
229 | /// <param name="param"></param> | 229 | /// <param name="param"></param> |
230 | /// <returns></returns> | 230 | /// <returns></returns> |
231 | public string NoteCardAgentInventory(string request, string path, string param) | 231 | public string NoteCardAgentInventory(string request, string path, string param) |
232 | { | 232 | { |
233 | Console.WriteLine("notecard update request " + request); | 233 | Console.WriteLine("notecard update request " + request); |
234 | string assetName = "notecardupdate"; | 234 | string assetName = "notecardupdate"; |
235 | string capsBase = "/CAPS/" + m_capsObjectPath; | 235 | string capsBase = "/CAPS/" + m_capsObjectPath; |
236 | LLUUID newAsset = LLUUID.Random(); | 236 | LLUUID newAsset = LLUUID.Random(); |
237 | LLUUID newInvItem = LLUUID.Random(); | 237 | LLUUID newInvItem = LLUUID.Random(); |
238 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 238 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
239 | 239 | ||
240 | AssetUploader uploader = new AssetUploader(assetName, newAsset, newInvItem, capsBase + uploaderPath, this.httpListener); | 240 | AssetUploader uploader = new AssetUploader(assetName, newAsset, newInvItem, capsBase + uploaderPath, this.httpListener); |
241 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 241 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
242 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; | 242 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; |
243 | 243 | ||
244 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 244 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
245 | uploadResponse.uploader = uploaderURL; | 245 | uploadResponse.uploader = uploaderURL; |
246 | uploadResponse.state = "upload"; | 246 | uploadResponse.state = "upload"; |
247 | // uploader.OnUpLoad += this.UploadCompleteHandler; | 247 | // uploader.OnUpLoad += this.UploadCompleteHandler; |
248 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); | 248 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); |
249 | } | 249 | } |
250 | 250 | ||
251 | /// <summary> | 251 | /// <summary> |
252 | /// | 252 | /// |
253 | /// </summary> | 253 | /// </summary> |
254 | /// <param name="llsdRequest"></param> | 254 | /// <param name="llsdRequest"></param> |
255 | /// <returns></returns> | 255 | /// <returns></returns> |
256 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) | 256 | public LLSDAssetUploadResponse NewAgentInventoryRequest(LLSDAssetUploadRequest llsdRequest) |
257 | { | 257 | { |
258 | // Console.WriteLine("asset upload request via CAPS"); | 258 | // Console.WriteLine("asset upload request via CAPS"); |
259 | string assetName = llsdRequest.name; | 259 | string assetName = llsdRequest.name; |
260 | string capsBase = "/CAPS/" + m_capsObjectPath; | 260 | string capsBase = "/CAPS/" + m_capsObjectPath; |
261 | LLUUID newAsset = LLUUID.Random(); | 261 | LLUUID newAsset = LLUUID.Random(); |
262 | LLUUID newInvItem = LLUUID.Random(); | 262 | LLUUID newInvItem = LLUUID.Random(); |
263 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 263 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
264 | 264 | ||
265 | AssetUploader uploader = new AssetUploader(assetName, newAsset, newInvItem, capsBase + uploaderPath, this.httpListener); | 265 | AssetUploader uploader = new AssetUploader(assetName, newAsset, newInvItem, capsBase + uploaderPath, this.httpListener); |
266 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 266 | httpListener.AddStreamHandler(new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
267 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; | 267 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + uploaderPath; |
268 | 268 | ||
269 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 269 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
270 | uploadResponse.uploader = uploaderURL; | 270 | uploadResponse.uploader = uploaderURL; |
271 | uploadResponse.state = "upload"; | 271 | uploadResponse.state = "upload"; |
272 | uploader.OnUpLoad += this.UploadCompleteHandler; | 272 | uploader.OnUpLoad += this.UploadCompleteHandler; |
273 | return uploadResponse; | 273 | return uploadResponse; |
274 | } | 274 | } |
275 | 275 | ||
276 | /// <summary> | 276 | /// <summary> |
277 | /// | 277 | /// |
278 | /// </summary> | 278 | /// </summary> |
279 | /// <param name="assetID"></param> | 279 | /// <param name="assetID"></param> |
280 | /// <param name="inventoryItem"></param> | 280 | /// <param name="inventoryItem"></param> |
281 | /// <param name="data"></param> | 281 | /// <param name="data"></param> |
282 | public void UploadCompleteHandler(string assetName, LLUUID assetID, LLUUID inventoryItem, byte[] data) | 282 | public void UploadCompleteHandler(string assetName, LLUUID assetID, LLUUID inventoryItem, byte[] data) |
283 | { | 283 | { |
284 | AssetBase asset; | 284 | AssetBase asset; |
285 | asset = new AssetBase(); | 285 | asset = new AssetBase(); |
286 | asset.FullID = assetID; | 286 | asset.FullID = assetID; |
287 | asset.Type = 0; | 287 | asset.Type = 0; |
288 | asset.InvType = 0; | 288 | asset.InvType = 0; |
289 | asset.Name = assetName; | 289 | asset.Name = assetName; |
290 | asset.Data = data; | 290 | asset.Data = data; |
291 | this.assetCache.AddAsset(asset); | 291 | this.assetCache.AddAsset(asset); |
292 | } | 292 | } |
293 | 293 | ||
294 | public class AssetUploader | 294 | public class AssetUploader |
295 | { | 295 | { |
296 | public event UpLoadedTexture OnUpLoad; | 296 | public event UpLoadedTexture OnUpLoad; |
297 | 297 | ||
298 | private string uploaderPath = ""; | 298 | private string uploaderPath = ""; |
299 | private LLUUID newAssetID; | 299 | private LLUUID newAssetID; |
300 | private LLUUID inventoryItemID; | 300 | private LLUUID inventoryItemID; |
301 | private BaseHttpServer httpListener; | 301 | private BaseHttpServer httpListener; |
302 | private bool SaveImages = false; | 302 | private bool SaveImages = false; |
303 | private string m_assetName = ""; | 303 | private string m_assetName = ""; |
304 | 304 | ||
305 | /// <summary> | 305 | /// <summary> |
306 | /// | 306 | /// |
307 | /// </summary> | 307 | /// </summary> |
308 | /// <param name="assetID"></param> | 308 | /// <param name="assetID"></param> |
309 | /// <param name="inventoryItem"></param> | 309 | /// <param name="inventoryItem"></param> |
310 | /// <param name="path"></param> | 310 | /// <param name="path"></param> |
311 | /// <param name="httpServer"></param> | 311 | /// <param name="httpServer"></param> |
312 | public AssetUploader(string assetName, LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer) | 312 | public AssetUploader(string assetName, LLUUID assetID, LLUUID inventoryItem, string path, BaseHttpServer httpServer) |
313 | { | 313 | { |
314 | m_assetName = assetName; | 314 | m_assetName = assetName; |
315 | newAssetID = assetID; | 315 | newAssetID = assetID; |
316 | inventoryItemID = inventoryItem; | 316 | inventoryItemID = inventoryItem; |
317 | uploaderPath = path; | 317 | uploaderPath = path; |
318 | httpListener = httpServer; | 318 | httpListener = httpServer; |
319 | } | 319 | } |
320 | 320 | ||
321 | /// <summary> | 321 | /// <summary> |
322 | /// | 322 | /// |
323 | /// </summary> | 323 | /// </summary> |
324 | /// <param name="data"></param> | 324 | /// <param name="data"></param> |
325 | /// <param name="path"></param> | 325 | /// <param name="path"></param> |
326 | /// <param name="param"></param> | 326 | /// <param name="param"></param> |
327 | /// <returns></returns> | 327 | /// <returns></returns> |
328 | public string uploaderCaps(byte[] data, string path, string param) | 328 | public string uploaderCaps(byte[] data, string path, string param) |
329 | { | 329 | { |
330 | LLUUID inv = this.inventoryItemID; | 330 | LLUUID inv = this.inventoryItemID; |
331 | string res = ""; | 331 | string res = ""; |
332 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); | 332 | LLSDAssetUploadComplete uploadComplete = new LLSDAssetUploadComplete(); |
333 | uploadComplete.new_asset = newAssetID.ToStringHyphenated(); | 333 | uploadComplete.new_asset = newAssetID.ToStringHyphenated(); |
334 | uploadComplete.new_inventory_item = inv; | 334 | uploadComplete.new_inventory_item = inv; |
335 | uploadComplete.state = "complete"; | 335 | uploadComplete.state = "complete"; |
336 | 336 | ||
337 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); | 337 | res = LLSDHelpers.SerialiseLLSDReply(uploadComplete); |
338 | 338 | ||
339 | httpListener.RemoveStreamHandler("POST", uploaderPath); | 339 | httpListener.RemoveStreamHandler("POST", uploaderPath); |
340 | 340 | ||
341 | if(this.SaveImages) | 341 | if(this.SaveImages) |
342 | this.SaveImageToFile(m_assetName + ".jp2", data); | 342 | this.SaveImageToFile(m_assetName + ".jp2", data); |
343 | 343 | ||
344 | if (OnUpLoad != null) | 344 | if (OnUpLoad != null) |
345 | { | 345 | { |
346 | OnUpLoad(m_assetName, newAssetID, inv, data); | 346 | OnUpLoad(m_assetName, newAssetID, inv, data); |
347 | } | 347 | } |
348 | 348 | ||
349 | return res; | 349 | return res; |
350 | } | 350 | } |
351 | 351 | ||
352 | private void SaveImageToFile(string filename, byte[] data) | 352 | private void SaveImageToFile(string filename, byte[] data) |
353 | { | 353 | { |
354 | FileStream fs = File.Create(filename); | 354 | FileStream fs = File.Create(filename); |
355 | BinaryWriter bw = new BinaryWriter(fs); | 355 | BinaryWriter bw = new BinaryWriter(fs); |
356 | bw.Write(data); | 356 | bw.Write(data); |
357 | bw.Close(); | 357 | bw.Close(); |
358 | fs.Close(); | 358 | fs.Close(); |
359 | } | 359 | } |
360 | } | 360 | } |
361 | } | 361 | } |
362 | } | 362 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs b/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs index e04849f..d3e1979 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs index ce373c0..db9836c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs | |||
@@ -1,45 +1,45 @@ | |||
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 | //public bool success = false; | 38 | //public bool success = false; |
39 | 39 | ||
40 | public LLSDAssetUploadComplete() | 40 | public LLSDAssetUploadComplete() |
41 | { | 41 | { |
42 | 42 | ||
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadRequest.cs b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadRequest.cs index 7ef77cb..0096fb1 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadRequest.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDAssetUploadResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadResponse.cs index 1a620ae..2a2a5d1 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadResponse.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDCapEvent.cs b/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs index 51b4fe0..2c2689b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDCapsDetails.cs b/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs index 3b6a629..cae7e97 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs | |||
@@ -1,18 +1,18 @@ | |||
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 | public string UpdateNotecardAgentInventory = ""; | 11 | public string UpdateNotecardAgentInventory = ""; |
12 | 12 | ||
13 | public LLSDCapsDetails() | 13 | public LLSDCapsDetails() |
14 | { | 14 | { |
15 | 15 | ||
16 | } | 16 | } |
17 | } | 17 | } |
18 | } | 18 | } |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs b/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs index d79c09e..ca27c9d 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index 19ef0c9..efeb9b1 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDMapLayer.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs index 566d0e9..e0c006c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs index ce746ae..8b9837b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDMapRequest.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapRequest.cs index fb739cd..8ac7943 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapRequest.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDMethod.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMethod.cs index 5f42f44..068d539 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMethod.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs index 7d99b6e..d98e23f 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDTest.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs index f23e327..78ccf67 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs +++ b/OpenSim/Framework/Communications/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/Framework/Communications/Capabilities/LLSDType.cs b/OpenSim/Framework/Communications/Capabilities/LLSDType.cs index c58a937..04f4d9a 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs +++ b/OpenSim/Framework/Communications/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 | } |
diff --git a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs index d72c40f..8b74195 100644 --- a/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs +++ b/OpenSim/Framework/Configuration/HTTP/HTTPConfiguration.cs | |||
@@ -1,89 +1,89 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Net; | 3 | using System.Net; |
4 | using System.IO; | 4 | using System.IO; |
5 | using System.Text; | 5 | using System.Text; |
6 | 6 | ||
7 | using OpenSim.Framework.Configuration.Interfaces; | 7 | using OpenSim.Framework.Configuration.Interfaces; |
8 | 8 | ||
9 | namespace OpenSim.Framework.Configuration.HTTP | 9 | namespace OpenSim.Framework.Configuration.HTTP |
10 | { | 10 | { |
11 | public class HTTPConfiguration : IGenericConfig | 11 | public class HTTPConfiguration : IGenericConfig |
12 | { | 12 | { |
13 | RemoteConfigSettings remoteConfigSettings; | 13 | RemoteConfigSettings remoteConfigSettings; |
14 | 14 | ||
15 | XmlConfiguration xmlConfig; | 15 | XmlConfiguration xmlConfig; |
16 | 16 | ||
17 | private string configFileName = ""; | 17 | private string configFileName = ""; |
18 | 18 | ||
19 | public HTTPConfiguration() | 19 | public HTTPConfiguration() |
20 | { | 20 | { |
21 | remoteConfigSettings = new RemoteConfigSettings("remoteconfig.xml"); | 21 | remoteConfigSettings = new RemoteConfigSettings("remoteconfig.xml"); |
22 | xmlConfig = new XmlConfiguration(); | 22 | xmlConfig = new XmlConfiguration(); |
23 | } | 23 | } |
24 | 24 | ||
25 | public void SetFileName(string fileName) | 25 | public void SetFileName(string fileName) |
26 | { | 26 | { |
27 | configFileName = fileName; | 27 | configFileName = fileName; |
28 | } | 28 | } |
29 | 29 | ||
30 | public void LoadData() | 30 | public void LoadData() |
31 | { | 31 | { |
32 | try | 32 | try |
33 | { | 33 | { |
34 | StringBuilder sb = new StringBuilder(); | 34 | StringBuilder sb = new StringBuilder(); |
35 | 35 | ||
36 | byte[] buf = new byte[8192]; | 36 | byte[] buf = new byte[8192]; |
37 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(this.remoteConfigSettings.baseConfigURL + this.configFileName); | 37 | HttpWebRequest request = (HttpWebRequest)WebRequest.Create(this.remoteConfigSettings.baseConfigURL + this.configFileName); |
38 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); | 38 | HttpWebResponse response = (HttpWebResponse)request.GetResponse(); |
39 | 39 | ||
40 | Stream resStream = response.GetResponseStream(); | 40 | Stream resStream = response.GetResponseStream(); |
41 | 41 | ||
42 | string tempString = null; | 42 | string tempString = null; |
43 | int count = 0; | 43 | int count = 0; |
44 | 44 | ||
45 | do | 45 | do |
46 | { | 46 | { |
47 | count = resStream.Read(buf, 0, buf.Length); | 47 | count = resStream.Read(buf, 0, buf.Length); |
48 | if (count != 0) | 48 | if (count != 0) |
49 | { | 49 | { |
50 | tempString = Encoding.ASCII.GetString(buf, 0, count); | 50 | tempString = Encoding.ASCII.GetString(buf, 0, count); |
51 | sb.Append(tempString); | 51 | sb.Append(tempString); |
52 | } | 52 | } |
53 | } | 53 | } |
54 | while (count > 0); | 54 | while (count > 0); |
55 | LoadDataFromString(sb.ToString()); | 55 | LoadDataFromString(sb.ToString()); |
56 | } | 56 | } |
57 | catch (WebException) | 57 | catch (WebException) |
58 | { | 58 | { |
59 | Console.MainLog.Instance.Warn("Unable to connect to remote configuration file (" + remoteConfigSettings.baseConfigURL + configFileName + "). Creating local file instead."); | 59 | Console.MainLog.Instance.Warn("Unable to connect to remote configuration file (" + remoteConfigSettings.baseConfigURL + configFileName + "). Creating local file instead."); |
60 | xmlConfig.SetFileName(configFileName); | 60 | xmlConfig.SetFileName(configFileName); |
61 | xmlConfig.LoadData(); | 61 | xmlConfig.LoadData(); |
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | public void LoadDataFromString(string data) | 65 | public void LoadDataFromString(string data) |
66 | { | 66 | { |
67 | xmlConfig.LoadDataFromString(data); | 67 | xmlConfig.LoadDataFromString(data); |
68 | 68 | ||
69 | } | 69 | } |
70 | 70 | ||
71 | public string GetAttribute(string attributeName) | 71 | public string GetAttribute(string attributeName) |
72 | { | 72 | { |
73 | return xmlConfig.GetAttribute(attributeName); | 73 | return xmlConfig.GetAttribute(attributeName); |
74 | } | 74 | } |
75 | 75 | ||
76 | public bool SetAttribute(string attributeName, string attributeValue) | 76 | public bool SetAttribute(string attributeName, string attributeValue) |
77 | { | 77 | { |
78 | return true; | 78 | return true; |
79 | } | 79 | } |
80 | 80 | ||
81 | public void Commit() | 81 | public void Commit() |
82 | { | 82 | { |
83 | } | 83 | } |
84 | 84 | ||
85 | public void Close() | 85 | public void Close() |
86 | { | 86 | { |
87 | } | 87 | } |
88 | } | 88 | } |
89 | } | 89 | } |
diff --git a/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs b/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs index e3cfac7..77719ee 100644 --- a/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs +++ b/OpenSim/Framework/Configuration/HTTP/RemoteConfigSettings.cs | |||
@@ -1,34 +1,34 @@ | |||
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 | using OpenSim.Framework.Configuration; | 5 | using OpenSim.Framework.Configuration; |
6 | 6 | ||
7 | namespace OpenSim.Framework.Configuration.HTTP | 7 | namespace OpenSim.Framework.Configuration.HTTP |
8 | { | 8 | { |
9 | public class RemoteConfigSettings | 9 | public class RemoteConfigSettings |
10 | { | 10 | { |
11 | private ConfigurationMember configMember; | 11 | private ConfigurationMember configMember; |
12 | 12 | ||
13 | public string baseConfigURL = ""; | 13 | public string baseConfigURL = ""; |
14 | public RemoteConfigSettings(string filename) | 14 | public RemoteConfigSettings(string filename) |
15 | { | 15 | { |
16 | configMember = new ConfigurationMember(filename, "REMOTE CONFIG SETTINGS", loadConfigurationOptions, handleIncomingConfiguration); | 16 | configMember = new ConfigurationMember(filename, "REMOTE CONFIG SETTINGS", loadConfigurationOptions, handleIncomingConfiguration); |
17 | configMember.forceConfigurationPluginLibrary("OpenSim.Framework.Configuration.XML.dll"); | 17 | configMember.forceConfigurationPluginLibrary("OpenSim.Framework.Configuration.XML.dll"); |
18 | configMember.performConfigurationRetrieve(); | 18 | configMember.performConfigurationRetrieve(); |
19 | } | 19 | } |
20 | 20 | ||
21 | public void loadConfigurationOptions() | 21 | public void loadConfigurationOptions() |
22 | { | 22 | { |
23 | configMember.addConfigurationOption("base_config_url", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "URL Containing Configuration Files", "http://localhost/", false); | 23 | configMember.addConfigurationOption("base_config_url", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "URL Containing Configuration Files", "http://localhost/", false); |
24 | } | 24 | } |
25 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 25 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
26 | { | 26 | { |
27 | if (configuration_key == "base_config_url") | 27 | if (configuration_key == "base_config_url") |
28 | { | 28 | { |
29 | baseConfigURL = (string)configuration_result; | 29 | baseConfigURL = (string)configuration_result; |
30 | } | 30 | } |
31 | return true; | 31 | return true; |
32 | } | 32 | } |
33 | } | 33 | } |
34 | } | 34 | } |
diff --git a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs index 5b66035..72faed6 100644 --- a/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs +++ b/OpenSim/Framework/Configuration/XML/XmlConfiguration.cs | |||
@@ -1,133 +1,133 @@ | |||
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.IO; | 29 | using System.IO; |
30 | using System.Xml; | 30 | using System.Xml; |
31 | 31 | ||
32 | using OpenSim.Framework.Interfaces; | 32 | using OpenSim.Framework.Interfaces; |
33 | using OpenSim.Framework.Configuration.Interfaces; | 33 | using OpenSim.Framework.Configuration.Interfaces; |
34 | 34 | ||
35 | namespace OpenSim.Framework.Configuration | 35 | namespace OpenSim.Framework.Configuration |
36 | { | 36 | { |
37 | public class XmlConfiguration : IGenericConfig | 37 | public class XmlConfiguration : IGenericConfig |
38 | { | 38 | { |
39 | private XmlDocument doc; | 39 | private XmlDocument doc; |
40 | private XmlNode rootNode; | 40 | private XmlNode rootNode; |
41 | private XmlNode configNode; | 41 | private XmlNode configNode; |
42 | private string fileName; | 42 | private string fileName; |
43 | private bool createdFile = false; | 43 | private bool createdFile = false; |
44 | 44 | ||
45 | public void SetFileName(string file) | 45 | public void SetFileName(string file) |
46 | { | 46 | { |
47 | fileName = file; | 47 | fileName = file; |
48 | } | 48 | } |
49 | 49 | ||
50 | private void LoadDataToClass() | 50 | private void LoadDataToClass() |
51 | { | 51 | { |
52 | rootNode = doc.FirstChild; | 52 | rootNode = doc.FirstChild; |
53 | if (rootNode.Name != "Root") | 53 | if (rootNode.Name != "Root") |
54 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); | 54 | throw new Exception("Error: Invalid .xml File. Missing <Root>"); |
55 | 55 | ||
56 | configNode = rootNode.FirstChild; | 56 | configNode = rootNode.FirstChild; |
57 | if (configNode.Name != "Config") | 57 | if (configNode.Name != "Config") |
58 | throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>"); | 58 | throw new Exception("Error: Invalid .xml File. <Root> first child should be <Config>"); |
59 | } | 59 | } |
60 | public void LoadData() | 60 | public void LoadData() |
61 | { | 61 | { |
62 | doc = new XmlDocument(); | 62 | doc = new XmlDocument(); |
63 | if (File.Exists(fileName)) | 63 | if (File.Exists(fileName)) |
64 | { | 64 | { |
65 | XmlTextReader reader = new XmlTextReader(fileName); | 65 | XmlTextReader reader = new XmlTextReader(fileName); |
66 | reader.WhitespaceHandling = WhitespaceHandling.None; | 66 | reader.WhitespaceHandling = WhitespaceHandling.None; |
67 | doc.Load(reader); | 67 | doc.Load(reader); |
68 | reader.Close(); | 68 | reader.Close(); |
69 | } | 69 | } |
70 | else | 70 | else |
71 | { | 71 | { |
72 | createdFile = true; | 72 | createdFile = true; |
73 | rootNode = doc.CreateNode(XmlNodeType.Element, "Root", ""); | 73 | rootNode = doc.CreateNode(XmlNodeType.Element, "Root", ""); |
74 | doc.AppendChild(rootNode); | 74 | doc.AppendChild(rootNode); |
75 | configNode = doc.CreateNode(XmlNodeType.Element, "Config", ""); | 75 | configNode = doc.CreateNode(XmlNodeType.Element, "Config", ""); |
76 | rootNode.AppendChild(configNode); | 76 | rootNode.AppendChild(configNode); |
77 | } | 77 | } |
78 | 78 | ||
79 | LoadDataToClass(); | 79 | LoadDataToClass(); |
80 | 80 | ||
81 | if (createdFile) | 81 | if (createdFile) |
82 | { | 82 | { |
83 | this.Commit(); | 83 | this.Commit(); |
84 | } | 84 | } |
85 | } | 85 | } |
86 | 86 | ||
87 | public void LoadDataFromString(string data) | 87 | public void LoadDataFromString(string data) |
88 | { | 88 | { |
89 | doc = new XmlDocument(); | 89 | doc = new XmlDocument(); |
90 | doc.LoadXml(data); | 90 | doc.LoadXml(data); |
91 | 91 | ||
92 | LoadDataToClass(); | 92 | LoadDataToClass(); |
93 | } | 93 | } |
94 | public string GetAttribute(string attributeName) | 94 | public string GetAttribute(string attributeName) |
95 | { | 95 | { |
96 | string result = null; | 96 | string result = null; |
97 | if (configNode.Attributes[attributeName] != null) | 97 | if (configNode.Attributes[attributeName] != null) |
98 | { | 98 | { |
99 | result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value; | 99 | result = ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value; |
100 | } | 100 | } |
101 | return result; | 101 | return result; |
102 | } | 102 | } |
103 | 103 | ||
104 | public bool SetAttribute(string attributeName, string attributeValue) | 104 | public bool SetAttribute(string attributeName, string attributeValue) |
105 | { | 105 | { |
106 | if (configNode.Attributes[attributeName] != null) | 106 | if (configNode.Attributes[attributeName] != null) |
107 | { | 107 | { |
108 | ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; | 108 | ((XmlAttribute)configNode.Attributes.GetNamedItem(attributeName)).Value = attributeValue; |
109 | } | 109 | } |
110 | else | 110 | else |
111 | { | 111 | { |
112 | XmlAttribute attri; | 112 | XmlAttribute attri; |
113 | attri = doc.CreateAttribute(attributeName); | 113 | attri = doc.CreateAttribute(attributeName); |
114 | attri.Value = attributeValue; | 114 | attri.Value = attributeValue; |
115 | configNode.Attributes.Append(attri); | 115 | configNode.Attributes.Append(attri); |
116 | } | 116 | } |
117 | return true; | 117 | return true; |
118 | } | 118 | } |
119 | 119 | ||
120 | public void Commit() | 120 | public void Commit() |
121 | { | 121 | { |
122 | doc.Save(fileName); | 122 | doc.Save(fileName); |
123 | } | 123 | } |
124 | 124 | ||
125 | public void Close() | 125 | public void Close() |
126 | { | 126 | { |
127 | configNode = null; | 127 | configNode = null; |
128 | rootNode = null; | 128 | rootNode = null; |
129 | doc = null; | 129 | doc = null; |
130 | } | 130 | } |
131 | 131 | ||
132 | } | 132 | } |
133 | } | 133 | } |
diff --git a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs index b8dfc0c..eb5465f 100644 --- a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs +++ b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs | |||
@@ -1,379 +1,379 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Reflection; | 2 | using System.Reflection; |
3 | using System.Collections; | 3 | using System.Collections; |
4 | using System.Collections.Generic; | 4 | using System.Collections.Generic; |
5 | using System.Text; | 5 | using System.Text; |
6 | using System.Net; | 6 | using System.Net; |
7 | 7 | ||
8 | using libsecondlife; | 8 | using libsecondlife; |
9 | 9 | ||
10 | using OpenSim.Framework.Console; | 10 | using OpenSim.Framework.Console; |
11 | using OpenSim.Framework.Configuration.Interfaces; | 11 | using OpenSim.Framework.Configuration.Interfaces; |
12 | 12 | ||
13 | namespace OpenSim.Framework.Configuration | 13 | namespace OpenSim.Framework.Configuration |
14 | { | 14 | { |
15 | public class ConfigurationMember | 15 | public class ConfigurationMember |
16 | { | 16 | { |
17 | public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result); | 17 | public delegate bool ConfigurationOptionResult(string configuration_key, object configuration_result); |
18 | public delegate void ConfigurationOptionsLoad(); | 18 | public delegate void ConfigurationOptionsLoad(); |
19 | 19 | ||
20 | private List<ConfigurationOption> configurationOptions = new List<ConfigurationOption>(); | 20 | private List<ConfigurationOption> configurationOptions = new List<ConfigurationOption>(); |
21 | private string configurationFilename = ""; | 21 | private string configurationFilename = ""; |
22 | private string configurationDescription = ""; | 22 | private string configurationDescription = ""; |
23 | 23 | ||
24 | private ConfigurationOptionsLoad loadFunction; | 24 | private ConfigurationOptionsLoad loadFunction; |
25 | private ConfigurationOptionResult resultFunction; | 25 | private ConfigurationOptionResult resultFunction; |
26 | 26 | ||
27 | private IGenericConfig configurationPlugin = null; | 27 | private IGenericConfig configurationPlugin = null; |
28 | /// <summary> | 28 | /// <summary> |
29 | /// This is the default configuration DLL loaded | 29 | /// This is the default configuration DLL loaded |
30 | /// </summary> | 30 | /// </summary> |
31 | private string configurationPluginFilename = "OpenSim.Framework.Configuration.XML.dll"; | 31 | private string configurationPluginFilename = "OpenSim.Framework.Configuration.XML.dll"; |
32 | public ConfigurationMember(string configuration_filename, string configuration_description, ConfigurationOptionsLoad load_function, ConfigurationOptionResult result_function) | 32 | public ConfigurationMember(string configuration_filename, string configuration_description, ConfigurationOptionsLoad load_function, ConfigurationOptionResult result_function) |
33 | { | 33 | { |
34 | this.configurationFilename = configuration_filename; | 34 | this.configurationFilename = configuration_filename; |
35 | this.configurationDescription = configuration_description; | 35 | this.configurationDescription = configuration_description; |
36 | this.loadFunction = load_function; | 36 | this.loadFunction = load_function; |
37 | this.resultFunction = result_function; | 37 | this.resultFunction = result_function; |
38 | } | 38 | } |
39 | 39 | ||
40 | public void setConfigurationFilename(string filename) | 40 | public void setConfigurationFilename(string filename) |
41 | { | 41 | { |
42 | configurationFilename = filename; | 42 | configurationFilename = filename; |
43 | } | 43 | } |
44 | public void setConfigurationDescription(string desc) | 44 | public void setConfigurationDescription(string desc) |
45 | { | 45 | { |
46 | configurationDescription = desc; | 46 | configurationDescription = desc; |
47 | } | 47 | } |
48 | 48 | ||
49 | public void setConfigurationResultFunction(ConfigurationOptionResult result) | 49 | public void setConfigurationResultFunction(ConfigurationOptionResult result) |
50 | { | 50 | { |
51 | resultFunction = result; | 51 | resultFunction = result; |
52 | } | 52 | } |
53 | 53 | ||
54 | public void forceConfigurationPluginLibrary(string dll_filename) | 54 | public void forceConfigurationPluginLibrary(string dll_filename) |
55 | { | 55 | { |
56 | configurationPluginFilename = dll_filename; | 56 | configurationPluginFilename = dll_filename; |
57 | } | 57 | } |
58 | public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt) | 58 | public void addConfigurationOption(string configuration_key, ConfigurationOption.ConfigurationTypes configuration_type, string configuration_question, string configuration_default, bool use_default_no_prompt) |
59 | { | 59 | { |
60 | ConfigurationOption configOption = new ConfigurationOption(); | 60 | ConfigurationOption configOption = new ConfigurationOption(); |
61 | configOption.configurationKey = configuration_key; | 61 | configOption.configurationKey = configuration_key; |
62 | configOption.configurationQuestion = configuration_question; | 62 | configOption.configurationQuestion = configuration_question; |
63 | configOption.configurationDefault = configuration_default; | 63 | configOption.configurationDefault = configuration_default; |
64 | configOption.configurationType = configuration_type; | 64 | configOption.configurationType = configuration_type; |
65 | configOption.configurationUseDefaultNoPrompt = use_default_no_prompt; | 65 | configOption.configurationUseDefaultNoPrompt = use_default_no_prompt; |
66 | 66 | ||
67 | if (configuration_key != "" && configuration_question != "") | 67 | if (configuration_key != "" && configuration_question != "") |
68 | { | 68 | { |
69 | if (!configurationOptions.Contains(configOption)) | 69 | if (!configurationOptions.Contains(configOption)) |
70 | { | 70 | { |
71 | configurationOptions.Add(configOption); | 71 | configurationOptions.Add(configOption); |
72 | } | 72 | } |
73 | } | 73 | } |
74 | else | 74 | else |
75 | { | 75 | { |
76 | MainLog.Instance.Notice("Required fields for adding a configuration option is invalid. Will not add this option (" + configuration_key + ")"); | 76 | MainLog.Instance.Notice("Required fields for adding a configuration option is invalid. Will not add this option (" + configuration_key + ")"); |
77 | } | 77 | } |
78 | } | 78 | } |
79 | 79 | ||
80 | public void performConfigurationRetrieve() | 80 | public void performConfigurationRetrieve() |
81 | { | 81 | { |
82 | configurationPlugin = this.LoadConfigDll(configurationPluginFilename); | 82 | configurationPlugin = this.LoadConfigDll(configurationPluginFilename); |
83 | configurationOptions.Clear(); | 83 | configurationOptions.Clear(); |
84 | if(loadFunction == null) | 84 | if(loadFunction == null) |
85 | { | 85 | { |
86 | MainLog.Instance.Error("Load Function for '" + this.configurationDescription + "' is null. Refusing to run configuration."); | 86 | MainLog.Instance.Error("Load Function for '" + this.configurationDescription + "' is null. Refusing to run configuration."); |
87 | return; | 87 | return; |
88 | } | 88 | } |
89 | 89 | ||
90 | if(resultFunction == null) | 90 | if(resultFunction == null) |
91 | { | 91 | { |
92 | MainLog.Instance.Error("Result Function for '" + this.configurationDescription + "' is null. Refusing to run configuration."); | 92 | MainLog.Instance.Error("Result Function for '" + this.configurationDescription + "' is null. Refusing to run configuration."); |
93 | return; | 93 | return; |
94 | } | 94 | } |
95 | 95 | ||
96 | MainLog.Instance.Verbose("Calling Configuration Load Function..."); | 96 | MainLog.Instance.Verbose("Calling Configuration Load Function..."); |
97 | this.loadFunction(); | 97 | this.loadFunction(); |
98 | 98 | ||
99 | if(configurationOptions.Count <= 0) | 99 | if(configurationOptions.Count <= 0) |
100 | { | 100 | { |
101 | MainLog.Instance.Error("No configuration options were specified for '" + this.configurationOptions + "'. Refusing to continue configuration."); | 101 | MainLog.Instance.Error("No configuration options were specified for '" + this.configurationOptions + "'. Refusing to continue configuration."); |
102 | return; | 102 | return; |
103 | } | 103 | } |
104 | 104 | ||
105 | bool useFile = true; | 105 | bool useFile = true; |
106 | if (configurationPlugin == null) | 106 | if (configurationPlugin == null) |
107 | { | 107 | { |
108 | MainLog.Instance.Error("Configuration Plugin NOT LOADED!"); | 108 | MainLog.Instance.Error("Configuration Plugin NOT LOADED!"); |
109 | return; | 109 | return; |
110 | } | 110 | } |
111 | 111 | ||
112 | if (configurationFilename.Trim() != "") | 112 | if (configurationFilename.Trim() != "") |
113 | { | 113 | { |
114 | configurationPlugin.SetFileName(configurationFilename); | 114 | configurationPlugin.SetFileName(configurationFilename); |
115 | configurationPlugin.LoadData(); | 115 | configurationPlugin.LoadData(); |
116 | useFile = true; | 116 | useFile = true; |
117 | } | 117 | } |
118 | 118 | ||
119 | else | 119 | else |
120 | { | 120 | { |
121 | MainLog.Instance.Notice("XML Configuration Filename is not valid; will not save to the file."); | 121 | MainLog.Instance.Notice("XML Configuration Filename is not valid; will not save to the file."); |
122 | useFile = false; | 122 | useFile = false; |
123 | } | 123 | } |
124 | 124 | ||
125 | foreach (ConfigurationOption configOption in configurationOptions) | 125 | foreach (ConfigurationOption configOption in configurationOptions) |
126 | { | 126 | { |
127 | bool convertSuccess = false; | 127 | bool convertSuccess = false; |
128 | object return_result = null; | 128 | object return_result = null; |
129 | string errorMessage = ""; | 129 | string errorMessage = ""; |
130 | bool ignoreNextFromConfig = false; | 130 | bool ignoreNextFromConfig = false; |
131 | while (convertSuccess == false) | 131 | while (convertSuccess == false) |
132 | { | 132 | { |
133 | 133 | ||
134 | string console_result = ""; | 134 | string console_result = ""; |
135 | string attribute = null; | 135 | string attribute = null; |
136 | if (useFile) | 136 | if (useFile) |
137 | { | 137 | { |
138 | if (!ignoreNextFromConfig) | 138 | if (!ignoreNextFromConfig) |
139 | { | 139 | { |
140 | attribute = configurationPlugin.GetAttribute(configOption.configurationKey); | 140 | attribute = configurationPlugin.GetAttribute(configOption.configurationKey); |
141 | } | 141 | } |
142 | else | 142 | else |
143 | { | 143 | { |
144 | ignoreNextFromConfig = false; | 144 | ignoreNextFromConfig = false; |
145 | } | 145 | } |
146 | } | 146 | } |
147 | 147 | ||
148 | if (attribute == null) | 148 | if (attribute == null) |
149 | { | 149 | { |
150 | if (configOption.configurationUseDefaultNoPrompt) | 150 | if (configOption.configurationUseDefaultNoPrompt) |
151 | { | 151 | { |
152 | console_result = configOption.configurationDefault; | 152 | console_result = configOption.configurationDefault; |
153 | } | 153 | } |
154 | else | 154 | else |
155 | { | 155 | { |
156 | 156 | ||
157 | if (configurationDescription.Trim() != "") | 157 | if (configurationDescription.Trim() != "") |
158 | { | 158 | { |
159 | console_result = MainLog.Instance.CmdPrompt(configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault); | 159 | console_result = MainLog.Instance.CmdPrompt(configurationDescription + ": " + configOption.configurationQuestion, configOption.configurationDefault); |
160 | } | 160 | } |
161 | else | 161 | else |
162 | { | 162 | { |
163 | console_result = MainLog.Instance.CmdPrompt(configOption.configurationQuestion, configOption.configurationDefault); | 163 | console_result = MainLog.Instance.CmdPrompt(configOption.configurationQuestion, configOption.configurationDefault); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | } | 166 | } |
167 | else | 167 | else |
168 | { | 168 | { |
169 | console_result = attribute; | 169 | console_result = attribute; |
170 | } | 170 | } |
171 | 171 | ||
172 | switch (configOption.configurationType) | 172 | switch (configOption.configurationType) |
173 | { | 173 | { |
174 | case ConfigurationOption.ConfigurationTypes.TYPE_STRING: | 174 | case ConfigurationOption.ConfigurationTypes.TYPE_STRING: |
175 | return_result = console_result; | 175 | return_result = console_result; |
176 | convertSuccess = true; | 176 | convertSuccess = true; |
177 | break; | 177 | break; |
178 | case ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY: | 178 | case ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY: |
179 | if (console_result.Length > 0) | 179 | if (console_result.Length > 0) |
180 | { | 180 | { |
181 | return_result = console_result; | 181 | return_result = console_result; |
182 | convertSuccess = true; | 182 | convertSuccess = true; |
183 | } | 183 | } |
184 | errorMessage = "a string that is not empty"; | 184 | errorMessage = "a string that is not empty"; |
185 | break; | 185 | break; |
186 | case ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN: | 186 | case ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN: |
187 | bool boolResult; | 187 | bool boolResult; |
188 | if (Boolean.TryParse(console_result, out boolResult)) | 188 | if (Boolean.TryParse(console_result, out boolResult)) |
189 | { | 189 | { |
190 | convertSuccess = true; | 190 | convertSuccess = true; |
191 | return_result = boolResult; | 191 | return_result = boolResult; |
192 | } | 192 | } |
193 | errorMessage = "'true' or 'false' (Boolean)"; | 193 | errorMessage = "'true' or 'false' (Boolean)"; |
194 | break; | 194 | break; |
195 | case ConfigurationOption.ConfigurationTypes.TYPE_BYTE: | 195 | case ConfigurationOption.ConfigurationTypes.TYPE_BYTE: |
196 | byte byteResult; | 196 | byte byteResult; |
197 | if (Byte.TryParse(console_result, out byteResult)) | 197 | if (Byte.TryParse(console_result, out byteResult)) |
198 | { | 198 | { |
199 | convertSuccess = true; | 199 | convertSuccess = true; |
200 | return_result = byteResult; | 200 | return_result = byteResult; |
201 | } | 201 | } |
202 | errorMessage = "a byte (Byte)"; | 202 | errorMessage = "a byte (Byte)"; |
203 | break; | 203 | break; |
204 | case ConfigurationOption.ConfigurationTypes.TYPE_CHARACTER: | 204 | case ConfigurationOption.ConfigurationTypes.TYPE_CHARACTER: |
205 | char charResult; | 205 | char charResult; |
206 | if (Char.TryParse(console_result, out charResult)) | 206 | if (Char.TryParse(console_result, out charResult)) |
207 | { | 207 | { |
208 | convertSuccess = true; | 208 | convertSuccess = true; |
209 | return_result = charResult; | 209 | return_result = charResult; |
210 | } | 210 | } |
211 | errorMessage = "a character (Char)"; | 211 | errorMessage = "a character (Char)"; |
212 | break; | 212 | break; |
213 | case ConfigurationOption.ConfigurationTypes.TYPE_INT16: | 213 | case ConfigurationOption.ConfigurationTypes.TYPE_INT16: |
214 | short shortResult; | 214 | short shortResult; |
215 | if (Int16.TryParse(console_result, out shortResult)) | 215 | if (Int16.TryParse(console_result, out shortResult)) |
216 | { | 216 | { |
217 | convertSuccess = true; | 217 | convertSuccess = true; |
218 | return_result = shortResult; | 218 | return_result = shortResult; |
219 | } | 219 | } |
220 | errorMessage = "a signed 32 bit integer (short)"; | 220 | errorMessage = "a signed 32 bit integer (short)"; |
221 | break; | 221 | break; |
222 | case ConfigurationOption.ConfigurationTypes.TYPE_INT32: | 222 | case ConfigurationOption.ConfigurationTypes.TYPE_INT32: |
223 | int intResult; | 223 | int intResult; |
224 | if (Int32.TryParse(console_result, out intResult)) | 224 | if (Int32.TryParse(console_result, out intResult)) |
225 | { | 225 | { |
226 | convertSuccess = true; | 226 | convertSuccess = true; |
227 | return_result = intResult; | 227 | return_result = intResult; |
228 | 228 | ||
229 | } | 229 | } |
230 | errorMessage = "a signed 32 bit integer (int)"; | 230 | errorMessage = "a signed 32 bit integer (int)"; |
231 | break; | 231 | break; |
232 | case ConfigurationOption.ConfigurationTypes.TYPE_INT64: | 232 | case ConfigurationOption.ConfigurationTypes.TYPE_INT64: |
233 | long longResult; | 233 | long longResult; |
234 | if (Int64.TryParse(console_result, out longResult)) | 234 | if (Int64.TryParse(console_result, out longResult)) |
235 | { | 235 | { |
236 | convertSuccess = true; | 236 | convertSuccess = true; |
237 | return_result = longResult; | 237 | return_result = longResult; |
238 | } | 238 | } |
239 | errorMessage = "a signed 32 bit integer (long)"; | 239 | errorMessage = "a signed 32 bit integer (long)"; |
240 | break; | 240 | break; |
241 | case ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS: | 241 | case ConfigurationOption.ConfigurationTypes.TYPE_IP_ADDRESS: |
242 | IPAddress ipAddressResult; | 242 | IPAddress ipAddressResult; |
243 | if (IPAddress.TryParse(console_result, out ipAddressResult)) | 243 | if (IPAddress.TryParse(console_result, out ipAddressResult)) |
244 | { | 244 | { |
245 | convertSuccess = true; | 245 | convertSuccess = true; |
246 | return_result = ipAddressResult; | 246 | return_result = ipAddressResult; |
247 | } | 247 | } |
248 | errorMessage = "an IP Address (IPAddress)"; | 248 | errorMessage = "an IP Address (IPAddress)"; |
249 | break; | 249 | break; |
250 | case ConfigurationOption.ConfigurationTypes.TYPE_LLUUID: | 250 | case ConfigurationOption.ConfigurationTypes.TYPE_LLUUID: |
251 | LLUUID uuidResult; | 251 | LLUUID uuidResult; |
252 | if (LLUUID.TryParse(console_result, out uuidResult)) | 252 | if (LLUUID.TryParse(console_result, out uuidResult)) |
253 | { | 253 | { |
254 | convertSuccess = true; | 254 | convertSuccess = true; |
255 | return_result = uuidResult; | 255 | return_result = uuidResult; |
256 | } | 256 | } |
257 | errorMessage = "a UUID (LLUUID)"; | 257 | errorMessage = "a UUID (LLUUID)"; |
258 | break; | 258 | break; |
259 | case ConfigurationOption.ConfigurationTypes.TYPE_LLVECTOR3: | 259 | case ConfigurationOption.ConfigurationTypes.TYPE_LLVECTOR3: |
260 | LLVector3 vectorResult; | 260 | LLVector3 vectorResult; |
261 | if (LLVector3.TryParse(console_result, out vectorResult)) | 261 | if (LLVector3.TryParse(console_result, out vectorResult)) |
262 | { | 262 | { |
263 | convertSuccess = true; | 263 | convertSuccess = true; |
264 | return_result = vectorResult; | 264 | return_result = vectorResult; |
265 | } | 265 | } |
266 | errorMessage = "a vector (LLVector3)"; | 266 | errorMessage = "a vector (LLVector3)"; |
267 | break; | 267 | break; |
268 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT16: | 268 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT16: |
269 | ushort ushortResult; | 269 | ushort ushortResult; |
270 | if (UInt16.TryParse(console_result, out ushortResult)) | 270 | if (UInt16.TryParse(console_result, out ushortResult)) |
271 | { | 271 | { |
272 | convertSuccess = true; | 272 | convertSuccess = true; |
273 | return_result = ushortResult; | 273 | return_result = ushortResult; |
274 | } | 274 | } |
275 | errorMessage = "an unsigned 16 bit integer (ushort)"; | 275 | errorMessage = "an unsigned 16 bit integer (ushort)"; |
276 | break; | 276 | break; |
277 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT32: | 277 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT32: |
278 | uint uintResult; | 278 | uint uintResult; |
279 | if (UInt32.TryParse(console_result, out uintResult)) | 279 | if (UInt32.TryParse(console_result, out uintResult)) |
280 | { | 280 | { |
281 | convertSuccess = true; | 281 | convertSuccess = true; |
282 | return_result = uintResult; | 282 | return_result = uintResult; |
283 | 283 | ||
284 | } | 284 | } |
285 | errorMessage = "an unsigned 32 bit integer (uint)"; | 285 | errorMessage = "an unsigned 32 bit integer (uint)"; |
286 | break; | 286 | break; |
287 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT64: | 287 | case ConfigurationOption.ConfigurationTypes.TYPE_UINT64: |
288 | ulong ulongResult; | 288 | ulong ulongResult; |
289 | if (UInt64.TryParse(console_result, out ulongResult)) | 289 | if (UInt64.TryParse(console_result, out ulongResult)) |
290 | { | 290 | { |
291 | convertSuccess = true; | 291 | convertSuccess = true; |
292 | return_result = ulongResult; | 292 | return_result = ulongResult; |
293 | } | 293 | } |
294 | errorMessage = "an unsigned 64 bit integer (ulong)"; | 294 | errorMessage = "an unsigned 64 bit integer (ulong)"; |
295 | break; | 295 | break; |
296 | case ConfigurationOption.ConfigurationTypes.TYPE_FLOAT: | 296 | case ConfigurationOption.ConfigurationTypes.TYPE_FLOAT: |
297 | float floatResult; | 297 | float floatResult; |
298 | if (float.TryParse(console_result, out floatResult)) | 298 | if (float.TryParse(console_result, out floatResult)) |
299 | { | 299 | { |
300 | convertSuccess = true; | 300 | convertSuccess = true; |
301 | return_result = floatResult; | 301 | return_result = floatResult; |
302 | } | 302 | } |
303 | errorMessage = "a single-precision floating point number (float)"; | 303 | errorMessage = "a single-precision floating point number (float)"; |
304 | break; | 304 | break; |
305 | case ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE: | 305 | case ConfigurationOption.ConfigurationTypes.TYPE_DOUBLE: |
306 | double doubleResult; | 306 | double doubleResult; |
307 | if (Double.TryParse(console_result, out doubleResult)) | 307 | if (Double.TryParse(console_result, out doubleResult)) |
308 | { | 308 | { |
309 | convertSuccess = true; | 309 | convertSuccess = true; |
310 | return_result = doubleResult; | 310 | return_result = doubleResult; |
311 | } | 311 | } |
312 | errorMessage = "an double-precision floating point number (double)"; | 312 | errorMessage = "an double-precision floating point number (double)"; |
313 | break; | 313 | break; |
314 | } | 314 | } |
315 | 315 | ||
316 | if (convertSuccess) | 316 | if (convertSuccess) |
317 | { | 317 | { |
318 | if (useFile) | 318 | if (useFile) |
319 | { | 319 | { |
320 | configurationPlugin.SetAttribute(configOption.configurationKey, console_result); | 320 | configurationPlugin.SetAttribute(configOption.configurationKey, console_result); |
321 | } | 321 | } |
322 | 322 | ||
323 | 323 | ||
324 | if (!this.resultFunction(configOption.configurationKey, return_result)) | 324 | if (!this.resultFunction(configOption.configurationKey, return_result)) |
325 | { | 325 | { |
326 | Console.MainLog.Instance.Notice("The handler for the last configuration option denied that input, please try again."); | 326 | Console.MainLog.Instance.Notice("The handler for the last configuration option denied that input, please try again."); |
327 | convertSuccess = false; | 327 | convertSuccess = false; |
328 | ignoreNextFromConfig = true; | 328 | ignoreNextFromConfig = true; |
329 | } | 329 | } |
330 | } | 330 | } |
331 | else | 331 | else |
332 | { | 332 | { |
333 | if (configOption.configurationUseDefaultNoPrompt) | 333 | if (configOption.configurationUseDefaultNoPrompt) |
334 | { | 334 | { |
335 | MainLog.Instance.Error("Default given for '" + configOption.configurationKey + "' is not valid; the configuration result must be " + errorMessage + ". Will skip this option..."); | 335 | MainLog.Instance.Error("Default given for '" + configOption.configurationKey + "' is not valid; the configuration result must be " + errorMessage + ". Will skip this option..."); |
336 | convertSuccess = true; | 336 | convertSuccess = true; |
337 | } | 337 | } |
338 | else | 338 | else |
339 | { | 339 | { |
340 | MainLog.Instance.Warn("configuration","Incorrect result given, the configuration option must be " + errorMessage + ". Prompting for same option..."); | 340 | MainLog.Instance.Warn("configuration","Incorrect result given, the configuration option must be " + errorMessage + ". Prompting for same option..."); |
341 | ignoreNextFromConfig = true; | 341 | ignoreNextFromConfig = true; |
342 | } | 342 | } |
343 | } | 343 | } |
344 | } | 344 | } |
345 | } | 345 | } |
346 | 346 | ||
347 | if(useFile) | 347 | if(useFile) |
348 | { | 348 | { |
349 | configurationPlugin.Commit(); | 349 | configurationPlugin.Commit(); |
350 | configurationPlugin.Close(); | 350 | configurationPlugin.Close(); |
351 | } | 351 | } |
352 | } | 352 | } |
353 | 353 | ||
354 | private IGenericConfig LoadConfigDll(string dllName) | 354 | private IGenericConfig LoadConfigDll(string dllName) |
355 | { | 355 | { |
356 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); | 356 | Assembly pluginAssembly = Assembly.LoadFrom(dllName); |
357 | IGenericConfig plug = null; | 357 | IGenericConfig plug = null; |
358 | 358 | ||
359 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 359 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
360 | { | 360 | { |
361 | if (pluginType.IsPublic) | 361 | if (pluginType.IsPublic) |
362 | { | 362 | { |
363 | if (!pluginType.IsAbstract) | 363 | if (!pluginType.IsAbstract) |
364 | { | 364 | { |
365 | Type typeInterface = pluginType.GetInterface("IGenericConfig", true); | 365 | Type typeInterface = pluginType.GetInterface("IGenericConfig", true); |
366 | 366 | ||
367 | if (typeInterface != null) | 367 | if (typeInterface != null) |
368 | { | 368 | { |
369 | plug = (IGenericConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 369 | plug = (IGenericConfig)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
370 | } | 370 | } |
371 | } | 371 | } |
372 | } | 372 | } |
373 | } | 373 | } |
374 | 374 | ||
375 | pluginAssembly = null; | 375 | pluginAssembly = null; |
376 | return plug; | 376 | return plug; |
377 | } | 377 | } |
378 | } | 378 | } |
379 | } | 379 | } |
diff --git a/OpenSim/Framework/General/Configuration/ConfigurationOption.cs b/OpenSim/Framework/General/Configuration/ConfigurationOption.cs index 38f60a0..c94ba4c 100644 --- a/OpenSim/Framework/General/Configuration/ConfigurationOption.cs +++ b/OpenSim/Framework/General/Configuration/ConfigurationOption.cs | |||
@@ -1,36 +1,36 @@ | |||
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.Framework.Configuration | 5 | namespace OpenSim.Framework.Configuration |
6 | { | 6 | { |
7 | public class ConfigurationOption | 7 | public class ConfigurationOption |
8 | { | 8 | { |
9 | public enum ConfigurationTypes | 9 | public enum ConfigurationTypes |
10 | { | 10 | { |
11 | TYPE_STRING, | 11 | TYPE_STRING, |
12 | TYPE_STRING_NOT_EMPTY, | 12 | TYPE_STRING_NOT_EMPTY, |
13 | TYPE_UINT16, | 13 | TYPE_UINT16, |
14 | TYPE_UINT32, | 14 | TYPE_UINT32, |
15 | TYPE_UINT64, | 15 | TYPE_UINT64, |
16 | TYPE_INT16, | 16 | TYPE_INT16, |
17 | TYPE_INT32, | 17 | TYPE_INT32, |
18 | TYPE_INT64, | 18 | TYPE_INT64, |
19 | TYPE_IP_ADDRESS, | 19 | TYPE_IP_ADDRESS, |
20 | TYPE_CHARACTER, | 20 | TYPE_CHARACTER, |
21 | TYPE_BOOLEAN, | 21 | TYPE_BOOLEAN, |
22 | TYPE_BYTE, | 22 | TYPE_BYTE, |
23 | TYPE_LLUUID, | 23 | TYPE_LLUUID, |
24 | TYPE_LLVECTOR3, | 24 | TYPE_LLVECTOR3, |
25 | TYPE_FLOAT, | 25 | TYPE_FLOAT, |
26 | TYPE_DOUBLE | 26 | TYPE_DOUBLE |
27 | }; | 27 | }; |
28 | 28 | ||
29 | public string configurationKey = ""; | 29 | public string configurationKey = ""; |
30 | public string configurationQuestion = ""; | 30 | public string configurationQuestion = ""; |
31 | public string configurationDefault = ""; | 31 | public string configurationDefault = ""; |
32 | 32 | ||
33 | public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING; | 33 | public ConfigurationTypes configurationType = ConfigurationTypes.TYPE_STRING; |
34 | public bool configurationUseDefaultNoPrompt = false; | 34 | public bool configurationUseDefaultNoPrompt = false; |
35 | } | 35 | } |
36 | } | 36 | } |
diff --git a/OpenSim/Framework/General/Configuration/GridConfig.cs b/OpenSim/Framework/General/Configuration/GridConfig.cs index 3d07d9b..a81cac2 100644 --- a/OpenSim/Framework/General/Configuration/GridConfig.cs +++ b/OpenSim/Framework/General/Configuration/GridConfig.cs | |||
@@ -1,85 +1,85 @@ | |||
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.Framework.Configuration | 5 | namespace OpenSim.Framework.Configuration |
6 | { | 6 | { |
7 | public class GridConfig | 7 | public class GridConfig |
8 | { | 8 | { |
9 | public string GridOwner = ""; | 9 | public string GridOwner = ""; |
10 | public string DefaultAssetServer = ""; | 10 | public string DefaultAssetServer = ""; |
11 | public string AssetSendKey = ""; | 11 | public string AssetSendKey = ""; |
12 | public string AssetRecvKey = ""; | 12 | public string AssetRecvKey = ""; |
13 | 13 | ||
14 | public string DefaultUserServer = ""; | 14 | public string DefaultUserServer = ""; |
15 | public string UserSendKey = ""; | 15 | public string UserSendKey = ""; |
16 | public string UserRecvKey = ""; | 16 | public string UserRecvKey = ""; |
17 | 17 | ||
18 | public string SimSendKey = ""; | 18 | public string SimSendKey = ""; |
19 | public string SimRecvKey = ""; | 19 | public string SimRecvKey = ""; |
20 | 20 | ||
21 | public string DatabaseProvider = ""; | 21 | public string DatabaseProvider = ""; |
22 | 22 | ||
23 | private ConfigurationMember configMember; | 23 | private ConfigurationMember configMember; |
24 | public GridConfig(string description, string filename) | 24 | public GridConfig(string description, string filename) |
25 | { | 25 | { |
26 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); | 26 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); |
27 | configMember.performConfigurationRetrieve(); | 27 | configMember.performConfigurationRetrieve(); |
28 | } | 28 | } |
29 | 29 | ||
30 | public void loadConfigurationOptions() | 30 | public void loadConfigurationOptions() |
31 | { | 31 | { |
32 | configMember.addConfigurationOption("grid_owner", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "OGS Grid Owner", "OGS development team", false); | 32 | configMember.addConfigurationOption("grid_owner", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "OGS Grid Owner", "OGS development team", false); |
33 | configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", "http://127.0.0.1:8003/", false); | 33 | configMember.addConfigurationOption("default_asset_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Asset Server URI", "http://127.0.0.1:8003/", false); |
34 | configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to asset server", "null", false); | 34 | configMember.addConfigurationOption("asset_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to asset server", "null", false); |
35 | configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from asset server", "null", false); | 35 | configMember.addConfigurationOption("asset_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from asset server", "null", false); |
36 | 36 | ||
37 | configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:8002/", false); | 37 | configMember.addConfigurationOption("default_user_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default User Server URI", "http://127.0.0.1:8002/", false); |
38 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); | 38 | configMember.addConfigurationOption("user_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to user server", "null", false); |
39 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); | 39 | configMember.addConfigurationOption("user_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from user server", "null", false); |
40 | 40 | ||
41 | configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to a simulator", "null", false); | 41 | configMember.addConfigurationOption("sim_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to a simulator", "null", false); |
42 | configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from a simulator", "null", false); | 42 | configMember.addConfigurationOption("sim_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from a simulator", "null", false); |
43 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | 43 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); |
44 | } | 44 | } |
45 | 45 | ||
46 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 46 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
47 | { | 47 | { |
48 | switch (configuration_key) | 48 | switch (configuration_key) |
49 | { | 49 | { |
50 | case "grid_owner": | 50 | case "grid_owner": |
51 | this.GridOwner = (string)configuration_result; | 51 | this.GridOwner = (string)configuration_result; |
52 | break; | 52 | break; |
53 | case "default_asset_server": | 53 | case "default_asset_server": |
54 | this.DefaultAssetServer = (string)configuration_result; | 54 | this.DefaultAssetServer = (string)configuration_result; |
55 | break; | 55 | break; |
56 | case "asset_send_key": | 56 | case "asset_send_key": |
57 | this.AssetSendKey = (string)configuration_result; | 57 | this.AssetSendKey = (string)configuration_result; |
58 | break; | 58 | break; |
59 | case "asset_recv_key": | 59 | case "asset_recv_key": |
60 | this.AssetRecvKey = (string)configuration_result; | 60 | this.AssetRecvKey = (string)configuration_result; |
61 | break; | 61 | break; |
62 | case "default_user_server": | 62 | case "default_user_server": |
63 | this.DefaultUserServer = (string)configuration_result; | 63 | this.DefaultUserServer = (string)configuration_result; |
64 | break; | 64 | break; |
65 | case "user_send_key": | 65 | case "user_send_key": |
66 | this.UserSendKey = (string)configuration_result; | 66 | this.UserSendKey = (string)configuration_result; |
67 | break; | 67 | break; |
68 | case "user_recv_key": | 68 | case "user_recv_key": |
69 | this.UserRecvKey = (string)configuration_result; | 69 | this.UserRecvKey = (string)configuration_result; |
70 | break; | 70 | break; |
71 | case "sim_send_key": | 71 | case "sim_send_key": |
72 | this.SimSendKey = (string)configuration_result; | 72 | this.SimSendKey = (string)configuration_result; |
73 | break; | 73 | break; |
74 | case "sim_recv_key": | 74 | case "sim_recv_key": |
75 | this.SimRecvKey = (string)configuration_result; | 75 | this.SimRecvKey = (string)configuration_result; |
76 | break; | 76 | break; |
77 | case "database_provider": | 77 | case "database_provider": |
78 | this.DatabaseProvider = (string)configuration_result; | 78 | this.DatabaseProvider = (string)configuration_result; |
79 | break; | 79 | break; |
80 | } | 80 | } |
81 | 81 | ||
82 | return true; | 82 | return true; |
83 | } | 83 | } |
84 | } | 84 | } |
85 | } | 85 | } |
diff --git a/OpenSim/Framework/General/Configuration/Interfaces/IGenericConfig.cs b/OpenSim/Framework/General/Configuration/Interfaces/IGenericConfig.cs index ceccd04..0222745 100644 --- a/OpenSim/Framework/General/Configuration/Interfaces/IGenericConfig.cs +++ b/OpenSim/Framework/General/Configuration/Interfaces/IGenericConfig.cs | |||
@@ -1,40 +1,40 @@ | |||
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.Framework.Configuration.Interfaces | 28 | namespace OpenSim.Framework.Configuration.Interfaces |
29 | { | 29 | { |
30 | public interface IGenericConfig | 30 | public interface IGenericConfig |
31 | { | 31 | { |
32 | void SetFileName(string fileName); | 32 | void SetFileName(string fileName); |
33 | void LoadData(); | 33 | void LoadData(); |
34 | void LoadDataFromString(string data); | 34 | void LoadDataFromString(string data); |
35 | string GetAttribute(string attributeName); | 35 | string GetAttribute(string attributeName); |
36 | bool SetAttribute(string attributeName, string attributeValue); | 36 | bool SetAttribute(string attributeName, string attributeValue); |
37 | void Commit(); | 37 | void Commit(); |
38 | void Close(); | 38 | void Close(); |
39 | } | 39 | } |
40 | } | 40 | } |
diff --git a/OpenSim/Framework/General/Configuration/UserConfig.cs b/OpenSim/Framework/General/Configuration/UserConfig.cs index 2183491..177506f 100644 --- a/OpenSim/Framework/General/Configuration/UserConfig.cs +++ b/OpenSim/Framework/General/Configuration/UserConfig.cs | |||
@@ -1,62 +1,62 @@ | |||
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.Framework.Configuration | 5 | namespace OpenSim.Framework.Configuration |
6 | { | 6 | { |
7 | /// <summary> | 7 | /// <summary> |
8 | /// UserConfig -- For User Server Configuration | 8 | /// UserConfig -- For User Server Configuration |
9 | /// </summary> | 9 | /// </summary> |
10 | public class UserConfig | 10 | public class UserConfig |
11 | { | 11 | { |
12 | public string DefaultStartupMsg = ""; | 12 | public string DefaultStartupMsg = ""; |
13 | public string GridServerURL = ""; | 13 | public string GridServerURL = ""; |
14 | public string GridSendKey = ""; | 14 | public string GridSendKey = ""; |
15 | public string GridRecvKey = ""; | 15 | public string GridRecvKey = ""; |
16 | 16 | ||
17 | public string DatabaseProvider = ""; | 17 | public string DatabaseProvider = ""; |
18 | 18 | ||
19 | private ConfigurationMember configMember; | 19 | private ConfigurationMember configMember; |
20 | 20 | ||
21 | public UserConfig(string description, string filename) | 21 | public UserConfig(string description, string filename) |
22 | { | 22 | { |
23 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); | 23 | configMember = new ConfigurationMember(filename, description, this.loadConfigurationOptions, this.handleIncomingConfiguration); |
24 | configMember.performConfigurationRetrieve(); | 24 | configMember.performConfigurationRetrieve(); |
25 | } | 25 | } |
26 | 26 | ||
27 | public void loadConfigurationOptions() | 27 | public void loadConfigurationOptions() |
28 | { | 28 | { |
29 | configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS",false); | 29 | configMember.addConfigurationOption("default_startup_message", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Startup Message", "Welcome to OGS",false); |
30 | 30 | ||
31 | configMember.addConfigurationOption("default_grid_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Grid Server URI", "http://127.0.0.1:8001/", false); | 31 | configMember.addConfigurationOption("default_grid_server", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Default Grid Server URI", "http://127.0.0.1:8001/", false); |
32 | configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null", false); | 32 | configMember.addConfigurationOption("grid_send_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to send to grid server", "null", false); |
33 | configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null", false); | 33 | configMember.addConfigurationOption("grid_recv_key", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Key to expect from grid server", "null", false); |
34 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); | 34 | configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Framework.Data.MySQL.dll", false); |
35 | 35 | ||
36 | } | 36 | } |
37 | 37 | ||
38 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) | 38 | public bool handleIncomingConfiguration(string configuration_key, object configuration_result) |
39 | { | 39 | { |
40 | switch (configuration_key) | 40 | switch (configuration_key) |
41 | { | 41 | { |
42 | case "default_startup_message": | 42 | case "default_startup_message": |
43 | this.DefaultStartupMsg = (string)configuration_result; | 43 | this.DefaultStartupMsg = (string)configuration_result; |
44 | break; | 44 | break; |
45 | case "default_grid_server": | 45 | case "default_grid_server": |
46 | this.GridServerURL = (string)configuration_result; | 46 | this.GridServerURL = (string)configuration_result; |
47 | break; | 47 | break; |
48 | case "grid_send_key": | 48 | case "grid_send_key": |
49 | this.GridSendKey = (string)configuration_result; | 49 | this.GridSendKey = (string)configuration_result; |
50 | break; | 50 | break; |
51 | case "grid_recv_key": | 51 | case "grid_recv_key": |
52 | this.GridRecvKey = (string)configuration_result; | 52 | this.GridRecvKey = (string)configuration_result; |
53 | break; | 53 | break; |
54 | case "database_provider": | 54 | case "database_provider": |
55 | this.DatabaseProvider = (string)configuration_result; | 55 | this.DatabaseProvider = (string)configuration_result; |
56 | break; | 56 | break; |
57 | } | 57 | } |
58 | 58 | ||
59 | return true; | 59 | return true; |
60 | } | 60 | } |
61 | } | 61 | } |
62 | } | 62 | } |
diff --git a/OpenSim/Framework/General/Types/LandData.cs b/OpenSim/Framework/General/Types/LandData.cs index 2ae4927..26cb8d5 100644 --- a/OpenSim/Framework/General/Types/LandData.cs +++ b/OpenSim/Framework/General/Types/LandData.cs | |||
@@ -1,120 +1,120 @@ | |||
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.Framework.Types | 30 | namespace OpenSim.Framework.Types |
31 | { | 31 | { |
32 | 32 | ||
33 | public class LandData | 33 | public class LandData |
34 | { | 34 | { |
35 | public byte[] landBitmapByteArray = new byte[512]; | 35 | public byte[] landBitmapByteArray = new byte[512]; |
36 | public string landName = "Your Parcel"; | 36 | public string landName = "Your Parcel"; |
37 | public string landDesc = ""; | 37 | public string landDesc = ""; |
38 | public LLUUID ownerID = new LLUUID(); | 38 | public LLUUID ownerID = new LLUUID(); |
39 | public bool isGroupOwned = false; | 39 | public bool isGroupOwned = false; |
40 | public LLVector3 AABBMin = new LLVector3(); | 40 | public LLVector3 AABBMin = new LLVector3(); |
41 | public LLVector3 AABBMax = new LLVector3(); | 41 | public LLVector3 AABBMax = new LLVector3(); |
42 | public int area = 0; | 42 | public int area = 0; |
43 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned | 43 | public uint auctionID = 0; //Unemplemented. If set to 0, not being auctioned |
44 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID | 44 | public LLUUID authBuyerID = new LLUUID(); //Unemplemented. Authorized Buyer's UUID |
45 | public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category | 45 | public Parcel.ParcelCategory category = new Parcel.ParcelCategory(); //Unemplemented. Parcel's chosen category |
46 | public int claimDate = 0; //Unemplemented | 46 | public int claimDate = 0; //Unemplemented |
47 | public int claimPrice = 0; //Unemplemented | 47 | public int claimPrice = 0; //Unemplemented |
48 | public LLUUID groupID = new LLUUID(); //Unemplemented | 48 | public LLUUID groupID = new LLUUID(); //Unemplemented |
49 | public int groupPrims = 0; | 49 | public int groupPrims = 0; |
50 | public int otherPrims = 0; | 50 | public int otherPrims = 0; |
51 | public int ownerPrims = 0; | 51 | public int ownerPrims = 0; |
52 | public int selectedPrims = 0; | 52 | public int selectedPrims = 0; |
53 | public int simwidePrims = 0; | 53 | public int simwidePrims = 0; |
54 | public int simwideArea = 0; | 54 | public int simwideArea = 0; |
55 | public int salePrice = 0; //Unemeplemented. Parcels price. | 55 | public int salePrice = 0; //Unemeplemented. Parcels price. |
56 | public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased; | 56 | public Parcel.ParcelStatus landStatus = Parcel.ParcelStatus.Leased; |
57 | public uint landFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts; | 57 | public uint landFlags = (uint)Parcel.ParcelFlags.AllowFly | (uint)Parcel.ParcelFlags.AllowLandmark | (uint)Parcel.ParcelFlags.AllowAllObjectEntry | (uint)Parcel.ParcelFlags.AllowDeedToGroup | (uint)Parcel.ParcelFlags.AllowTerraform | (uint)Parcel.ParcelFlags.CreateObjects | (uint)Parcel.ParcelFlags.AllowOtherScripts; |
58 | public byte landingType = 0; | 58 | public byte landingType = 0; |
59 | public byte mediaAutoScale = 0; | 59 | public byte mediaAutoScale = 0; |
60 | public LLUUID mediaID = LLUUID.Zero; | 60 | public LLUUID mediaID = LLUUID.Zero; |
61 | public int localID = 0; | 61 | public int localID = 0; |
62 | public LLUUID globalID = new LLUUID(); | 62 | public LLUUID globalID = new LLUUID(); |
63 | 63 | ||
64 | public string mediaURL = ""; | 64 | public string mediaURL = ""; |
65 | public string musicURL = ""; | 65 | public string musicURL = ""; |
66 | public float passHours = 0; | 66 | public float passHours = 0; |
67 | public int passPrice = 0; | 67 | public int passPrice = 0; |
68 | public LLUUID snapshotID = LLUUID.Zero; | 68 | public LLUUID snapshotID = LLUUID.Zero; |
69 | public LLVector3 userLocation = new LLVector3(); | 69 | public LLVector3 userLocation = new LLVector3(); |
70 | public LLVector3 userLookAt = new LLVector3(); | 70 | public LLVector3 userLookAt = new LLVector3(); |
71 | 71 | ||
72 | public LandData() | 72 | public LandData() |
73 | { | 73 | { |
74 | globalID = LLUUID.Random(); | 74 | globalID = LLUUID.Random(); |
75 | } | 75 | } |
76 | 76 | ||
77 | public LandData Copy() | 77 | public LandData Copy() |
78 | { | 78 | { |
79 | LandData landData = new LandData(); | 79 | LandData landData = new LandData(); |
80 | 80 | ||
81 | landData.AABBMax = this.AABBMax; | 81 | landData.AABBMax = this.AABBMax; |
82 | landData.AABBMin = this.AABBMin; | 82 | landData.AABBMin = this.AABBMin; |
83 | landData.area = this.area; | 83 | landData.area = this.area; |
84 | landData.auctionID = this.auctionID; | 84 | landData.auctionID = this.auctionID; |
85 | landData.authBuyerID = this.authBuyerID; | 85 | landData.authBuyerID = this.authBuyerID; |
86 | landData.category = this.category; | 86 | landData.category = this.category; |
87 | landData.claimDate = this.claimDate; | 87 | landData.claimDate = this.claimDate; |
88 | landData.claimPrice = this.claimPrice; | 88 | landData.claimPrice = this.claimPrice; |
89 | landData.globalID = this.globalID; | 89 | landData.globalID = this.globalID; |
90 | landData.groupID = this.groupID; | 90 | landData.groupID = this.groupID; |
91 | landData.groupPrims = this.groupPrims; | 91 | landData.groupPrims = this.groupPrims; |
92 | landData.otherPrims = this.otherPrims; | 92 | landData.otherPrims = this.otherPrims; |
93 | landData.ownerPrims = this.ownerPrims; | 93 | landData.ownerPrims = this.ownerPrims; |
94 | landData.selectedPrims = this.selectedPrims; | 94 | landData.selectedPrims = this.selectedPrims; |
95 | landData.isGroupOwned = this.isGroupOwned; | 95 | landData.isGroupOwned = this.isGroupOwned; |
96 | landData.localID = this.localID; | 96 | landData.localID = this.localID; |
97 | landData.landingType = this.landingType; | 97 | landData.landingType = this.landingType; |
98 | landData.mediaAutoScale = this.mediaAutoScale; | 98 | landData.mediaAutoScale = this.mediaAutoScale; |
99 | landData.mediaID = this.mediaID; | 99 | landData.mediaID = this.mediaID; |
100 | landData.mediaURL = this.mediaURL; | 100 | landData.mediaURL = this.mediaURL; |
101 | landData.musicURL = this.musicURL; | 101 | landData.musicURL = this.musicURL; |
102 | landData.ownerID = this.ownerID; | 102 | landData.ownerID = this.ownerID; |
103 | landData.landBitmapByteArray = (byte[])this.landBitmapByteArray.Clone(); | 103 | landData.landBitmapByteArray = (byte[])this.landBitmapByteArray.Clone(); |
104 | landData.landDesc = this.landDesc; | 104 | landData.landDesc = this.landDesc; |
105 | landData.landFlags = this.landFlags; | 105 | landData.landFlags = this.landFlags; |
106 | landData.landName = this.landName; | 106 | landData.landName = this.landName; |
107 | landData.landStatus = this.landStatus; | 107 | landData.landStatus = this.landStatus; |
108 | landData.passHours = this.passHours; | 108 | landData.passHours = this.passHours; |
109 | landData.passPrice = this.passPrice; | 109 | landData.passPrice = this.passPrice; |
110 | landData.salePrice = this.salePrice; | 110 | landData.salePrice = this.salePrice; |
111 | landData.snapshotID = this.snapshotID; | 111 | landData.snapshotID = this.snapshotID; |
112 | landData.userLocation = this.userLocation; | 112 | landData.userLocation = this.userLocation; |
113 | landData.userLookAt = this.userLookAt; | 113 | landData.userLookAt = this.userLookAt; |
114 | 114 | ||
115 | return landData; | 115 | return landData; |
116 | 116 | ||
117 | } | 117 | } |
118 | } | 118 | } |
119 | 119 | ||
120 | } | 120 | } |
diff --git a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs index 49e2e6f..9f681c2 100644 --- a/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs +++ b/OpenSim/Framework/InventoryServiceBase/InventoryServiceBase.cs | |||
@@ -1,136 +1,136 @@ | |||
1 | using System; | 1 | using System; |
2 | using System.Collections.Generic; | 2 | using System.Collections.Generic; |
3 | using System.Reflection; | 3 | using System.Reflection; |
4 | using System.Text; | 4 | using System.Text; |
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using OpenSim.Framework.Console; | 6 | using OpenSim.Framework.Console; |
7 | using OpenSim.Framework.Interfaces; | 7 | using OpenSim.Framework.Interfaces; |
8 | using OpenSim.Framework.Data; | 8 | using OpenSim.Framework.Data; |
9 | 9 | ||
10 | namespace OpenSim.Framework.InventoryServiceBase | 10 | namespace OpenSim.Framework.InventoryServiceBase |
11 | { | 11 | { |
12 | public class InventoryServiceBase | 12 | public class InventoryServiceBase |
13 | { | 13 | { |
14 | protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); | 14 | protected Dictionary<string, IInventoryData> m_plugins = new Dictionary<string, IInventoryData>(); |
15 | protected IAssetServer m_assetServer; | 15 | protected IAssetServer m_assetServer; |
16 | 16 | ||
17 | public InventoryServiceBase(IAssetServer assetServer) | 17 | public InventoryServiceBase(IAssetServer assetServer) |
18 | { | 18 | { |
19 | m_assetServer = assetServer; | 19 | m_assetServer = assetServer; |
20 | } | 20 | } |
21 | 21 | ||
22 | /// <summary> | 22 | /// <summary> |
23 | /// Adds a new user server plugin - plugins will be requested in the order they were loaded. | 23 | /// Adds a new user server plugin - plugins will be requested in the order they were loaded. |
24 | /// </summary> | 24 | /// </summary> |
25 | /// <param name="FileName">The filename to the user server plugin DLL</param> | 25 | /// <param name="FileName">The filename to the user server plugin DLL</param> |
26 | public void AddPlugin(string FileName) | 26 | public void AddPlugin(string FileName) |
27 | { | 27 | { |
28 | MainLog.Instance.Verbose("Inventorytorage: Attempting to load " + FileName); | 28 | MainLog.Instance.Verbose("Inventorytorage: Attempting to load " + FileName); |
29 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); | 29 | Assembly pluginAssembly = Assembly.LoadFrom(FileName); |
30 | 30 | ||
31 | foreach (Type pluginType in pluginAssembly.GetTypes()) | 31 | foreach (Type pluginType in pluginAssembly.GetTypes()) |
32 | { | 32 | { |
33 | if (!pluginType.IsAbstract) | 33 | if (!pluginType.IsAbstract) |
34 | { | 34 | { |
35 | Type typeInterface = pluginType.GetInterface("IInventoryData", true); | 35 | Type typeInterface = pluginType.GetInterface("IInventoryData", true); |
36 | 36 | ||
37 | if (typeInterface != null) | 37 | if (typeInterface != null) |
38 | { | 38 | { |
39 | IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); | 39 | IInventoryData plug = (IInventoryData)Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); |
40 | plug.Initialise(); | 40 | plug.Initialise(); |
41 | this.m_plugins.Add(plug.getName(), plug); | 41 | this.m_plugins.Add(plug.getName(), plug); |
42 | MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface"); | 42 | MainLog.Instance.Verbose("Inventorystorage: Added IInventoryData Interface"); |
43 | } | 43 | } |
44 | 44 | ||
45 | typeInterface = null; | 45 | typeInterface = null; |
46 | } | 46 | } |
47 | } | 47 | } |
48 | 48 | ||
49 | pluginAssembly = null; | 49 | pluginAssembly = null; |
50 | } | 50 | } |
51 | 51 | ||
52 | /// <summary> | 52 | /// <summary> |
53 | /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) | 53 | /// Returns the root folder plus any folders in root (so down one level in the Inventory folders tree) |
54 | /// </summary> | 54 | /// </summary> |
55 | /// <param name="userID"></param> | 55 | /// <param name="userID"></param> |
56 | /// <returns></returns> | 56 | /// <returns></returns> |
57 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) | 57 | public List<InventoryFolderBase> RequestFirstLevelFolders(LLUUID userID) |
58 | { | 58 | { |
59 | List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); | 59 | List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); |
60 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 60 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
61 | { | 61 | { |
62 | InventoryFolderBase rootFolder = plugin.Value.getUserRootFolder(userID); | 62 | InventoryFolderBase rootFolder = plugin.Value.getUserRootFolder(userID); |
63 | if (rootFolder != null) | 63 | if (rootFolder != null) |
64 | { | 64 | { |
65 | inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); | 65 | inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); |
66 | inventoryList.Insert(0, rootFolder); | 66 | inventoryList.Insert(0, rootFolder); |
67 | return inventoryList; | 67 | return inventoryList; |
68 | } | 68 | } |
69 | } | 69 | } |
70 | return inventoryList; | 70 | return inventoryList; |
71 | } | 71 | } |
72 | 72 | ||
73 | /// <summary> | 73 | /// <summary> |
74 | /// | 74 | /// |
75 | /// </summary> | 75 | /// </summary> |
76 | public InventoryFolderBase RequestUsersRoot(LLUUID userID) | 76 | public InventoryFolderBase RequestUsersRoot(LLUUID userID) |
77 | { | 77 | { |
78 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 78 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
79 | { | 79 | { |
80 | return plugin.Value.getUserRootFolder(userID); | 80 | return plugin.Value.getUserRootFolder(userID); |
81 | } | 81 | } |
82 | return null; | 82 | return null; |
83 | } | 83 | } |
84 | 84 | ||
85 | /// <summary> | 85 | /// <summary> |
86 | /// | 86 | /// |
87 | /// </summary> | 87 | /// </summary> |
88 | /// <param name="parentFolderID"></param> | 88 | /// <param name="parentFolderID"></param> |
89 | /// <returns></returns> | 89 | /// <returns></returns> |
90 | public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID) | 90 | public List<InventoryFolderBase> RequestSubFolders(LLUUID parentFolderID) |
91 | { | 91 | { |
92 | List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); | 92 | List<InventoryFolderBase> inventoryList = new List<InventoryFolderBase>(); |
93 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 93 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
94 | { | 94 | { |
95 | return plugin.Value.getInventoryFolders(parentFolderID); | 95 | return plugin.Value.getInventoryFolders(parentFolderID); |
96 | } | 96 | } |
97 | return inventoryList; | 97 | return inventoryList; |
98 | } | 98 | } |
99 | 99 | ||
100 | public List<InventoryItemBase> RequestFolderItems(LLUUID folderID) | 100 | public List<InventoryItemBase> RequestFolderItems(LLUUID folderID) |
101 | { | 101 | { |
102 | List<InventoryItemBase> itemsList = new List<InventoryItemBase>(); | 102 | List<InventoryItemBase> itemsList = new List<InventoryItemBase>(); |
103 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) | 103 | foreach (KeyValuePair<string, IInventoryData> plugin in m_plugins) |
104 | { | 104 | { |
105 | itemsList = plugin.Value.getInventoryInFolder(folderID); | 105 | itemsList = plugin.Value.getInventoryInFolder(folderID); |
106 | return itemsList; | 106 | return itemsList; |
107 | } | 107 | } |
108 | return itemsList; | 108 | return itemsList; |
109 | } | 109 | } |
110 | 110 | ||
111 | /// <summary> | 111 | /// <summary> |
112 | /// | 112 | /// |
113 | /// </summary> | 113 | /// </summary> |
114 | /// <param name="inventory"></param> | 114 | /// <param name="inventory"></param> |
115 | public void AddNewInventorySet(UsersInventory inventory) | 115 | public void AddNewInventorySet(UsersInventory inventory) |
116 | { | 116 | { |
117 | 117 | ||
118 | } | 118 | } |
119 | 119 | ||
120 | public class UsersInventory | 120 | public class UsersInventory |
121 | { | 121 | { |
122 | public Dictionary<LLUUID, InventoryFolderBase> Folders = new Dictionary<LLUUID, InventoryFolderBase>(); | 122 | public Dictionary<LLUUID, InventoryFolderBase> Folders = new Dictionary<LLUUID, InventoryFolderBase>(); |
123 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); | 123 | public Dictionary<LLUUID, InventoryItemBase> Items = new Dictionary<LLUUID, InventoryItemBase>(); |
124 | 124 | ||
125 | public UsersInventory() | 125 | public UsersInventory() |
126 | { | 126 | { |
127 | 127 | ||
128 | } | 128 | } |
129 | 129 | ||
130 | protected virtual void CreateNewInventorySet() | 130 | protected virtual void CreateNewInventorySet() |
131 | { | 131 | { |
132 | 132 | ||
133 | } | 133 | } |
134 | } | 134 | } |
135 | } | 135 | } |
136 | } | 136 | } |
diff --git a/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs b/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs index 35cca07..daf20b2 100644 --- a/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs +++ b/OpenSim/Framework/InventoryServiceBase/Properties/AssemblyInfo.cs | |||
@@ -1,35 +1,35 @@ | |||
1 | using System.Reflection; | 1 | using System.Reflection; |
2 | using System.Runtime.CompilerServices; | 2 | using System.Runtime.CompilerServices; |
3 | using System.Runtime.InteropServices; | 3 | using System.Runtime.InteropServices; |
4 | 4 | ||
5 | // General Information about an assembly is controlled through the following | 5 | // General Information about an assembly is controlled through the following |
6 | // set of attributes. Change these attribute values to modify the information | 6 | // set of attributes. Change these attribute values to modify the information |
7 | // associated with an assembly. | 7 | // associated with an assembly. |
8 | [assembly: AssemblyTitle("InventoryServiceBase")] | 8 | [assembly: AssemblyTitle("InventoryServiceBase")] |
9 | [assembly: AssemblyDescription("")] | 9 | [assembly: AssemblyDescription("")] |
10 | [assembly: AssemblyConfiguration("")] | 10 | [assembly: AssemblyConfiguration("")] |
11 | [assembly: AssemblyCompany("")] | 11 | [assembly: AssemblyCompany("")] |
12 | [assembly: AssemblyProduct("InventoryServiceBase")] | 12 | [assembly: AssemblyProduct("InventoryServiceBase")] |
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | 13 | [assembly: AssemblyCopyright("Copyright © 2007")] |
14 | [assembly: AssemblyTrademark("")] | 14 | [assembly: AssemblyTrademark("")] |
15 | [assembly: AssemblyCulture("")] | 15 | [assembly: AssemblyCulture("")] |
16 | 16 | ||
17 | // Setting ComVisible to false makes the types in this assembly not visible | 17 | // Setting ComVisible to false makes the types in this assembly not visible |
18 | // to COM components. If you need to access a type in this assembly from | 18 | // to COM components. If you need to access a type in this assembly from |
19 | // COM, set the ComVisible attribute to true on that type. | 19 | // COM, set the ComVisible attribute to true on that type. |
20 | [assembly: ComVisible(false)] | 20 | [assembly: ComVisible(false)] |
21 | 21 | ||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM |
23 | [assembly: Guid("7e1fbd0b-4a25-4804-a01f-89b04eb5b349")] | 23 | [assembly: Guid("7e1fbd0b-4a25-4804-a01f-89b04eb5b349")] |
24 | 24 | ||
25 | // Version information for an assembly consists of the following four values: | 25 | // Version information for an assembly consists of the following four values: |
26 | // | 26 | // |
27 | // Major Version | 27 | // Major Version |
28 | // Minor Version | 28 | // Minor Version |
29 | // Build Number | 29 | // Build Number |
30 | // Revision | 30 | // Revision |
31 | // | 31 | // |
32 | // You can specify all the values or you can default the Revision and Build Numbers | 32 | // You can specify all the values or you can default the Revision and Build Numbers |
33 | // by using the '*' as shown below: | 33 | // by using the '*' as shown below: |
34 | [assembly: AssemblyVersion("1.0.0.0")] | 34 | [assembly: AssemblyVersion("1.0.0.0")] |
35 | [assembly: AssemblyFileVersion("1.0.0.0")] | 35 | [assembly: AssemblyFileVersion("1.0.0.0")] |