aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorDiva Canto2010-10-23 20:39:41 -0700
committerDiva Canto2010-10-23 20:39:41 -0700
commit627d1a42fe11937a1c35659ca0fad6f89754f654 (patch)
tree4feea909350736f7335f9943c21bfb4609811cea /OpenSim
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC-627d1a42fe11937a1c35659ca0fad6f89754f654.zip
opensim-SC-627d1a42fe11937a1c35659ca0fad6f89754f654.tar.gz
opensim-SC-627d1a42fe11937a1c35659ca0fad6f89754f654.tar.bz2
opensim-SC-627d1a42fe11937a1c35659ca0fad6f89754f654.tar.xz
Added inner exception handling in Shape deserialization processing, so that the whole Shape processing returns a valid Shape object.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs19
1 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 044b599..95908fc 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -1426,7 +1426,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1426 1426
1427 reader.ReadStartElement(name); 1427 reader.ReadStartElement(name);
1428 vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x 1428 vec.X = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // X or x
1429 vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or Y 1429 vec.Y = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Y or y
1430 vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z 1430 vec.Z = reader.ReadElementContentAsFloat(reader.Name, String.Empty); // Z or z
1431 reader.ReadEndElement(); 1431 reader.ReadEndElement();
1432 1432
@@ -1501,15 +1501,28 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1501 1501
1502 reader.ReadStartElement(name, String.Empty); // Shape 1502 reader.ReadStartElement(name, String.Empty); // Shape
1503 1503
1504 string nodeName = string.Empty;
1504 while (reader.NodeType != XmlNodeType.EndElement) 1505 while (reader.NodeType != XmlNodeType.EndElement)
1505 { 1506 {
1507 nodeName = reader.Name;
1506 //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name); 1508 //m_log.DebugFormat("[XXX] Processing: {0}", reader.Name);
1507 ShapeXmlProcessor p = null; 1509 ShapeXmlProcessor p = null;
1508 if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p)) 1510 if (m_ShapeXmlProcessors.TryGetValue(reader.Name, out p))
1509 p(shape, reader); 1511 {
1512 try
1513 {
1514 p(shape, reader);
1515 }
1516 catch (Exception e)
1517 {
1518 m_log.DebugFormat("[SceneObjectSerializer]: exception while parsing Shape {0}: {1}", nodeName, e);
1519 if (reader.NodeType == XmlNodeType.EndElement)
1520 reader.Read();
1521 }
1522 }
1510 else 1523 else
1511 { 1524 {
1512// m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name); 1525 // m_log.DebugFormat("[SceneObjectSerializer]: caught unknown element in Shape {0}", reader.Name);
1513 reader.ReadOuterXml(); 1526 reader.ReadOuterXml();
1514 } 1527 }
1515 } 1528 }