aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-09-01 02:09:41 +0100
committerJustin Clark-Casey (justincc)2011-09-01 02:11:00 +0100
commit7eca929686bd2db1cb42f5c9740fd1d186cdc8b1 (patch)
tree775f07f365acb56bc6043831d5832c2dac468ade /OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
parentrefactor: use ParentGroup.UUID directly instead of SOP.GetRootPartUUID() (diff)
downloadopensim-SC_OLD-7eca929686bd2db1cb42f5c9740fd1d186cdc8b1.zip
opensim-SC_OLD-7eca929686bd2db1cb42f5c9740fd1d186cdc8b1.tar.gz
opensim-SC_OLD-7eca929686bd2db1cb42f5c9740fd1d186cdc8b1.tar.bz2
opensim-SC_OLD-7eca929686bd2db1cb42f5c9740fd1d186cdc8b1.tar.xz
Eliminate pointless checks of SOG.RootPart != null
It's never possible for SOG to have no RootPart, except in the first few picosends of the big bang when it's pulled from region persistence or deserialized
Diffstat (limited to 'OpenSim/Region/DataSnapshot/ObjectSnapshot.cs')
-rw-r--r--OpenSim/Region/DataSnapshot/ObjectSnapshot.cs83
1 files changed, 40 insertions, 43 deletions
diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
index 5e75cae..0bb4044 100644
--- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
+++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs
@@ -118,59 +118,56 @@ namespace OpenSim.Region.DataSnapshot.Providers
118 { 118 {
119 SceneObjectPart m_rootPart = obj.RootPart; 119 SceneObjectPart m_rootPart = obj.RootPart;
120 120
121 if (m_rootPart != null) 121 ILandObject land = m_scene.LandChannel.GetLandObject(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y);
122 {
123 ILandObject land = m_scene.LandChannel.GetLandObject(m_rootPart.AbsolutePosition.X, m_rootPart.AbsolutePosition.Y);
124 122
125 XmlNode xmlobject = nodeFactory.CreateNode(XmlNodeType.Element, "object", ""); 123 XmlNode xmlobject = nodeFactory.CreateNode(XmlNodeType.Element, "object", "");
126 node = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", ""); 124 node = nodeFactory.CreateNode(XmlNodeType.Element, "uuid", "");
127 node.InnerText = obj.UUID.ToString(); 125 node.InnerText = obj.UUID.ToString();
128 xmlobject.AppendChild(node); 126 xmlobject.AppendChild(node);
129 127
130 node = nodeFactory.CreateNode(XmlNodeType.Element, "title", ""); 128 node = nodeFactory.CreateNode(XmlNodeType.Element, "title", "");
131 node.InnerText = m_rootPart.Name; 129 node.InnerText = m_rootPart.Name;
132 xmlobject.AppendChild(node); 130 xmlobject.AppendChild(node);
133
134 node = nodeFactory.CreateNode(XmlNodeType.Element, "description", "");
135 node.InnerText = m_rootPart.Description;
136 xmlobject.AppendChild(node);
137 131
138 node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", ""); 132 node = nodeFactory.CreateNode(XmlNodeType.Element, "description", "");
139 node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags); 133 node.InnerText = m_rootPart.Description;
140 xmlobject.AppendChild(node); 134 xmlobject.AppendChild(node);
141 135
142 node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", ""); 136 node = nodeFactory.CreateNode(XmlNodeType.Element, "flags", "");
143 node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString(); 137 node.InnerText = String.Format("{0:x}", (uint)m_rootPart.Flags);
144 xmlobject.AppendChild(node); 138 xmlobject.AppendChild(node);
145 139
146 if (land != null && land.LandData != null) 140 node = nodeFactory.CreateNode(XmlNodeType.Element, "regionuuid", "");
147 { 141 node.InnerText = m_scene.RegionInfo.RegionSettings.RegionUUID.ToString();
148 node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", ""); 142 xmlobject.AppendChild(node);
149 node.InnerText = land.LandData.GlobalID.ToString();
150 xmlobject.AppendChild(node);
151 }
152 else
153 {
154 // Something is wrong with this object. Let's not list it.
155 m_log.WarnFormat("[DATASNAPSHOT]: Bad data for object {0} ({1}) in region {2}", obj.Name, obj.UUID, m_scene.RegionInfo.RegionName);
156 continue;
157 }
158 143
159 node = nodeFactory.CreateNode(XmlNodeType.Element, "location", ""); 144 if (land != null && land.LandData != null)
160 Vector3 loc = obj.AbsolutePosition; 145 {
161 node.InnerText = loc.X.ToString() + "/" + loc.Y.ToString() + "/" + loc.Z.ToString(); 146 node = nodeFactory.CreateNode(XmlNodeType.Element, "parceluuid", "");
147 node.InnerText = land.LandData.GlobalID.ToString();
162 xmlobject.AppendChild(node); 148 xmlobject.AppendChild(node);
149 }
150 else
151 {
152 // Something is wrong with this object. Let's not list it.
153 m_log.WarnFormat("[DATASNAPSHOT]: Bad data for object {0} ({1}) in region {2}", obj.Name, obj.UUID, m_scene.RegionInfo.RegionName);
154 continue;
155 }
163 156
164 string bestImage = GuessImage(obj); 157 node = nodeFactory.CreateNode(XmlNodeType.Element, "location", "");
165 if (bestImage != string.Empty) 158 Vector3 loc = obj.AbsolutePosition;
166 { 159 node.InnerText = loc.X.ToString() + "/" + loc.Y.ToString() + "/" + loc.Z.ToString();
167 node = nodeFactory.CreateNode(XmlNodeType.Element, "image", ""); 160 xmlobject.AppendChild(node);
168 node.InnerText = bestImage;
169 xmlobject.AppendChild(node);
170 }
171 161
172 parent.AppendChild(xmlobject); 162 string bestImage = GuessImage(obj);
163 if (bestImage != string.Empty)
164 {
165 node = nodeFactory.CreateNode(XmlNodeType.Element, "image", "");
166 node.InnerText = bestImage;
167 xmlobject.AppendChild(node);
173 } 168 }
169
170 parent.AppendChild(xmlobject);
174 } 171 }
175 #pragma warning disable 0612 172 #pragma warning disable 0612
176 } 173 }