aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs40
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 4b80e37..19cb9fb 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Drawing; 30using System.Drawing;
31using System.IO; 31using System.IO;
32using System.Linq;
32using System.Reflection; 33using System.Reflection;
33using System.Xml; 34using System.Xml;
34using log4net; 35using log4net;
@@ -573,13 +574,15 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
573 574
574 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) 575 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
575 { 576 {
576 bool errors = false; 577 List<string> errorNodeNames;
577 obj.Shape = ReadShape(reader, "Shape", out errors); 578 obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
578 579
579 if (errors) 580 if (errorNodeNames != null)
581 {
580 m_log.DebugFormat( 582 m_log.DebugFormat(
581 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.", 583 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors in properties {2}.",
582 obj.Name, obj.UUID); 584 obj.Name, obj.UUID, string.Join(", ", errorNodeNames.ToArray()));
585 }
583 } 586 }
584 587
585 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) 588 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@@ -1529,31 +1532,44 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1529 /// </summary> 1532 /// </summary>
1530 /// <param name="reader"></param> 1533 /// <param name="reader"></param>
1531 /// <param name="name">The name of the xml element containing the shape</param> 1534 /// <param name="name">The name of the xml element containing the shape</param>
1532 /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param> 1535 /// <param name="errors">a list containing the failing node names. If no failures then null.</param>
1533 /// <returns>The shape parsed</returns> 1536 /// <returns>The shape parsed</returns>
1534 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors) 1537 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames)
1535 { 1538 {
1536 errors = false; 1539 List<string> internalErrorNodeNames = null;
1537 1540
1538 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 1541 PrimitiveBaseShape shape = new PrimitiveBaseShape();
1539 1542
1543 if (reader.IsEmptyElement)
1544 {
1545 reader.Read();
1546 errorNodeNames = null;
1547 return shape;
1548 }
1549
1540 reader.ReadStartElement(name, String.Empty); // Shape 1550 reader.ReadStartElement(name, String.Empty); // Shape
1541 1551
1542 errors = ExternalRepresentationUtils.ExecuteReadProcessors( 1552 ExternalRepresentationUtils.ExecuteReadProcessors(
1543 shape, 1553 shape,
1544 m_ShapeXmlProcessors, 1554 m_ShapeXmlProcessors,
1545 reader, 1555 reader,
1546 (o, nodeName, e) 1556 (o, nodeName, e)
1547 => 1557 =>
1548 { 1558 {
1549 m_log.DebugFormat( 1559// m_log.DebugFormat(
1550 "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}", 1560// "[SceneObjectSerializer]: Exception while parsing Shape property {0}: {1}{2}",
1551 nodeName, e.Message, e.StackTrace); 1561// nodeName, e.Message, e.StackTrace);
1562 if (internalErrorNodeNames == null)
1563 internalErrorNodeNames = new List<string>();
1564
1565 internalErrorNodeNames.Add(nodeName);
1552 } 1566 }
1553 ); 1567 );
1554 1568
1555 reader.ReadEndElement(); // Shape 1569 reader.ReadEndElement(); // Shape
1556 1570
1571 errorNodeNames = internalErrorNodeNames;
1572
1557 return shape; 1573 return shape;
1558 } 1574 }
1559 1575