diff options
author | Melanie | 2012-07-07 02:05:01 +0200 |
---|---|---|
committer | Melanie | 2012-07-07 02:05:01 +0200 |
commit | 6535f23e4b8fec9578dae5275db69b237a99e498 (patch) | |
tree | fcf5495a3ebc005812c377076def18d1bafa5bab /OpenSim/Region/Framework/Scenes/SOPVehicle.cs | |
parent | added llSetVelocity. will refuse to work on vehicles and on attachments ( th... (diff) | |
download | opensim-SC-6535f23e4b8fec9578dae5275db69b237a99e498.zip opensim-SC-6535f23e4b8fec9578dae5275db69b237a99e498.tar.gz opensim-SC-6535f23e4b8fec9578dae5275db69b237a99e498.tar.bz2 opensim-SC-6535f23e4b8fec9578dae5275db69b237a99e498.tar.xz |
Add saving vehicle physics data to the database
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SOPVehicle.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SOPVehicle.cs | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs index d3c2d27..45ca00c 100644 --- a/OpenSim/Region/Framework/Scenes/SOPVehicle.cs +++ b/OpenSim/Region/Framework/Scenes/SOPVehicle.cs | |||
@@ -30,6 +30,8 @@ using System.Collections.Generic; | |||
30 | using OpenMetaverse; | 30 | using OpenMetaverse; |
31 | using OpenSim.Framework; | 31 | using OpenSim.Framework; |
32 | using OpenSim.Region.Physics.Manager; | 32 | using OpenSim.Region.Physics.Manager; |
33 | using System.Text; | ||
34 | using System.IO; | ||
33 | using System.Xml; | 35 | using System.Xml; |
34 | using OpenSim.Framework.Serialization; | 36 | using OpenSim.Framework.Serialization; |
35 | using OpenSim.Framework.Serialization.External; | 37 | using OpenSim.Framework.Serialization.External; |
@@ -561,6 +563,35 @@ namespace OpenSim.Region.Framework.Scenes | |||
561 | } | 563 | } |
562 | 564 | ||
563 | 565 | ||
566 | public string ToXml2() | ||
567 | { | ||
568 | MemoryStream ms = new MemoryStream(); | ||
569 | UTF8Encoding enc = new UTF8Encoding(); | ||
570 | XmlTextWriter writer = new XmlTextWriter(ms, null); | ||
571 | ToXml2(writer); | ||
572 | return enc.GetString(ms.ToArray()); | ||
573 | } | ||
574 | |||
575 | public static SOPVehicle FromXml2(string text) | ||
576 | { | ||
577 | if (text == String.Empty) | ||
578 | return null; | ||
579 | UTF8Encoding enc = new UTF8Encoding(); | ||
580 | MemoryStream ms = new MemoryStream(enc.GetBytes(text)); | ||
581 | XmlTextReader reader = new XmlTextReader(ms); | ||
582 | |||
583 | SOPVehicle v = new SOPVehicle(); | ||
584 | bool error; | ||
585 | |||
586 | v.FromXml2(reader, out error); | ||
587 | if (error) | ||
588 | { | ||
589 | v = null; | ||
590 | return null; | ||
591 | } | ||
592 | |||
593 | return v; | ||
594 | } | ||
564 | 595 | ||
565 | public void FromXml2(XmlTextReader _reader, out bool errors) | 596 | public void FromXml2(XmlTextReader _reader, out bool errors) |
566 | { | 597 | { |
@@ -739,4 +770,4 @@ namespace OpenSim.Region.Framework.Scenes | |||
739 | vd.m_referenceFrame = XRquat(); | 770 | vd.m_referenceFrame = XRquat(); |
740 | } | 771 | } |
741 | } | 772 | } |
742 | } \ No newline at end of file | 773 | } |