aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie2012-07-07 19:59:55 +0200
committerMelanie2012-07-07 19:59:55 +0200
commit470019b52a72de1a8777933ce3254cde87e184f9 (patch)
tree460342534e8fb1e902bbda77903a7db01a02edce /OpenSim/Region
parentMerge branch 'ubitwork' into avination (diff)
downloadopensim-SC-470019b52a72de1a8777933ce3254cde87e184f9.zip
opensim-SC-470019b52a72de1a8777933ce3254cde87e184f9.tar.gz
opensim-SC-470019b52a72de1a8777933ce3254cde87e184f9.tar.bz2
opensim-SC-470019b52a72de1a8777933ce3254cde87e184f9.tar.xz
Change semantics of FromXML on vehicle data to make the serializer a bit cleaner
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/SOPVehicle.cs15
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs11
2 files changed, 19 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
index e2ef77b..41e8944 100644
--- a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
+++ b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs
@@ -599,7 +599,20 @@ namespace OpenSim.Region.Framework.Scenes
599 return v; 599 return v;
600 } 600 }
601 601
602 public void FromXml2(XmlTextReader _reader, out bool errors) 602 public static SOPVehicle FromXml2(XmlTextReader reader)
603 {
604 SOPVehicle vehicle = new SOPVehicle();
605
606 bool errors = false;
607
608 vehicle.FromXml2(reader, out errors);
609 if (errors)
610 return null;
611
612 return vehicle;
613 }
614
615 private void FromXml2(XmlTextReader _reader, out bool errors)
603 { 616 {
604 errors = false; 617 errors = false;
605 reader = _reader; 618 reader = _reader;
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index c7e4c3e..abca14f 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -623,12 +623,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
623 623
624 private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader) 624 private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader)
625 { 625 {
626 bool errors = false; 626 SOPVehicle vehicle = SOPVehicle.FromXml2(reader);
627 SOPVehicle _vehicle = new SOPVehicle();
628 627
629 _vehicle.FromXml2(reader, out errors); 628 if (vehicle == null)
630
631 if (errors)
632 { 629 {
633 obj.VehicleParams = null; 630 obj.VehicleParams = null;
634 m_log.DebugFormat( 631 m_log.DebugFormat(
@@ -636,7 +633,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
636 obj.Name, obj.UUID); 633 obj.Name, obj.UUID);
637 } 634 }
638 else 635 else
639 obj.VehicleParams = _vehicle; 636 {
637 obj.VehicleParams = vehicle;
638 }
640 } 639 }
641 640
642 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) 641 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)