aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-05-27 20:59:35 +0100
committerJustin Clark-Casey (justincc)2011-05-27 20:59:35 +0100
commit4e4db749eb74bf02ae956c4a9461499988f0f0ec (patch)
tree4212cb3d35888fbe9a63da7bd5edadd47558bffc /OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
parentWhen saving an iar, don't chase down link asset IDs (since these points to ot... (diff)
downloadopensim-SC_OLD-4e4db749eb74bf02ae956c4a9461499988f0f0ec.zip
opensim-SC_OLD-4e4db749eb74bf02ae956c4a9461499988f0f0ec.tar.gz
opensim-SC_OLD-4e4db749eb74bf02ae956c4a9461499988f0f0ec.tar.bz2
opensim-SC_OLD-4e4db749eb74bf02ae956c4a9461499988f0f0ec.tar.xz
If parsing fails in the primitive base shape (which prints out a debug log message), also print out the name and uuid of the part containing this shape.
This is to help in diagnosing parsing failures.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs29
1 files changed, 25 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 872816c..47af0dd 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -570,7 +570,13 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
570 570
571 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) 571 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
572 { 572 {
573 obj.Shape = ReadShape(reader, "Shape"); 573 bool errors = false;
574 obj.Shape = ReadShape(reader, "Shape", out errors);
575
576 if (errors)
577 m_log.DebugFormat(
578 "[SceneObjectSerializer]: Parsing PrimitiveBaseShape for object part {0} {1} encountered errors. Please see earlier log entries.",
579 obj.Name, obj.UUID);
574 } 580 }
575 581
576 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) 582 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
@@ -1470,7 +1476,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1470 } 1476 }
1471 catch (Exception e) 1477 catch (Exception e)
1472 { 1478 {
1473 m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing {0}: {1}", nodeName, e); 1479 m_log.DebugFormat(
1480 "[SceneObjectSerializer]: exception while parsing {0} in object {1} {2}: {3}{4}",
1481 obj.Name, obj.UUID, nodeName, e.Message, e.StackTrace);
1474 if (reader.NodeType == XmlNodeType.EndElement) 1482 if (reader.NodeType == XmlNodeType.EndElement)
1475 reader.Read(); 1483 reader.Read();
1476 } 1484 }
@@ -1528,8 +1536,17 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1528 return tinv; 1536 return tinv;
1529 } 1537 }
1530 1538
1531 static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name) 1539 /// <summary>
1540 /// Read a shape from xml input
1541 /// </summary>
1542 /// <param name="reader"></param>
1543 /// <param name="name">The name of the xml element containing the shape</param>
1544 /// <param name="errors">true if any errors were encountered during parsing, false otherwise</param>
1545 /// <returns>The shape parsed</returns>
1546 static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out bool errors)
1532 { 1547 {
1548 errors = false;
1549
1533 PrimitiveBaseShape shape = new PrimitiveBaseShape(); 1550 PrimitiveBaseShape shape = new PrimitiveBaseShape();
1534 1551
1535 if (reader.IsEmptyElement) 1552 if (reader.IsEmptyElement)
@@ -1554,7 +1571,11 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1554 } 1571 }
1555 catch (Exception e) 1572 catch (Exception e)
1556 { 1573 {
1557 m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing Shape {0}: {1}", nodeName, e); 1574 errors = true;
1575 m_log.DebugFormat(
1576 "[SceneObjectSerializer]: exception while parsing Shape property {0}: {1}{2}",
1577 nodeName, e.Message, e.StackTrace);
1578
1558 if (reader.NodeType == XmlNodeType.EndElement) 1579 if (reader.NodeType == XmlNodeType.EndElement)
1559 reader.Read(); 1580 reader.Read();
1560 } 1581 }