aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs')
-rw-r--r--OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs18
1 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs
index 8252a63..793c366 100644
--- a/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs
+++ b/OpenSim/Framework/Communications/Capabilities/LLSDHelpers.cs
@@ -48,7 +48,7 @@ namespace OpenSim.Region.Capabilities
48 return sw.ToString(); 48 return sw.ToString();
49 } 49 }
50 50
51 public static void SerializeLLSDType(XmlTextWriter writer, object obj) 51 private 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);
@@ -76,7 +76,8 @@ namespace OpenSim.Region.Capabilities
76 writer.WriteStartElement(String.Empty, "key", String.Empty); 76 writer.WriteStartElement(String.Empty, "key", String.Empty);
77 writer.WriteString(fields[i].Name); 77 writer.WriteString(fields[i].Name);
78 writer.WriteEndElement(); 78 writer.WriteEndElement();
79 LLSD.LLSDWriteOne(writer, fieldValue); 79 libsecondlife.StructuredData.LLSDParser.SerializeXmlElement(
80 writer, libsecondlife.StructuredData.LLSD.FromObject(fieldValue));
80 } 81 }
81 } 82 }
82 writer.WriteEndElement(); 83 writer.WriteEndElement();
@@ -99,11 +100,12 @@ namespace OpenSim.Region.Capabilities
99 } 100 }
100 else 101 else
101 { 102 {
102 LLSD.LLSDWriteOne(writer, obj); 103 libsecondlife.StructuredData.LLSDParser.SerializeXmlElement(
104 writer, libsecondlife.StructuredData.LLSD.FromObject(obj));
103 } 105 }
104 } 106 }
105 107
106 public static object DeserialiseLLSDMap(Hashtable llsd, object obj) 108 public static object DeserialiseLLSDMap(libsecondlife.StructuredData.LLSDMap llsd, object obj)
107 { 109 {
108 Type myType = obj.GetType(); 110 Type myType = obj.GetType();
109 LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false); 111 LLSDType[] llsdattributes = (LLSDType[]) myType.GetCustomAttributes(typeof (LLSDType), false);
@@ -118,10 +120,10 @@ namespace OpenSim.Region.Capabilities
118 FieldInfo field = myType.GetField((string) enumerator.Key); 120 FieldInfo field = myType.GetField((string) enumerator.Key);
119 if (field != null) 121 if (field != null)
120 { 122 {
121 if (enumerator.Value is Hashtable) 123 if (enumerator.Value is libsecondlife.StructuredData.LLSDMap)
122 { 124 {
123 object fieldValue = field.GetValue(obj); 125 object fieldValue = field.GetValue(obj);
124 DeserialiseLLSDMap((Hashtable) enumerator.Value, fieldValue); 126 DeserialiseLLSDMap((libsecondlife.StructuredData.LLSDMap) enumerator.Value, fieldValue);
125 } 127 }
126 else if (enumerator.Value is ArrayList) 128 else if (enumerator.Value is ArrayList)
127 { 129 {
@@ -143,4 +145,4 @@ namespace OpenSim.Region.Capabilities
143 return obj; 145 return obj;
144 } 146 }
145 } 147 }
146} \ No newline at end of file 148}