diff options
author | Melanie | 2009-10-19 21:58:51 +0100 |
---|---|---|
committer | Melanie | 2009-10-19 21:58:51 +0100 |
commit | ffd59868f5e2d797160b1bbfc13f3b4bac717b36 (patch) | |
tree | fb807a129a6e449ac17dadce15d7b27268c92c3f /OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |
parent | Merge branch 'master' into vehicles (diff) | |
parent | Minor formatting cleanup. (diff) | |
download | opensim-SC-ffd59868f5e2d797160b1bbfc13f3b4bac717b36.zip opensim-SC-ffd59868f5e2d797160b1bbfc13f3b4bac717b36.tar.gz opensim-SC-ffd59868f5e2d797160b1bbfc13f3b4bac717b36.tar.bz2 opensim-SC-ffd59868f5e2d797160b1bbfc13f3b4bac717b36.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Framework/Serialization/External/LandDataSerializer.cs')
-rw-r--r-- | OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index a3bc5d1..ff0afc8 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs | |||
@@ -41,7 +41,7 @@ namespace OpenSim.Framework.Serialization.External | |||
41 | public class LandDataSerializer | 41 | public class LandDataSerializer |
42 | { | 42 | { |
43 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); | 43 | protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); |
44 | 44 | ||
45 | /// <summary> | 45 | /// <summary> |
46 | /// Reify/deserialize landData | 46 | /// Reify/deserialize landData |
47 | /// </summary> | 47 | /// </summary> |
@@ -52,7 +52,7 @@ namespace OpenSim.Framework.Serialization.External | |||
52 | { | 52 | { |
53 | return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); | 53 | return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); |
54 | } | 54 | } |
55 | 55 | ||
56 | /// <summary> | 56 | /// <summary> |
57 | /// Reify/deserialize landData | 57 | /// Reify/deserialize landData |
58 | /// </summary> | 58 | /// </summary> |
@@ -62,10 +62,10 @@ namespace OpenSim.Framework.Serialization.External | |||
62 | public static LandData Deserialize(string serializedLandData) | 62 | public static LandData Deserialize(string serializedLandData) |
63 | { | 63 | { |
64 | LandData landData = new LandData(); | 64 | LandData landData = new LandData(); |
65 | 65 | ||
66 | StringReader sr = new StringReader(serializedLandData); | 66 | StringReader sr = new StringReader(serializedLandData); |
67 | XmlTextReader xtr = new XmlTextReader(sr); | 67 | XmlTextReader xtr = new XmlTextReader(sr); |
68 | 68 | ||
69 | xtr.ReadStartElement("LandData"); | 69 | xtr.ReadStartElement("LandData"); |
70 | 70 | ||
71 | landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); | 71 | landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); |
@@ -106,7 +106,7 @@ namespace OpenSim.Framework.Serialization.External | |||
106 | pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); | 106 | pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); |
107 | pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); | 107 | pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); |
108 | xtr.ReadEndElement(); | 108 | xtr.ReadEndElement(); |
109 | 109 | ||
110 | landData.ParcelAccessList.Add(pae); | 110 | landData.ParcelAccessList.Add(pae); |
111 | } | 111 | } |
112 | } | 112 | } |
@@ -122,13 +122,13 @@ namespace OpenSim.Framework.Serialization.External | |||
122 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); | 122 | landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); |
123 | 123 | ||
124 | xtr.ReadEndElement(); | 124 | xtr.ReadEndElement(); |
125 | 125 | ||
126 | xtr.Close(); | 126 | xtr.Close(); |
127 | sr.Close(); | 127 | sr.Close(); |
128 | 128 | ||
129 | return landData; | 129 | return landData; |
130 | } | 130 | } |
131 | 131 | ||
132 | public static string Serialize(LandData landData) | 132 | public static string Serialize(LandData landData) |
133 | { | 133 | { |
134 | StringWriter sw = new StringWriter(); | 134 | StringWriter sw = new StringWriter(); |
@@ -137,8 +137,8 @@ namespace OpenSim.Framework.Serialization.External | |||
137 | 137 | ||
138 | xtw.WriteStartDocument(); | 138 | xtw.WriteStartDocument(); |
139 | xtw.WriteStartElement("LandData"); | 139 | xtw.WriteStartElement("LandData"); |
140 | 140 | ||
141 | xtw.WriteElementString("Area", Convert.ToString(landData.Area)); | 141 | xtw.WriteElementString("Area", Convert.ToString(landData.Area)); |
142 | xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); | 142 | xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); |
143 | xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); | 143 | xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); |
144 | xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); | 144 | xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); |
@@ -170,7 +170,7 @@ namespace OpenSim.Framework.Serialization.External | |||
170 | xtw.WriteEndElement(); | 170 | xtw.WriteEndElement(); |
171 | } | 171 | } |
172 | xtw.WriteEndElement(); | 172 | xtw.WriteEndElement(); |
173 | 173 | ||
174 | xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); | 174 | xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); |
175 | xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); | 175 | xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); |
176 | xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); | 176 | xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); |
@@ -184,7 +184,7 @@ namespace OpenSim.Framework.Serialization.External | |||
184 | 184 | ||
185 | xtw.Close(); | 185 | xtw.Close(); |
186 | sw.Close(); | 186 | sw.Close(); |
187 | 187 | ||
188 | return sw.ToString(); | 188 | return sw.ToString(); |
189 | } | 189 | } |
190 | } | 190 | } |