diff options
author | lbsa71 | 2007-12-27 21:41:48 +0000 |
---|---|---|
committer | lbsa71 | 2007-12-27 21:41:48 +0000 |
commit | efd90b56b761219af6425b1c7a2cdd3b6ffb4de2 (patch) | |
tree | bf5b897e1e3c13211e3e2fc61d30508b94c928c0 /OpenSim/Framework/Communications/Capabilities | |
parent | * removed always true if (diff) | |
download | opensim-SC-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.zip opensim-SC-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.gz opensim-SC-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.bz2 opensim-SC-efd90b56b761219af6425b1c7a2cdd3b6ffb4de2.tar.xz |
* Optimized usings
* shortened references
* Removed redundant 'this'
* Normalized EOF
Diffstat (limited to '')
15 files changed, 96 insertions, 95 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index e00f49d..4b42046 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs | |||
@@ -38,33 +38,33 @@ using OpenSim.Framework.Servers; | |||
38 | namespace OpenSim.Region.Capabilities | 38 | namespace OpenSim.Region.Capabilities |
39 | { | 39 | { |
40 | public delegate void UpLoadedAsset( | 40 | public delegate void UpLoadedAsset( |
41 | string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, | 41 | string assetName, string description, LLUUID assetID, LLUUID inventoryItem, LLUUID parentFolder, |
42 | byte[] data, string inventoryType, string assetType); | 42 | byte[] data, string inventoryType, string assetType); |
43 | 43 | ||
44 | public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data); | 44 | public delegate LLUUID UpdateItem(LLUUID itemID, byte[] data); |
45 | 45 | ||
46 | public delegate void UpdateTaskScript(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data); | 46 | public delegate void UpdateTaskScript(LLUUID itemID, LLUUID primID, bool isScriptRunning, byte[] data); |
47 | 47 | ||
48 | public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item); | 48 | public delegate void NewInventoryItem(LLUUID userID, InventoryItemBase item); |
49 | 49 | ||
50 | public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data); | 50 | public delegate LLUUID ItemUpdatedCallback(LLUUID userID, LLUUID itemID, byte[] data); |
51 | 51 | ||
52 | public delegate void TaskScriptUpdatedCallback(LLUUID userID, LLUUID itemID, LLUUID primID, | 52 | public delegate void TaskScriptUpdatedCallback(LLUUID userID, LLUUID itemID, LLUUID primID, |
53 | bool isScriptRunning, byte[] data); | 53 | bool isScriptRunning, byte[] data); |
54 | 54 | ||
55 | public class Caps | 55 | public class Caps |
56 | { | 56 | { |
57 | private string m_httpListenerHostName; | 57 | private string m_httpListenerHostName; |
58 | private uint m_httpListenPort; | 58 | private uint m_httpListenPort; |
59 | 59 | ||
60 | private string m_capsObjectPath = "00001-"; | 60 | private string m_capsObjectPath = "00001-"; |
61 | private string m_requestPath = "0000/"; | 61 | private string m_requestPath = "0000/"; |
62 | private string m_mapLayerPath = "0001/"; | 62 | private string m_mapLayerPath = "0001/"; |
63 | private string m_newInventory = "0002/"; | 63 | private string m_newInventory = "0002/"; |
64 | //private string m_requestTexture = "0003/"; | 64 | //private string m_requestTexture = "0003/"; |
65 | private string m_notecardUpdatePath = "0004/"; | 65 | private string m_notecardUpdatePath = "0004/"; |
66 | private string m_notecardTaskUpdatePath = "0005/"; | 66 | private string m_notecardTaskUpdatePath = "0005/"; |
67 | 67 | ||
68 | //private string eventQueue = "0100/"; | 68 | //private string eventQueue = "0100/"; |
69 | private BaseHttpServer m_httpListener; | 69 | private BaseHttpServer m_httpListener; |
70 | private LLUUID m_agentID; | 70 | private LLUUID m_agentID; |
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Capabilities | |||
78 | public NewInventoryItem AddNewInventoryItem = null; | 78 | public NewInventoryItem AddNewInventoryItem = null; |
79 | public ItemUpdatedCallback ItemUpdatedCall = null; | 79 | public ItemUpdatedCallback ItemUpdatedCall = null; |
80 | public TaskScriptUpdatedCallback TaskScriptUpdatedCall = null; | 80 | public TaskScriptUpdatedCallback TaskScriptUpdatedCall = null; |
81 | 81 | ||
82 | public Caps(AssetCache assetCache, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, | 82 | public Caps(AssetCache assetCache, BaseHttpServer httpServer, string httpListen, uint httpPort, string capsPath, |
83 | LLUUID agent, bool dumpAssetsToFile) | 83 | LLUUID agent, bool dumpAssetsToFile) |
84 | { | 84 | { |
@@ -138,7 +138,7 @@ namespace OpenSim.Region.Capabilities | |||
138 | /// <returns></returns> | 138 | /// <returns></returns> |
139 | public string CapsRequest(string request, string path, string param) | 139 | public string CapsRequest(string request, string path, string param) |
140 | { | 140 | { |
141 | //Console.WriteLine("caps request " + request); | 141 | //Console.WriteLine("caps request " + request); |
142 | string result = LLSDHelpers.SerialiseLLSDReply(GetCapabilities()); | 142 | string result = LLSDHelpers.SerialiseLLSDReply(GetCapabilities()); |
143 | return result; | 143 | return result; |
144 | } | 144 | } |
@@ -153,7 +153,7 @@ namespace OpenSim.Region.Capabilities | |||
153 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + | 153 | string capsBaseUrl = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + "/CAPS/" + |
154 | m_capsObjectPath; | 154 | m_capsObjectPath; |
155 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; | 155 | caps.MapLayer = capsBaseUrl + m_mapLayerPath; |
156 | // caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; | 156 | // caps.RequestTextureDownload = capsBaseUrl + m_requestTexture; |
157 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; | 157 | caps.NewFileAgentInventory = capsBaseUrl + m_newInventory; |
158 | caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; | 158 | caps.UpdateNotecardAgentInventory = capsBaseUrl + m_notecardUpdatePath; |
159 | caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath; | 159 | caps.UpdateScriptAgentInventory = capsBaseUrl + m_notecardUpdatePath; |
@@ -262,7 +262,7 @@ namespace OpenSim.Region.Capabilities | |||
262 | } | 262 | } |
263 | 263 | ||
264 | #endregion | 264 | #endregion |
265 | 265 | ||
266 | /// <summary> | 266 | /// <summary> |
267 | /// Callback for a client request for an upload url for a script task | 267 | /// Callback for a client request for an upload url for a script task |
268 | /// inventory update | 268 | /// inventory update |
@@ -272,28 +272,28 @@ namespace OpenSim.Region.Capabilities | |||
272 | /// <param name="param"></param> | 272 | /// <param name="param"></param> |
273 | /// <returns></returns> | 273 | /// <returns></returns> |
274 | public string ScriptTaskInventory(string request, string path, string param) | 274 | public string ScriptTaskInventory(string request, string path, string param) |
275 | { | 275 | { |
276 | try | 276 | try |
277 | { | 277 | { |
278 | // MainLog.Instance.Debug("CAPS", "request: {0}, path: {1}, param: {2}", request, path, param); | 278 | // MainLog.Instance.Debug("CAPS", "request: {0}, path: {1}, param: {2}", request, path, param); |
279 | 279 | ||
280 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); | 280 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); |
281 | LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); | 281 | LLSDTaskScriptUpdate llsdUpdateRequest = new LLSDTaskScriptUpdate(); |
282 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdUpdateRequest); | 282 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdUpdateRequest); |
283 | 283 | ||
284 | string capsBase = "/CAPS/" + m_capsObjectPath; | 284 | string capsBase = "/CAPS/" + m_capsObjectPath; |
285 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); | 285 | string uploaderPath = Util.RandomClass.Next(5000, 8000).ToString("0000"); |
286 | 286 | ||
287 | TaskInventoryScriptUpdater uploader = | 287 | TaskInventoryScriptUpdater uploader = |
288 | new TaskInventoryScriptUpdater( | 288 | new TaskInventoryScriptUpdater( |
289 | llsdUpdateRequest.item_id, | 289 | llsdUpdateRequest.item_id, |
290 | llsdUpdateRequest.task_id, | 290 | llsdUpdateRequest.task_id, |
291 | llsdUpdateRequest.is_script_running, | 291 | llsdUpdateRequest.is_script_running, |
292 | capsBase + uploaderPath, | 292 | capsBase + uploaderPath, |
293 | m_httpListener, | 293 | m_httpListener, |
294 | m_dumpAssetsToFile); | 294 | m_dumpAssetsToFile); |
295 | uploader.OnUpLoad += TaskScriptUpdated; | 295 | uploader.OnUpLoad += TaskScriptUpdated; |
296 | 296 | ||
297 | m_httpListener.AddStreamHandler( | 297 | m_httpListener.AddStreamHandler( |
298 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); | 298 | new BinaryStreamHandler("POST", capsBase + uploaderPath, uploader.uploaderCaps)); |
299 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + | 299 | string uploaderURL = "http://" + m_httpListenerHostName + ":" + m_httpListenPort.ToString() + capsBase + |
@@ -302,13 +302,13 @@ namespace OpenSim.Region.Capabilities | |||
302 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); | 302 | LLSDAssetUploadResponse uploadResponse = new LLSDAssetUploadResponse(); |
303 | uploadResponse.uploader = uploaderURL; | 303 | uploadResponse.uploader = uploaderURL; |
304 | uploadResponse.state = "upload"; | 304 | uploadResponse.state = "upload"; |
305 | 305 | ||
306 | // MainLog.Instance.Verbose( | 306 | // MainLog.Instance.Verbose( |
307 | // "CAPS", | 307 | // "CAPS", |
308 | // "ScriptTaskInventory response: {0}", | 308 | // "ScriptTaskInventory response: {0}", |
309 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse)); | 309 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse)); |
310 | 310 | ||
311 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); | 311 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); |
312 | } | 312 | } |
313 | catch (Exception e) | 313 | catch (Exception e) |
314 | { | 314 | { |
@@ -329,7 +329,7 @@ namespace OpenSim.Region.Capabilities | |||
329 | public string NoteCardAgentInventory(string request, string path, string param) | 329 | public string NoteCardAgentInventory(string request, string path, string param) |
330 | { | 330 | { |
331 | //libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request)); | 331 | //libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap)libsecondlife.StructuredData.LLSDParser.DeserializeBinary(Helpers.StringToField(request)); |
332 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(Helpers.StringToField(request)); | 332 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(Helpers.StringToField(request)); |
333 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); | 333 | LLSDItemUpdate llsdRequest = new LLSDItemUpdate(); |
334 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); | 334 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); |
335 | 335 | ||
@@ -353,7 +353,7 @@ namespace OpenSim.Region.Capabilities | |||
353 | // "CAPS", | 353 | // "CAPS", |
354 | // "NoteCardAgentInventory response: {0}", | 354 | // "NoteCardAgentInventory response: {0}", |
355 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse)); | 355 | // LLSDHelpers.SerialiseLLSDReply(uploadResponse)); |
356 | 356 | ||
357 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); | 357 | return LLSDHelpers.SerialiseLLSDReply(uploadResponse); |
358 | } | 358 | } |
359 | 359 | ||
@@ -453,7 +453,7 @@ namespace OpenSim.Region.Capabilities | |||
453 | { | 453 | { |
454 | return ItemUpdatedCall(m_agentID, itemID, data); | 454 | return ItemUpdatedCall(m_agentID, itemID, data); |
455 | } | 455 | } |
456 | 456 | ||
457 | return LLUUID.Zero; | 457 | return LLUUID.Zero; |
458 | } | 458 | } |
459 | 459 | ||
@@ -613,7 +613,7 @@ namespace OpenSim.Region.Capabilities | |||
613 | fs.Close(); | 613 | fs.Close(); |
614 | } | 614 | } |
615 | } | 615 | } |
616 | 616 | ||
617 | /// <summary> | 617 | /// <summary> |
618 | /// This class is a callback invoked when a client sends asset data to | 618 | /// This class is a callback invoked when a client sends asset data to |
619 | /// a task inventory script update url | 619 | /// a task inventory script update url |
@@ -629,17 +629,17 @@ namespace OpenSim.Region.Capabilities | |||
629 | private BaseHttpServer httpListener; | 629 | private BaseHttpServer httpListener; |
630 | private bool m_dumpAssetToFile; | 630 | private bool m_dumpAssetToFile; |
631 | 631 | ||
632 | public TaskInventoryScriptUpdater(LLUUID inventoryItemID, LLUUID primID, int isScriptRunning, | 632 | public TaskInventoryScriptUpdater(LLUUID inventoryItemID, LLUUID primID, int isScriptRunning, |
633 | string path, BaseHttpServer httpServer, bool dumpAssetToFile) | 633 | string path, BaseHttpServer httpServer, bool dumpAssetToFile) |
634 | { | 634 | { |
635 | m_dumpAssetToFile = dumpAssetToFile; | 635 | m_dumpAssetToFile = dumpAssetToFile; |
636 | 636 | ||
637 | this.inventoryItemID = inventoryItemID; | 637 | this.inventoryItemID = inventoryItemID; |
638 | this.primID = primID; | 638 | this.primID = primID; |
639 | 639 | ||
640 | // This comes in over the packet as an integer, but actually appears to be treated as a bool | 640 | // This comes in over the packet as an integer, but actually appears to be treated as a bool |
641 | this.isScriptRunning = (0 == isScriptRunning ? false : true); | 641 | this.isScriptRunning = (0 == isScriptRunning ? false : true); |
642 | 642 | ||
643 | uploaderPath = path; | 643 | uploaderPath = path; |
644 | httpListener = httpServer; | 644 | httpListener = httpServer; |
645 | } | 645 | } |
@@ -659,7 +659,7 @@ namespace OpenSim.Region.Capabilities | |||
659 | // "CAPS", | 659 | // "CAPS", |
660 | // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", | 660 | // "TaskInventoryScriptUpdater received data: {0}, path: {1}, param: {2}", |
661 | // data, path, param); | 661 | // data, path, param); |
662 | 662 | ||
663 | string res = ""; | 663 | string res = ""; |
664 | LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); | 664 | LLSDTaskInventoryUploadComplete uploadComplete = new LLSDTaskInventoryUploadComplete(); |
665 | 665 | ||
@@ -668,7 +668,7 @@ namespace OpenSim.Region.Capabilities | |||
668 | OnUpLoad(inventoryItemID, primID, isScriptRunning, data); | 668 | OnUpLoad(inventoryItemID, primID, isScriptRunning, data); |
669 | } | 669 | } |
670 | 670 | ||
671 | uploadComplete.item_id = inventoryItemID; | 671 | uploadComplete.item_id = inventoryItemID; |
672 | uploadComplete.task_id = primID; | 672 | uploadComplete.task_id = primID; |
673 | uploadComplete.state = "complete"; | 673 | uploadComplete.state = "complete"; |
674 | 674 | ||
@@ -680,7 +680,7 @@ namespace OpenSim.Region.Capabilities | |||
680 | { | 680 | { |
681 | SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); | 681 | SaveAssetToFile("updatedtaskscript" + Util.RandomClass.Next(1, 1000) + ".dat", data); |
682 | } | 682 | } |
683 | 683 | ||
684 | // MainLog.Instance.Verbose("CAPS", "TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); | 684 | // MainLog.Instance.Verbose("CAPS", "TaskInventoryScriptUpdater.uploaderCaps res: {0}", res); |
685 | 685 | ||
686 | return res; | 686 | return res; |
@@ -689,9 +689,9 @@ namespace OpenSim.Region.Capabilities | |||
689 | { | 689 | { |
690 | MainLog.Instance.Error("CAPS", e.ToString()); | 690 | MainLog.Instance.Error("CAPS", e.ToString()); |
691 | } | 691 | } |
692 | 692 | ||
693 | // XXX Maybe this should be some meaningful error packet | 693 | // XXX Maybe this should be some meaningful error packet |
694 | return null; | 694 | return null; |
695 | } | 695 | } |
696 | 696 | ||
697 | private void SaveAssetToFile(string filename, byte[] data) | 697 | private void SaveAssetToFile(string filename, byte[] data) |
@@ -702,6 +702,6 @@ namespace OpenSim.Region.Capabilities | |||
702 | bw.Close(); | 702 | bw.Close(); |
703 | fs.Close(); | 703 | fs.Close(); |
704 | } | 704 | } |
705 | } | 705 | } |
706 | } | 706 | } |
707 | } | 707 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSD.cs b/OpenSim/Framework/Communications/Capabilities/LLSD.cs index 987d6e6..dab926c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSD.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSD.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.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 | * |
@@ -28,12 +28,12 @@ | |||
28 | 28 | ||
29 | using System; | 29 | using System; |
30 | using System.Collections; | 30 | using System.Collections; |
31 | using System.Collections.Generic; | 31 | using System.Globalization; |
32 | using System.Xml; | ||
33 | using System.IO; | 32 | using System.IO; |
34 | using libsecondlife; | ||
35 | using System.Security.Cryptography; | 33 | using System.Security.Cryptography; |
36 | using System.Text; | 34 | using System.Text; |
35 | using System.Xml; | ||
36 | using libsecondlife; | ||
37 | 37 | ||
38 | namespace OpenSim.Region.Capabilities | 38 | namespace OpenSim.Region.Capabilities |
39 | { | 39 | { |
@@ -47,7 +47,9 @@ namespace OpenSim.Region.Capabilities | |||
47 | /// </summary> | 47 | /// </summary> |
48 | public class LLSDParseException : Exception | 48 | public class LLSDParseException : Exception |
49 | { | 49 | { |
50 | public LLSDParseException(string message) : base(message) { } | 50 | public LLSDParseException(string message) : base(message) |
51 | { | ||
52 | } | ||
51 | } | 53 | } |
52 | 54 | ||
53 | /// <summary> | 55 | /// <summary> |
@@ -55,7 +57,9 @@ namespace OpenSim.Region.Capabilities | |||
55 | /// </summary> | 57 | /// </summary> |
56 | public class LLSDSerializeException : Exception | 58 | public class LLSDSerializeException : Exception |
57 | { | 59 | { |
58 | public LLSDSerializeException(string message) : base(message) { } | 60 | public LLSDSerializeException(string message) : base(message) |
61 | { | ||
62 | } | ||
59 | } | 63 | } |
60 | 64 | ||
61 | /// <summary> | 65 | /// <summary> |
@@ -129,7 +133,7 @@ namespace OpenSim.Region.Capabilities | |||
129 | if (obj is string) | 133 | if (obj is string) |
130 | { | 134 | { |
131 | writer.WriteStartElement(String.Empty, "string", String.Empty); | 135 | writer.WriteStartElement(String.Empty, "string", String.Empty); |
132 | writer.WriteString((string)obj); | 136 | writer.WriteString((string) obj); |
133 | writer.WriteEndElement(); | 137 | writer.WriteEndElement(); |
134 | } | 138 | } |
135 | else if (obj is int) | 139 | else if (obj is int) |
@@ -146,7 +150,7 @@ namespace OpenSim.Region.Capabilities | |||
146 | } | 150 | } |
147 | else if (obj is bool) | 151 | else if (obj is bool) |
148 | { | 152 | { |
149 | bool b = (bool)obj; | 153 | bool b = (bool) obj; |
150 | writer.WriteStartElement(String.Empty, "boolean", String.Empty); | 154 | writer.WriteStartElement(String.Empty, "boolean", String.Empty); |
151 | writer.WriteString(b ? "1" : "0"); | 155 | writer.WriteString(b ? "1" : "0"); |
152 | writer.WriteEndElement(); | 156 | writer.WriteEndElement(); |
@@ -157,7 +161,7 @@ namespace OpenSim.Region.Capabilities | |||
157 | } | 161 | } |
158 | else if (obj is LLUUID) | 162 | else if (obj is LLUUID) |
159 | { | 163 | { |
160 | LLUUID u = (LLUUID)obj; | 164 | LLUUID u = (LLUUID) obj; |
161 | writer.WriteStartElement(String.Empty, "uuid", String.Empty); | 165 | writer.WriteStartElement(String.Empty, "uuid", String.Empty); |
162 | writer.WriteString(u.ToString()); | 166 | writer.WriteString(u.ToString()); |
163 | writer.WriteEndElement(); | 167 | writer.WriteEndElement(); |
@@ -463,7 +467,7 @@ namespace OpenSim.Region.Capabilities | |||
463 | } | 467 | } |
464 | else if (obj is string) | 468 | else if (obj is string) |
465 | { | 469 | { |
466 | return GetSpaces(indent) + "- string \"" + (string)obj + "\"\n"; | 470 | return GetSpaces(indent) + "- string \"" + (string) obj + "\"\n"; |
467 | } | 471 | } |
468 | else if (obj is int) | 472 | else if (obj is int) |
469 | { | 473 | { |
@@ -475,13 +479,13 @@ namespace OpenSim.Region.Capabilities | |||
475 | } | 479 | } |
476 | else if (obj is LLUUID) | 480 | else if (obj is LLUUID) |
477 | { | 481 | { |
478 | return GetSpaces(indent) + "- uuid " + ((LLUUID)obj).ToString() + Environment.NewLine; | 482 | return GetSpaces(indent) + "- uuid " + ((LLUUID) obj).ToString() + Environment.NewLine; |
479 | } | 483 | } |
480 | else if (obj is Hashtable) | 484 | else if (obj is Hashtable) |
481 | { | 485 | { |
482 | StringBuilder ret = new StringBuilder(); | 486 | StringBuilder ret = new StringBuilder(); |
483 | ret.Append(GetSpaces(indent) + "- map" + Environment.NewLine); | 487 | ret.Append(GetSpaces(indent) + "- map" + Environment.NewLine); |
484 | Hashtable map = (Hashtable)obj; | 488 | Hashtable map = (Hashtable) obj; |
485 | 489 | ||
486 | foreach (string key in map.Keys) | 490 | foreach (string key in map.Keys) |
487 | { | 491 | { |
@@ -495,7 +499,7 @@ namespace OpenSim.Region.Capabilities | |||
495 | { | 499 | { |
496 | StringBuilder ret = new StringBuilder(); | 500 | StringBuilder ret = new StringBuilder(); |
497 | ret.Append(GetSpaces(indent) + "- array\n"); | 501 | ret.Append(GetSpaces(indent) + "- array\n"); |
498 | ArrayList list = (ArrayList)obj; | 502 | ArrayList list = (ArrayList) obj; |
499 | 503 | ||
500 | foreach (object item in list) | 504 | foreach (object item in list) |
501 | { | 505 | { |
@@ -506,8 +510,8 @@ namespace OpenSim.Region.Capabilities | |||
506 | } | 510 | } |
507 | else if (obj is byte[]) | 511 | else if (obj is byte[]) |
508 | { | 512 | { |
509 | return GetSpaces(indent) + "- binary\n" + Helpers.FieldToHexString((byte[])obj, GetSpaces(indent)) + | 513 | return GetSpaces(indent) + "- binary\n" + Helpers.FieldToHexString((byte[]) obj, GetSpaces(indent)) + |
510 | Environment.NewLine; | 514 | Environment.NewLine; |
511 | } | 515 | } |
512 | else | 516 | else |
513 | { | 517 | { |
@@ -557,8 +561,8 @@ namespace OpenSim.Region.Capabilities | |||
557 | double value; | 561 | double value; |
558 | endPos = FindEnd(llsd, 1); | 562 | endPos = FindEnd(llsd, 1); |
559 | 563 | ||
560 | if (Double.TryParse(llsd.Substring(1, endPos - 1), System.Globalization.NumberStyles.Float, | 564 | if (Double.TryParse(llsd.Substring(1, endPos - 1), NumberStyles.Float, |
561 | Helpers.EnUsCulture.NumberFormat, out value)) | 565 | Helpers.EnUsCulture.NumberFormat, out value)) |
562 | return value; | 566 | return value; |
563 | else | 567 | else |
564 | throw new LLSDParseException("Failed to parse double value type"); | 568 | throw new LLSDParseException("Failed to parse double value type"); |
@@ -652,7 +656,7 @@ namespace OpenSim.Region.Capabilities | |||
652 | 656 | ||
653 | private static int FindEnd(string llsd, int start) | 657 | private static int FindEnd(string llsd, int start) |
654 | { | 658 | { |
655 | int end = llsd.IndexOfAny(new char[] { ',', ']', '}' }); | 659 | int end = llsd.IndexOfAny(new char[] {',', ']', '}'}); |
656 | if (end == -1) end = llsd.Length - 1; | 660 | if (end == -1) end = llsd.Length - 1; |
657 | return end; | 661 | return end; |
658 | } | 662 | } |
@@ -673,4 +677,4 @@ namespace OpenSim.Region.Capabilities | |||
673 | } | 677 | } |
674 | } | 678 | } |
675 | } | 679 | } |
676 | } | 680 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs b/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs index 2bc1643..d641b5c 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDArray.cs | |||
@@ -38,4 +38,4 @@ namespace OpenSim.Region.Capabilities | |||
38 | { | 38 | { |
39 | } | 39 | } |
40 | } | 40 | } |
41 | } | 41 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs index 307e3e3..f838c85 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDAssetUploadComplete.cs | |||
@@ -41,4 +41,4 @@ namespace OpenSim.Region.Capabilities | |||
41 | { | 41 | { |
42 | } | 42 | } |
43 | } | 43 | } |
44 | } | 44 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs b/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs index eb76d64..3b8c077 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDCapEvent.cs | |||
@@ -37,4 +37,4 @@ namespace OpenSim.Region.Capabilities | |||
37 | { | 37 | { |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs b/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs index dfb1683..7b09cb3 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDCapsDetails.cs | |||
@@ -34,7 +34,7 @@ namespace OpenSim.Region.Capabilities | |||
34 | public string MapLayer = ""; | 34 | public string MapLayer = ""; |
35 | public string NewFileAgentInventory = ""; | 35 | public string NewFileAgentInventory = ""; |
36 | //public string EventQueueGet = ""; | 36 | //public string EventQueueGet = ""; |
37 | // public string RequestTextureDownload = ""; | 37 | // public string RequestTextureDownload = ""; |
38 | // public string ChatSessionRequest = ""; | 38 | // public string ChatSessionRequest = ""; |
39 | public string UpdateNotecardAgentInventory = ""; | 39 | public string UpdateNotecardAgentInventory = ""; |
40 | public string UpdateScriptAgentInventory = ""; | 40 | public string UpdateScriptAgentInventory = ""; |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs b/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs index 101d9c0..5e6e917 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDEmpty.cs | |||
@@ -34,4 +34,4 @@ namespace OpenSim.Region.Capabilities | |||
34 | { | 34 | { |
35 | } | 35 | } |
36 | } | 36 | } |
37 | } | 37 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index 60aa60c..28f838d 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs | |||
@@ -30,7 +30,6 @@ 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; | ||
34 | 33 | ||
35 | namespace OpenSim.Region.Capabilities | 34 | namespace OpenSim.Region.Capabilities |
36 | { | 35 | { |
@@ -77,7 +76,7 @@ namespace OpenSim.Region.Capabilities | |||
77 | writer.WriteString(fields[i].Name); | 76 | writer.WriteString(fields[i].Name); |
78 | writer.WriteEndElement(); | 77 | writer.WriteEndElement(); |
79 | LLSD.LLSDWriteOne(writer, fieldValue); | 78 | LLSD.LLSDWriteOne(writer, fieldValue); |
80 | // libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( | 79 | // libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( |
81 | // writer, libsecondlife.StructuredData.LLSD.FromObject(fieldValue)); | 80 | // writer, libsecondlife.StructuredData.LLSD.FromObject(fieldValue)); |
82 | } | 81 | } |
83 | } | 82 | } |
@@ -102,8 +101,8 @@ namespace OpenSim.Region.Capabilities | |||
102 | else | 101 | else |
103 | { | 102 | { |
104 | LLSD.LLSDWriteOne(writer, obj); | 103 | LLSD.LLSDWriteOne(writer, obj); |
105 | //libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( | 104 | //libsecondlife.StructuredData.LLSDParser.SerializeXmlElement( |
106 | // writer, libsecondlife.StructuredData.LLSD.FromObject(obj)); | 105 | // writer, libsecondlife.StructuredData.LLSD.FromObject(obj)); |
107 | } | 106 | } |
108 | } | 107 | } |
109 | 108 | ||
@@ -122,12 +121,12 @@ namespace OpenSim.Region.Capabilities | |||
122 | FieldInfo field = myType.GetField((string) enumerator.Key); | 121 | FieldInfo field = myType.GetField((string) enumerator.Key); |
123 | if (field != null) | 122 | if (field != null) |
124 | { | 123 | { |
125 | // if (enumerator.Value is libsecondlife.StructuredData.LLSDMap) | 124 | // if (enumerator.Value is libsecondlife.StructuredData.LLSDMap) |
126 | if (enumerator.Value is Hashtable) | 125 | if (enumerator.Value is Hashtable) |
127 | { | 126 | { |
128 | object fieldValue = field.GetValue(obj); | 127 | object fieldValue = field.GetValue(obj); |
129 | DeserialiseLLSDMap((Hashtable)enumerator.Value, fieldValue); | 128 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); |
130 | // DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue); | 129 | // DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue); |
131 | } | 130 | } |
132 | else if (enumerator.Value is ArrayList) | 131 | else if (enumerator.Value is ArrayList) |
133 | { | 132 | { |
@@ -149,4 +148,4 @@ namespace OpenSim.Region.Capabilities | |||
149 | return obj; | 148 | return obj; |
150 | } | 149 | } |
151 | } | 150 | } |
152 | } | 151 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs index 214b9c7..121b36a 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayer.cs | |||
@@ -42,4 +42,4 @@ namespace OpenSim.Region.Capabilities | |||
42 | { | 42 | { |
43 | } | 43 | } |
44 | } | 44 | } |
45 | } | 45 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs index 48130b1..93b0f83 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDMapLayerResponse.cs | |||
@@ -37,4 +37,4 @@ namespace OpenSim.Region.Capabilities | |||
37 | { | 37 | { |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs index 71cc358..4321d7b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDStreamHandler.cs | |||
@@ -29,9 +29,7 @@ | |||
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.IO; | 30 | using System.IO; |
31 | using System.Text; | 31 | using System.Text; |
32 | using libsecondlife; | ||
33 | using OpenSim.Framework.Servers; | 32 | using OpenSim.Framework.Servers; |
34 | using System.Xml; | ||
35 | 33 | ||
36 | namespace OpenSim.Region.Capabilities | 34 | namespace OpenSim.Region.Capabilities |
37 | { | 35 | { |
@@ -54,10 +52,10 @@ namespace OpenSim.Region.Capabilities | |||
54 | //string requestBody = streamReader.ReadToEnd(); | 52 | //string requestBody = streamReader.ReadToEnd(); |
55 | //streamReader.Close(); | 53 | //streamReader.Close(); |
56 | 54 | ||
57 | // libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap) | 55 | // libsecondlife.StructuredData.LLSDMap hash = (libsecondlife.StructuredData.LLSDMap) |
58 | // libsecondlife.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request)); | 56 | // libsecondlife.StructuredData.LLSDParser.DeserializeXml(new XmlTextReader(request)); |
59 | 57 | ||
60 | Hashtable hash = (Hashtable)LLSD.LLSDDeserialize(request); | 58 | Hashtable hash = (Hashtable) LLSD.LLSDDeserialize(request); |
61 | TRequest llsdRequest = new TRequest(); | 59 | TRequest llsdRequest = new TRequest(); |
62 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); | 60 | LLSDHelpers.DeserialiseLLSDMap(hash, llsdRequest); |
63 | 61 | ||
@@ -68,4 +66,4 @@ namespace OpenSim.Region.Capabilities | |||
68 | return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); | 66 | return encoding.GetBytes(LLSDHelpers.SerialiseLLSDReply(response)); |
69 | } | 67 | } |
70 | } | 68 | } |
71 | } | 69 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs index 3703efc..8d6550b 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTaskInventoryUploadComplete.cs | |||
@@ -25,10 +25,10 @@ | |||
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 | [LLSDMap] | 32 | [LLSDMap] |
33 | public class LLSDTaskInventoryUploadComplete | 33 | public class LLSDTaskInventoryUploadComplete |
34 | { | 34 | { |
@@ -36,15 +36,15 @@ namespace OpenSim.Region.Capabilities | |||
36 | /// The task inventory item that was updated | 36 | /// The task inventory item that was updated |
37 | /// </summary> | 37 | /// </summary> |
38 | public LLUUID item_id; | 38 | public LLUUID item_id; |
39 | 39 | ||
40 | /// <summary> | 40 | /// <summary> |
41 | /// The task that was updated | 41 | /// The task that was updated |
42 | /// </summary> | 42 | /// </summary> |
43 | public LLUUID task_id; | 43 | public LLUUID task_id; |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// State of the upload. So far have only even seen this set to "complete" | 46 | /// State of the upload. So far have only even seen this set to "complete" |
47 | /// </summary> | 47 | /// </summary> |
48 | public string state; | 48 | public string state; |
49 | } | 49 | } |
50 | } | 50 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs index 6dcf2b5..e9c77b8 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTaskScriptUpdate.cs | |||
@@ -26,10 +26,10 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using libsecondlife; | 29 | using libsecondlife; |
30 | 30 | ||
31 | namespace OpenSim.Region.Capabilities | 31 | namespace OpenSim.Region.Capabilities |
32 | { | 32 | { |
33 | [LLSDMap] | 33 | [LLSDMap] |
34 | public class LLSDTaskScriptUpdate | 34 | public class LLSDTaskScriptUpdate |
35 | { | 35 | { |
@@ -37,15 +37,15 @@ namespace OpenSim.Region.Capabilities | |||
37 | /// The item containing the script to update | 37 | /// The item containing the script to update |
38 | /// </summary> | 38 | /// </summary> |
39 | public LLUUID item_id; | 39 | public LLUUID item_id; |
40 | 40 | ||
41 | /// <summary> | 41 | /// <summary> |
42 | /// The task containing the script | 42 | /// The task containing the script |
43 | /// </summary> | 43 | /// </summary> |
44 | public LLUUID task_id; | 44 | public LLUUID task_id; |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
47 | /// Signals whether the script is currently active | 47 | /// Signals whether the script is currently active |
48 | /// </summary> | 48 | /// </summary> |
49 | public int is_script_running; | 49 | public int is_script_running; |
50 | } | 50 | } |
51 | } | 51 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs b/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs index 70bfd2c..d10b0c0 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDTest.cs | |||
@@ -37,4 +37,4 @@ namespace OpenSim.Region.Capabilities | |||
37 | { | 37 | { |
38 | } | 38 | } |
39 | } | 39 | } |
40 | } | 40 | } \ No newline at end of file |
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs b/OpenSim/Framework/Communications/Capabilities/LLSDType.cs index 7bbe16e..e851742 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDType.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDType.cs | |||
@@ -52,4 +52,4 @@ namespace OpenSim.Region.Capabilities | |||
52 | { | 52 | { |
53 | } | 53 | } |
54 | } | 54 | } |
55 | } | 55 | } \ No newline at end of file |