diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 50 |
1 files changed, 44 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index e6b88a3..72a0ec3 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -347,6 +347,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
347 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); | 347 | m_SOPXmlProcessors.Add("PayPrice2", ProcessPayPrice2); |
348 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); | 348 | m_SOPXmlProcessors.Add("PayPrice3", ProcessPayPrice3); |
349 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); | 349 | m_SOPXmlProcessors.Add("PayPrice4", ProcessPayPrice4); |
350 | |||
351 | m_SOPXmlProcessors.Add("Buoyancy", ProcessBuoyancy); | ||
352 | m_SOPXmlProcessors.Add("VolumeDetectActive", ProcessVolumeDetectActive); | ||
353 | |||
354 | //Ubit comented until proper testing | ||
355 | m_SOPXmlProcessors.Add("Vehicle", ProcessVehicle); | ||
356 | |||
357 | |||
350 | #endregion | 358 | #endregion |
351 | 359 | ||
352 | #region TaskInventoryXmlProcessors initialization | 360 | #region TaskInventoryXmlProcessors initialization |
@@ -569,6 +577,25 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
569 | obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); | 577 | obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); |
570 | } | 578 | } |
571 | 579 | ||
580 | private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader) | ||
581 | { | ||
582 | bool errors = false; | ||
583 | SOPVehicle _vehicle = new SOPVehicle(); | ||
584 | |||
585 | _vehicle.FromXml2(reader, out errors); | ||
586 | |||
587 | if (errors) | ||
588 | { | ||
589 | obj.sopVehicle = null; | ||
590 | m_log.DebugFormat( | ||
591 | "[SceneObjectSerializer]: Parsing Vehicle for object part {0} {1} encountered errors. Please see earlier log entries.", | ||
592 | obj.Name, obj.UUID); | ||
593 | } | ||
594 | else | ||
595 | obj.sopVehicle = _vehicle; | ||
596 | } | ||
597 | |||
598 | |||
572 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) | 599 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) |
573 | { | 600 | { |
574 | List<string> errorNodeNames; | 601 | List<string> errorNodeNames; |
@@ -733,6 +760,16 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
733 | obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty); | 760 | obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty); |
734 | } | 761 | } |
735 | 762 | ||
763 | private static void ProcessBuoyancy(SceneObjectPart obj, XmlTextReader reader) | ||
764 | { | ||
765 | obj.Buoyancy = (int)reader.ReadElementContentAsFloat("Buoyancy", String.Empty); | ||
766 | } | ||
767 | |||
768 | private static void ProcessVolumeDetectActive(SceneObjectPart obj, XmlTextReader reader) | ||
769 | { | ||
770 | obj.VolumeDetectActive = Util.ReadBoolean(reader); | ||
771 | } | ||
772 | |||
736 | #endregion | 773 | #endregion |
737 | 774 | ||
738 | #region TaskInventoryXmlProcessors | 775 | #region TaskInventoryXmlProcessors |
@@ -1218,6 +1255,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1218 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); | 1255 | writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString()); |
1219 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); | 1256 | writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString()); |
1220 | 1257 | ||
1258 | writer.WriteElementString("Buoyancy", sop.Buoyancy.ToString()); | ||
1259 | writer.WriteElementString("VolumeDetectActive", sop.VolumeDetectActive.ToString().ToLower()); | ||
1260 | |||
1261 | //Ubit comented until proper testing | ||
1262 | if (sop.sopVehicle != null) | ||
1263 | sop.sopVehicle.ToXml2(writer); | ||
1264 | |||
1221 | writer.WriteEndElement(); | 1265 | writer.WriteEndElement(); |
1222 | } | 1266 | } |
1223 | 1267 | ||
@@ -1487,12 +1531,6 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1487 | { | 1531 | { |
1488 | TaskInventoryDictionary tinv = new TaskInventoryDictionary(); | 1532 | TaskInventoryDictionary tinv = new TaskInventoryDictionary(); |
1489 | 1533 | ||
1490 | if (reader.IsEmptyElement) | ||
1491 | { | ||
1492 | reader.Read(); | ||
1493 | return tinv; | ||
1494 | } | ||
1495 | |||
1496 | reader.ReadStartElement(name, String.Empty); | 1534 | reader.ReadStartElement(name, String.Empty); |
1497 | 1535 | ||
1498 | while (reader.Name == "TaskInventoryItem") | 1536 | while (reader.Name == "TaskInventoryItem") |