diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index 72a0ec3..51a3320 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -244,6 +244,12 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
244 | sr.Close(); | 244 | sr.Close(); |
245 | } | 245 | } |
246 | 246 | ||
247 | XmlNodeList keymotion = doc.GetElementsByTagName("KeyframeMotion"); | ||
248 | if (keymotion.Count > 0) | ||
249 | sceneObject.RootPart.KeyframeMotion = KeyframeMotion.FromData(sceneObject, Convert.FromBase64String(keymotion[0].InnerText)); | ||
250 | else | ||
251 | sceneObject.RootPart.KeyframeMotion = null; | ||
252 | |||
247 | // Script state may, or may not, exist. Not having any, is NOT | 253 | // Script state may, or may not, exist. Not having any, is NOT |
248 | // ever a problem. | 254 | // ever a problem. |
249 | sceneObject.LoadScriptState(doc); | 255 | sceneObject.LoadScriptState(doc); |
@@ -349,6 +355,8 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
349 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); | 355 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); |
350 | 356 | ||
351 | m_SOPXmlProcessors.Add("Buoyancy", ProcessBuoyancy); | 357 | m_SOPXmlProcessors.Add("Buoyancy", ProcessBuoyancy); |
358 | m_SOPXmlProcessors.Add("Force", ProcessForce); | ||
359 | m_SOPXmlProcessors.Add("Torque", ProcessTorque); | ||
352 | m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive); | 360 | m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive); |
353 | 361 | ||
354 | //Ubit comented until proper testing | 362 | //Ubit comented until proper testing |
@@ -595,7 +603,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
595 | obj.sopVehicle = _vehicle; | 603 | obj.sopVehicle = _vehicle; |
596 | } | 604 | } |
597 | 605 | ||
598 | |||
599 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) | 606 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) |
600 | { | 607 | { |
601 | List<string> errorNodeNames; | 608 | List<string> errorNodeNames; |
@@ -762,7 +769,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
762 | 769 | ||
763 | private static void ProcessBuoyancy(SceneObjectPart obj, XmlTextReader reader) | 770 | private static void ProcessBuoyancy(SceneObjectPart obj, XmlTextReader reader) |
764 | { | 771 | { |
765 | obj.Buoyancy = (int)reader.ReadElementContentAsFloat("Buoyancy", String.Empty); | 772 | obj.Buoyancy = (float)reader.ReadElementContentAsFloat("Buoyancy", String.Empty); |
773 | } | ||
774 | |||
775 | private static void ProcessForce(SceneObjectPart obj, XmlTextReader reader) | ||
776 | { | ||
777 | obj.Force = Util.ReadVector(reader, "Force"); | ||
778 | } | ||
779 | private static void ProcessTorque(SceneObjectPart obj, XmlTextReader reader) | ||
780 | { | ||
781 | obj.Torque = Util.ReadVector(reader, "Torque"); | ||
766 | } | 782 | } |
767 | 783 | ||
768 | private static void ProcessVolumeDetectActive(SceneObjectPart obj, XmlTextReader reader) | 784 | private static void ProcessVolumeDetectActive(SceneObjectPart obj, XmlTextReader reader) |
@@ -1157,6 +1173,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1157 | }); | 1173 | }); |
1158 | 1174 | ||
1159 | writer.WriteEndElement(); | 1175 | writer.WriteEndElement(); |
1176 | |||
1177 | if (sog.RootPart.KeyframeMotion != null) | ||
1178 | { | ||
1179 | Byte[] data = sog.RootPart.KeyframeMotion.Serialize(); | ||
1180 | |||
1181 | writer.WriteStartElement(String.Empty, "KeyframeMotion", String.Empty); | ||
1182 | writer.WriteBase64(data, 0, data.Length); | ||
1183 | writer.WriteEndElement(); | ||
1184 | } | ||
1185 | |||
1160 | writer.WriteEndElement(); | 1186 | writer.WriteEndElement(); |
1161 | } | 1187 | } |
1162 | 1188 | ||
@@ -1256,6 +1282,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1256 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); | 1282 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); |
1257 | 1283 | ||
1258 | writer.WriteElementString("Buoyancy", sop.Buoyancy.ToString()); | 1284 | writer.WriteElementString("Buoyancy", sop.Buoyancy.ToString()); |
1285 | |||
1286 | WriteVector(writer, "Force", sop.Force); | ||
1287 | WriteVector(writer, "Torque", sop.Torque); | ||
1288 | |||
1259 | writer.WriteElementString("VolumeDetectActive", sop.VolumeDetectActive.ToString().ToLower()); | 1289 | writer.WriteElementString("VolumeDetectActive", sop.VolumeDetectActive.ToString().ToLower()); |
1260 | 1290 | ||
1261 | //Ubit comented until proper testing | 1291 | //Ubit comented until proper testing |