diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs index eaf32b8..9f6dabb 100644 --- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs +++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs | |||
@@ -29,6 +29,7 @@ using System; | |||
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Drawing; | 30 | using System.Drawing; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Linq; | ||
32 | using System.Reflection; | 33 | using System.Reflection; |
33 | using System.Xml; | 34 | using System.Xml; |
34 | using log4net; | 35 | using log4net; |
@@ -597,13 +598,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
597 | 598 | ||
598 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) | 599 | private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) |
599 | { | 600 | { |
600 | bool errors = false; | 601 | List<string> errorNodeNames; |
601 | obj.Shape = ReadShape(reader, "Shape", out errors); | 602 | obj.Shape = ReadShape(reader, "Shape", out errorNodeNames); |
602 | 603 | ||
603 | if (errors) | 604 | if (errorNodeNames != null) |
605 | { | ||
604 | m_log.DebugFormat( | 606 | m_log.DebugFormat( |
605 | "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.", | 607 | "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.", |
606 | obj.Name, obj.UUID); | 608 | obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray())); |
609 | } | ||
607 | } | 610 | } |
608 | 611 | ||
609 | private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) | 612 | private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) |
@@ -1557,31 +1560,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization | |||
1557 | /// </summary> | 1560 | /// </summary> |
1558 | /// <param name="reader"></param> | 1561 | /// <param name="reader"></param> |
1559 | /// <param name="name">The name of the xml element containing the shape</param> | 1562 | /// <param name="name">The name of the xml element containing the shape</param> |
1560 | /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> | 1563 | /// <param name="errors">a list containing the failing node names. If no failures then null.</param> |
1561 | /// <returns>The shape parsed</returns> | 1564 | /// <returns>The shape parsed</returns> |
1562 | public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) | 1565 | public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames) |
1563 | { | 1566 | { |
1564 | errors = false; | 1567 | List<string> internalErrorNodeNames = null; |
1565 | 1568 | ||
1566 | PrimitiveBaseShape shape = new PrimitiveBaseShape(); | 1569 | PrimitiveBaseShape shape = new PrimitiveBaseShape(); |
1567 | 1570 | ||
1571 | if (reader.IsEmptyElement) | ||
1572 | { | ||
1573 | reader.Read(); | ||
1574 | errorNodeNames = null; | ||
1575 | return shape; | ||
1576 | } | ||
1577 | |||
1568 | reader.ReadStartElement(name, String.Empty); // Shape | 1578 | reader.ReadStartElement(name, String.Empty); // Shape |
1569 | 1579 | ||
1570 | errors = ExternalRepresentationUtils.ExecuteReadProcessors( | 1580 | ExternalRepresentationUtils.ExecuteReadProcessors( |
1571 | shape, | 1581 | shape, |
1572 | m_ShapeXmlProcessors, | 1582 | m_ShapeXmlProcessors, |
1573 | reader, | 1583 | reader, |
1574 | (o, nodeName, e) | 1584 | (o, nodeName, e) |
1575 | => | 1585 | => |
1576 | { | 1586 | { |
1577 | m_log.DebugFormat( | 1587 | // m_log.DebugFormat( |
1578 | "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", | 1588 | // "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", |
1579 | nodeName, e.Message, e.StackTrace); | 1589 | // nodeName, e.Message, e.StackTrace); |
1590 | if (internalErrorNodeNames == null) | ||
1591 | internalErrorNodeNames = new List<string>(); | ||
1592 | |||
1593 | internalErrorNodeNames.Add(nodeName); | ||
1580 | } | 1594 | } |
1581 | ); | 1595 | ); |
1582 | 1596 | ||
1583 | reader.ReadEndElement(); // Shape | 1597 | reader.ReadEndElement(); // Shape |
1584 | 1598 | ||
1599 | errorNodeNames = internalErrorNodeNames; | ||
1600 | |||
1585 | return shape; | 1601 | return shape; |
1586 | } | 1602 | } |
1587 | 1603 | ||