aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs45
1 files changed, 23 insertions, 22 deletions
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index f67eeeb..f5ec6c7 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -31,7 +31,9 @@ using System.Reflection;
31using System.Xml; 31using System.Xml;
32using log4net; 32using log4net;
33using OpenSim.Region.DataSnapshot.Interfaces; 33using OpenSim.Region.DataSnapshot.Interfaces;
34using OpenSim.Region.Environment.Interfaces;
34using OpenSim.Region.Environment.Scenes; 35using OpenSim.Region.Environment.Scenes;
36using OpenSim.Region.Environment.Modules.World.Land;
35using OpenSim.Framework; 37using OpenSim.Framework;
36using OpenMetaverse; 38using OpenMetaverse;
37 39
@@ -103,34 +105,24 @@ namespace OpenSim.Region.DataSnapshot.Providers
103 { 105 {
104 SceneObjectGroup obj = (SceneObjectGroup)entity; 106 SceneObjectGroup obj = (SceneObjectGroup)entity;
105 107
106 m_log.Debug("[DATASNAPSHOT]: Found object " + obj.Name + " in scene"); 108// m_log.Debug("[DATASNAPSHOT]: Found object " + obj.Name + " in scene");
107 109
108 // libomv will complain about PrimFlags.JointWheel 110 // libomv will complain about PrimFlags.JointWheel
109 // being obsolete, so we... 111 // being obsolete, so we...
110 #pragma warning disable 0612 112 #pragma warning disable 0612
111 if ((obj.RootPart.Flags & PrimFlags.JointWheel) == PrimFlags.JointWheel) { 113 if ((obj.RootPart.Flags & PrimFlags.JointWheel) == PrimFlags.JointWheel)
112 XmlNode xmlobject = nodeFactory.CreateNode(XmlNodeType.Element, "object", ""); 114 {
115 SceneObjectPart m_rootPart = obj.RootPart;
113 116
114 node = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", "");
115 node.InnerText = obj.UUID.ToString();
116 xmlobject.AppendChild(node);
117
118 SceneObjectPart m_rootPart = null;
119 try
120 {
121 Type sog = typeof(SceneObjectGroup);
122 FieldInfo rootField = sog.GetField("m_rootPart", BindingFlags.NonPublic | BindingFlags.Instance);
123 if (rootField != null)
124 {
125 m_rootPart = (SceneObjectPart)rootField.GetValue(obj);
126 }
127 }
128 catch (Exception e)
129 {
130 Console.WriteLine("[DATASNAPSHOT] couldn't access field reflectively\n" + e.ToString());
131 }
132 if (m_rootPart != null) 117 if (m_rootPart != null)
133 { 118 {
119 ILandObject land = m_scene.LandChannel.GetLandObject(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y);
120
121 XmlNode xmlobject = nodeFactory.CreateNode(XmlNodeType.Element, "object", "");
122 node = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", "");
123 node.InnerText = obj.UUID.ToString();
124 xmlobject.AppendChild(node);
125
134 node = nodeFactory.CreateNode(XmlNodeType.Element, "title", ""); 126 node = nodeFactory.CreateNode(XmlNodeType.Element, "title", "");
135 node.InnerText = m_rootPart.Name; 127 node.InnerText = m_rootPart.Name;
136 xmlobject.AppendChild(node); 128 xmlobject.AppendChild(node);
@@ -142,8 +134,17 @@ namespace OpenSim.Region.DataSnapshot.Providers
142 node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", ""); 134 node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", "");
143 node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags); 135 node.InnerText = String.Format("{0:x}", m_rootPart.ObjectFlags);
144 xmlobject.AppendChild(node); 136 xmlobject.AppendChild(node);
137
138 node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", "");
139 node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString();
140 xmlobject.AppendChild(node);
141
142 node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", "");
143 node.InnerText = land.landData.GlobalID.ToString();
144 xmlobject.AppendChild(node);
145
146 parent.AppendChild(xmlobject);
145 } 147 }
146 parent.AppendChild(xmlobject);
147 } 148 }
148 #pragma warning disable 0612 149 #pragma warning disable 0612
149 } 150 }