aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/LandData.cs
diff options
context:
space:
mode:
authordr scofield (aka dirk husemann)2009-09-04 10:08:33 +0200
committerdr scofield (aka dirk husemann)2009-09-04 10:12:36 +0200
commitf23f7b1fc4e272a0d6796aee0ef665a4d3821cf8 (patch)
treec63b750b5fae109d7c8168caad7a719045d843b9 /OpenSim/Framework/LandData.cs
parentAdd the new AuthStore to migrations. Update OpenSim.Server.ini (diff)
downloadopensim-SC_OLD-f23f7b1fc4e272a0d6796aee0ef665a4d3821cf8.zip
opensim-SC_OLD-f23f7b1fc4e272a0d6796aee0ef665a4d3821cf8.tar.gz
opensim-SC_OLD-f23f7b1fc4e272a0d6796aee0ef665a4d3821cf8.tar.bz2
opensim-SC_OLD-f23f7b1fc4e272a0d6796aee0ef665a4d3821cf8.tar.xz
preparing LandData seriali(s|z)ation into OAR [not yet functional]
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/LandData.cs33
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
28using System; 28using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Xml;
31using System.Xml.Serialization;
32
30using OpenMetaverse; 33using OpenMetaverse;
31 34
32namespace OpenSim.Framework 35namespace 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}