dr scofield, could we serialize/deserialize this manually, as done in
OpenSim.Framework.Serialization.External.RegionSettingsSerializer.cs?
Otherwise I fear that there will be a lot of awkardness if the external format
changes in certain ways (e.g. renaming of xml attributes).
opensim-commits-boun...@lists.berlios.de wrote:
> The branch, master has been updated
>via f23f7b1 preparing LandData seriali(s|z)ation into OAR [not yet
> functional]
> from 67f803c Add the new AuthStore to migrations. Update
> OpenSim.Server.ini
>
> Those revisions listed above that are new to this repository have
> not appeared on any other notification email; so we list those
> revisions in full, below.
>
> - Log -
>
> commit f23f7b1fc4e272a0d6796aee0ef665a4d3821cf8
> Author: dr scofield (aka dirk husemann)
> Date: Fri Sep 4 10:08:33 2009 +0200
>
> preparing LandData seriali(s|z)ation into OAR [not yet functional]
>
> f23f7b1fc4e272a0d6796aee0ef665a4d3821cf8
> diff --git a/OpenSim/Framework/LandData.cs b/OpenSim/Framework/LandData.cs
> index e639da0..071a667 100644
> --- a/OpenSim/Framework/LandData.cs
> +++ b/OpenSim/Framework/LandData.cs
> @@ -27,6 +27,9 @@
>
> using System;
> using System.Collections.Generic;
> +using System.Xml;
> +using System.Xml.Serialization;
> +
> using OpenMetaverse;
>
> namespace OpenSim.Framework
> @@ -36,6 +39,11 @@ namespace OpenSim.Framework
> ///
> public class LandData
> {
> +// use only one serializer to give the runtime a chance to
> +// optimize it (it won't do that if you use a new instance
> +// every time)
> +private static XmlSerializer serializer = new XmlSerializer(typeof
> (LandData));
> +
> private Vector3 _AABBMax = new Vector3();
> private Vector3 _AABBMin = new Vector3();
> private int _area = 0;
> @@ -86,6 +94,7 @@ namespace OpenSim.Framework
> ///
> /// Upper corner of the AABB for the parcel
> ///
> +[XmlIgnore]
> public Vector3 AABBMax {
> get {
> return _AABBMax;
> @@ -97,6 +106,7 @@ namespace OpenSim.Framework
> ///
> /// Lower corner of the AABB for the parcel
> ///
> +[XmlIgnore]
> public Vector3 AABBMin {
> get {
> return _AABBMin;
> @@ -205,6 +215,7 @@ namespace OpenSim.Framework
> ///
> /// Number of SceneObjectPart that are owned by a Group
> ///
> +[XmlIgnore]
> public int GroupPrims {
> get {
> return _groupPrims;
> @@ -363,6 +374,7 @@ namespace OpenSim.Framework
> /// Number of SceneObjectPart that are owned by users who do not own
> the parcel
> /// and don't have the 'group. These are elegable for AutoReturn
> collection
> ///
> +[XmlIgnore]
> public int OtherPrims {
> get {
> return _otherPrims;
> @@ -388,6 +400,7 @@ namespace OpenSim.Framework
> ///
> /// Number of SceneObjectPart that are owned by the owner of the
> parcel
> ///
> +[XmlIgnore]
> public int OwnerPrims {
> get {
> return _ownerPrims;
> @@ -448,6 +461,7 @@ namespace OpenSim.Framework
> ///
> /// Number of SceneObjectPart that are currently selected by avatar
> ///
> +[XmlIgnore]
> public int SelectedPrims {
> get {
> return _selectedPrims;
> @@ -460,6 +474,7 @@ namespace OpenSim.Framework
> ///
> /// Number of meters^2 in the Simulator
> ///
> +[XmlIgnore]
> public int SimwideArea {
> get {
> return _simwideArea;
> @@ -472,6 +487,7 @@ namespace OpenSim.Framework
> ///
> /// Number of SceneObjectPart in the Simulator
> ///
> +[XmlIgnore]
> public int SimwidePrims {
> get {
> return _simwidePrims;
> @@ -607,5 +623,22 @@ namespace OpenSim.Framework
>
> return landData;
> }
> +
> +public void ToXml(XmlWriter xmlWriter)
> +{
> +serializer.Serialize(xmlWriter, this);
> +}
> +
> +///
> +/// Restore a LandData object from the serialized xml representation.
> +///
> +///
> +///
> +public static LandData FromXml(XmlReader xmlReader)
> +{
> +LandData land = (LandData)serializer.Deserialize(xmlReader);
> +
> +return land;
> +}
> }
> }
>
> ---
>
> Summary of changes:
> OpenSim/Framework/LandData.cs | 33 +
> 1 files changed, 33 insertions(+), 0 deletions(-)
> ___