diff options
author | Justin Clarke Casey | 2008-11-17 21:00:34 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-11-17 21:00:34 +0000 |
commit | c25a0ea7923aa390d30b8eebdbca4e599edf9b0d (patch) | |
tree | 775133790681153be9edc6d640162271750a1fd0 /OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs | |
parent | * minor: add interface version to 'show version' command output (diff) | |
download | opensim-SC-c25a0ea7923aa390d30b8eebdbca4e599edf9b0d.zip opensim-SC-c25a0ea7923aa390d30b8eebdbca4e599edf9b0d.tar.gz opensim-SC-c25a0ea7923aa390d30b8eebdbca4e599edf9b0d.tar.bz2 opensim-SC-c25a0ea7923aa390d30b8eebdbca4e599edf9b0d.tar.xz |
* Update libOMV to r2359. This is necessary for the progressive texture patch
* Update libopenjpeg as well for this patch.
* Appears to be okay on a very short sniff test
* Source code will be placed in opensim-libs shortly
Diffstat (limited to 'OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs')
-rw-r--r-- | OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs index b14bfdd..ae4a3db 100644 --- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs +++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs | |||
@@ -44,7 +44,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
44 | XmlTextWriter writer = new XmlTextWriter(sw); | 44 | XmlTextWriter writer = new XmlTextWriter(sw); |
45 | writer.Formatting = Formatting.None; | 45 | writer.Formatting = Formatting.None; |
46 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); | 46 | writer.WriteStartElement(String.Empty, "llsd", String.Empty); |
47 | SerializeLLSDType(writer, obj); | 47 | SerializeOSDType(writer, obj); |
48 | writer.WriteEndElement(); | 48 | writer.WriteEndElement(); |
49 | writer.Close(); | 49 | writer.Close(); |
50 | 50 | ||
@@ -53,7 +53,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
53 | return sw.ToString(); | 53 | return sw.ToString(); |
54 | } | 54 | } |
55 | 55 | ||
56 | private static void SerializeLLSDType(XmlTextWriter writer, object obj) | 56 | private static void SerializeOSDType(XmlTextWriter writer, object obj) |
57 | { | 57 | { |
58 | Type myType = obj.GetType(); | 58 | Type myType = obj.GetType(); |
59 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); | 59 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); |
@@ -76,7 +76,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
76 | fieldName = fieldName.Replace("___", "-"); | 76 | fieldName = fieldName.Replace("___", "-"); |
77 | writer.WriteString(fieldName); | 77 | writer.WriteString(fieldName); |
78 | writer.WriteEndElement(); | 78 | writer.WriteEndElement(); |
79 | SerializeLLSDType(writer, fieldValue); | 79 | SerializeOSDType(writer, fieldValue); |
80 | } | 80 | } |
81 | else | 81 | else |
82 | { | 82 | { |
@@ -87,13 +87,13 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
87 | writer.WriteEndElement(); | 87 | writer.WriteEndElement(); |
88 | LLSD.LLSDWriteOne(writer, fieldValue); | 88 | LLSD.LLSDWriteOne(writer, fieldValue); |
89 | // OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( | 89 | // OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( |
90 | // writer, OpenMetaverse.StructuredData.LLSD.FromObject(fieldValue)); | 90 | // writer, OpenMetaverse.StructuredData.OSD.FromObject(fieldValue)); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | writer.WriteEndElement(); | 93 | writer.WriteEndElement(); |
94 | break; | 94 | break; |
95 | case "ARRAY": | 95 | case "ARRAY": |
96 | // LLSDArray arrayObject = obj as LLSDArray; | 96 | // OSDArray arrayObject = obj as OSDArray; |
97 | // ArrayList a = arrayObject.Array; | 97 | // ArrayList a = arrayObject.Array; |
98 | ArrayList a = (ArrayList) obj.GetType().GetField("Array").GetValue(obj); | 98 | ArrayList a = (ArrayList) obj.GetType().GetField("Array").GetValue(obj); |
99 | if (a != null) | 99 | if (a != null) |
@@ -101,7 +101,7 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
101 | writer.WriteStartElement(String.Empty, "array", String.Empty); | 101 | writer.WriteStartElement(String.Empty, "array", String.Empty); |
102 | foreach (object item in a) | 102 | foreach (object item in a) |
103 | { | 103 | { |
104 | SerializeLLSDType(writer, item); | 104 | SerializeOSDType(writer, item); |
105 | } | 105 | } |
106 | writer.WriteEndElement(); | 106 | writer.WriteEndElement(); |
107 | } | 107 | } |
@@ -112,11 +112,11 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
112 | { | 112 | { |
113 | LLSD.LLSDWriteOne(writer, obj); | 113 | LLSD.LLSDWriteOne(writer, obj); |
114 | //OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( | 114 | //OpenMetaverse.StructuredData.LLSDParser.SerializeXmlElement( |
115 | // writer, OpenMetaverse.StructuredData.LLSD.FromObject(obj)); | 115 | // writer, OpenMetaverse.StructuredData.OSD.FromObject(obj)); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | public static object DeserialiseLLSDMap(Hashtable llsd, object obj) | 119 | public static object DeserialiseOSDMap(Hashtable llsd, object obj) |
120 | { | 120 | { |
121 | Type myType = obj.GetType(); | 121 | Type myType = obj.GetType(); |
122 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); | 122 | LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); |
@@ -133,12 +133,12 @@ namespace OpenSim.Framework.Communications.Capabilities | |||
133 | FieldInfo field = myType.GetField(keyName); | 133 | FieldInfo field = myType.GetField(keyName); |
134 | if (field != null) | 134 | if (field != null) |
135 | { | 135 | { |
136 | // if (enumerator.Value is OpenMetaverse.StructuredData.LLSDMap) | 136 | // if (enumerator.Value is OpenMetaverse.StructuredData.OSDMap) |
137 | if (enumerator.Value is Hashtable) | 137 | if (enumerator.Value is Hashtable) |
138 | { | 138 | { |
139 | object fieldValue = field.GetValue(obj); | 139 | object fieldValue = field.GetValue(obj); |
140 | DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); | 140 | DeserialiseOSDMap((Hashtable) enumerator.Value, fieldValue); |
141 | // DeserialiseLLSDMap((OpenMetaverse.StructuredData.LLSDMap) enumerator.Value, fieldValue); | 141 | // DeserialiseOSDMap((OpenMetaverse.StructuredData.OSDMap) enumerator.Value, fieldValue); |
142 | } | 142 | } |
143 | else if (enumerator.Value is ArrayList) | 143 | else if (enumerator.Value is ArrayList) |
144 | { | 144 | { |