diff options
author | Melanie Thielker | 2008-10-04 03:47:31 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-10-04 03:47:31 +0000 |
commit | a489fdfb4f0b6a7e7ca96f944c5befaf16a5ce35 (patch) | |
tree | c34ef7dee34bd64ca8f6ea3d83f715adb2a085f1 /OpenSim/Region/DataSnapshot | |
parent | Cause "Show in search" to trigger a persistence save (diff) | |
download | opensim-SC-a489fdfb4f0b6a7e7ca96f944c5befaf16a5ce35.zip opensim-SC-a489fdfb4f0b6a7e7ca96f944c5befaf16a5ce35.tar.gz opensim-SC-a489fdfb4f0b6a7e7ca96f944c5befaf16a5ce35.tar.bz2 opensim-SC-a489fdfb4f0b6a7e7ca96f944c5befaf16a5ce35.tar.xz |
Add some needed fields to data snapshot
Diffstat (limited to 'OpenSim/Region/DataSnapshot')
-rw-r--r-- | OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 45 |
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; | |||
31 | using System.Xml; | 31 | using System.Xml; |
32 | using log4net; | 32 | using log4net; |
33 | using OpenSim.Region.DataSnapshot.Interfaces; | 33 | using OpenSim.Region.DataSnapshot.Interfaces; |
34 | using OpenSim.Region.Environment.Interfaces; | ||
34 | using OpenSim.Region.Environment.Scenes; | 35 | using OpenSim.Region.Environment.Scenes; |
36 | using OpenSim.Region.Environment.Modules.World.Land; | ||
35 | using OpenSim.Framework; | 37 | using OpenSim.Framework; |
36 | using OpenMetaverse; | 38 | using 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 | } |