Change semantics of FromXML on vehicle data to make the serializer a bit cleaner
parent
6d5693a866
commit
470019b52a
|
@ -599,7 +599,20 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FromXml2(XmlTextReader _reader, out bool errors)
|
public static SOPVehicle FromXml2(XmlTextReader reader)
|
||||||
|
{
|
||||||
|
SOPVehicle vehicle = new SOPVehicle();
|
||||||
|
|
||||||
|
bool errors = false;
|
||||||
|
|
||||||
|
vehicle.FromXml2(reader, out errors);
|
||||||
|
if (errors)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
return vehicle;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FromXml2(XmlTextReader _reader, out bool errors)
|
||||||
{
|
{
|
||||||
errors = false;
|
errors = false;
|
||||||
reader = _reader;
|
reader = _reader;
|
||||||
|
|
|
@ -623,12 +623,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
|
|
||||||
private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessVehicle(SceneObjectPart obj, XmlTextReader reader)
|
||||||
{
|
{
|
||||||
bool errors = false;
|
SOPVehicle vehicle = SOPVehicle.FromXml2(reader);
|
||||||
SOPVehicle _vehicle = new SOPVehicle();
|
|
||||||
|
|
||||||
_vehicle.FromXml2(reader, out errors);
|
if (vehicle == null)
|
||||||
|
|
||||||
if (errors)
|
|
||||||
{
|
{
|
||||||
obj.VehicleParams = null;
|
obj.VehicleParams = null;
|
||||||
m_log.DebugFormat(
|
m_log.DebugFormat(
|
||||||
|
@ -636,7 +633,9 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
|
||||||
obj.Name, obj.UUID);
|
obj.Name, obj.UUID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
obj.VehicleParams = _vehicle;
|
{
|
||||||
|
obj.VehicleParams = vehicle;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
|
private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
|
||||||
|
|
Loading…
Reference in New Issue