aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot/LandSnapshot.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/DataSnapshot/LandSnapshot.cs')
-rw-r--r--OpenSim/Region/DataSnapshot/LandSnapshot.cs28
1 files changed, 11 insertions, 17 deletions
diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
index b0ba29d..dc7ef8c 100644
--- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs
@@ -119,28 +119,22 @@ namespace OpenSim.Region.DataSnapshot.Providers
119 119
120 public XmlNode RequestSnapshotData(XmlDocument nodeFactory) 120 public XmlNode RequestSnapshotData(XmlDocument nodeFactory)
121 { 121 {
122 ILandChannel landChannel = (LandChannel)m_scene.LandChannel; 122 ILandChannel landChannel = m_scene.LandChannel;
123 Dictionary<int, ILandObject> landList = null; 123 List<ILandObject> parcels = landChannel.AllParcels();
124 try 124
125 {
126 Type landChannelType = typeof(LandChannel);
127 FieldInfo landListField = landChannelType.GetField("landList", BindingFlags.NonPublic | BindingFlags.Instance);
128 if (landListField != null)
129 {
130 landList = (Dictionary<int, ILandObject>)landListField.GetValue(landChannel);
131 }
132 }
133 catch (Exception e)
134 {
135 m_log.Error("[DATASNAPSHOT] couldn't access field reflectively\n" + e.ToString());
136 }
137 XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", ""); 125 XmlNode parent = nodeFactory.CreateNode(XmlNodeType.Element, "parceldata", "");
138 if (landList != null) 126 if (parcels != null)
139 { 127 {
140 128
141 //foreach (KeyValuePair<int, Land> curParcel in m_landIndexed) 129 //foreach (KeyValuePair<int, Land> curParcel in m_landIndexed)
142 foreach (LandObject land in landList.Values) 130 foreach (ILandObject parcel_interface in parcels)
143 { 131 {
132 // Play it safe
133 if (!(parcel_interface is LandObject))
134 continue;
135
136 LandObject land = (LandObject)parcel_interface;
137
144 LandData parcel = land.landData; 138 LandData parcel = land.landData;
145 if ((parcel.Flags & (uint)Parcel.ParcelFlags.ShowDirectory) == (uint)Parcel.ParcelFlags.ShowDirectory) 139 if ((parcel.Flags & (uint)Parcel.ParcelFlags.ShowDirectory) == (uint)Parcel.ParcelFlags.ShowDirectory)
146 { 140 {