diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/LandData.cs | 33 |
1 files changed, 33 insertions, 0 deletions
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 @@ | |||
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections.Generic; | 29 | using System.Collections.Generic; |
30 | using System.Xml; | ||
31 | using System.Xml.Serialization; | ||
32 | |||
30 | using OpenMetaverse; | 33 | using OpenMetaverse; |
31 | 34 | ||
32 | namespace OpenSim.Framework | 35 | namespace OpenSim.Framework |
@@ -36,6 +39,11 @@ namespace OpenSim.Framework | |||
36 | /// </summary> | 39 | /// </summary> |
37 | public class LandData | 40 | public class LandData |
38 | { | 41 | { |
42 | // use only one serializer to give the runtime a chance to | ||
43 | // optimize it (it won't do that if you use a new instance | ||
44 | // every time) | ||
45 | private static XmlSerializer serializer = new XmlSerializer(typeof (LandData)); | ||
46 | |||
39 | private Vector3 _AABBMax = new Vector3(); | 47 | private Vector3 _AABBMax = new Vector3(); |
40 | private Vector3 _AABBMin = new Vector3(); | 48 | private Vector3 _AABBMin = new Vector3(); |
41 | private int _area = 0; | 49 | private int _area = 0; |
@@ -86,6 +94,7 @@ namespace OpenSim.Framework | |||
86 | /// <summary> | 94 | /// <summary> |
87 | /// Upper corner of the AABB for the parcel | 95 | /// Upper corner of the AABB for the parcel |
88 | /// </summary> | 96 | /// </summary> |
97 | [XmlIgnore] | ||
89 | public Vector3 AABBMax { | 98 | public Vector3 AABBMax { |
90 | get { | 99 | get { |
91 | return _AABBMax; | 100 | return _AABBMax; |
@@ -97,6 +106,7 @@ namespace OpenSim.Framework | |||
97 | /// <summary> | 106 | /// <summary> |
98 | /// Lower corner of the AABB for the parcel | 107 | /// Lower corner of the AABB for the parcel |
99 | /// </summary> | 108 | /// </summary> |
109 | [XmlIgnore] | ||
100 | public Vector3 AABBMin { | 110 | public Vector3 AABBMin { |
101 | get { | 111 | get { |
102 | return _AABBMin; | 112 | return _AABBMin; |
@@ -205,6 +215,7 @@ namespace OpenSim.Framework | |||
205 | /// <summary> | 215 | /// <summary> |
206 | /// Number of SceneObjectPart that are owned by a Group | 216 | /// Number of SceneObjectPart that are owned by a Group |
207 | /// </summary> | 217 | /// </summary> |
218 | [XmlIgnore] | ||
208 | public int GroupPrims { | 219 | public int GroupPrims { |
209 | get { | 220 | get { |
210 | return _groupPrims; | 221 | return _groupPrims; |
@@ -363,6 +374,7 @@ namespace OpenSim.Framework | |||
363 | /// Number of SceneObjectPart that are owned by users who do not own the parcel | 374 | /// Number of SceneObjectPart that are owned by users who do not own the parcel |
364 | /// and don't have the 'group. These are elegable for AutoReturn collection | 375 | /// and don't have the 'group. These are elegable for AutoReturn collection |
365 | /// </summary> | 376 | /// </summary> |
377 | [XmlIgnore] | ||
366 | public int OtherPrims { | 378 | public int OtherPrims { |
367 | get { | 379 | get { |
368 | return _otherPrims; | 380 | return _otherPrims; |
@@ -388,6 +400,7 @@ namespace OpenSim.Framework | |||
388 | /// <summary> | 400 | /// <summary> |
389 | /// Number of SceneObjectPart that are owned by the owner of the parcel | 401 | /// Number of SceneObjectPart that are owned by the owner of the parcel |
390 | /// </summary> | 402 | /// </summary> |
403 | [XmlIgnore] | ||
391 | public int OwnerPrims { | 404 | public int OwnerPrims { |
392 | get { | 405 | get { |
393 | return _ownerPrims; | 406 | return _ownerPrims; |
@@ -448,6 +461,7 @@ namespace OpenSim.Framework | |||
448 | /// <summary> | 461 | /// <summary> |
449 | /// Number of SceneObjectPart that are currently selected by avatar | 462 | /// Number of SceneObjectPart that are currently selected by avatar |
450 | /// </summary> | 463 | /// </summary> |
464 | [XmlIgnore] | ||
451 | public int SelectedPrims { | 465 | public int SelectedPrims { |
452 | get { | 466 | get { |
453 | return _selectedPrims; | 467 | return _selectedPrims; |
@@ -460,6 +474,7 @@ namespace OpenSim.Framework | |||
460 | /// <summary> | 474 | /// <summary> |
461 | /// Number of meters^2 in the Simulator | 475 | /// Number of meters^2 in the Simulator |
462 | /// </summary> | 476 | /// </summary> |
477 | [XmlIgnore] | ||
463 | public int SimwideArea { | 478 | public int SimwideArea { |
464 | get { | 479 | get { |
465 | return _simwideArea; | 480 | return _simwideArea; |
@@ -472,6 +487,7 @@ namespace OpenSim.Framework | |||
472 | /// <summary> | 487 | /// <summary> |
473 | /// Number of SceneObjectPart in the Simulator | 488 | /// Number of SceneObjectPart in the Simulator |
474 | /// </summary> | 489 | /// </summary> |
490 | [XmlIgnore] | ||
475 | public int SimwidePrims { | 491 | public int SimwidePrims { |
476 | get { | 492 | get { |
477 | return _simwidePrims; | 493 | return _simwidePrims; |
@@ -607,5 +623,22 @@ namespace OpenSim.Framework | |||
607 | 623 | ||
608 | return landData; | 624 | return landData; |
609 | } | 625 | } |
626 | |||
627 | public void ToXml(XmlWriter xmlWriter) | ||
628 | { | ||
629 | serializer.Serialize(xmlWriter, this); | ||
630 | } | ||
631 | |||
632 | /// <summary> | ||
633 | /// Restore a LandData object from the serialized xml representation. | ||
634 | /// </summary> | ||
635 | /// <param name="xmlReader"></param> | ||
636 | /// <returns></returns> | ||
637 | public static LandData FromXml(XmlReader xmlReader) | ||
638 | { | ||
639 | LandData land = (LandData)serializer.Deserialize(xmlReader); | ||
640 | |||
641 | return land; | ||
642 | } | ||
610 | } | 643 | } |
611 | } | 644 | } |