aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index ed087a4..9afe8cd 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -398,10 +398,7 @@ namespace OpenSim.Region.Environment.Scenes
398 reader.Read(); 398 reader.Read();
399 reader.ReadStartElement("SceneObjectGroup"); 399 reader.ReadStartElement("SceneObjectGroup");
400 reader.ReadStartElement("RootPart"); 400 reader.ReadStartElement("RootPart");
401 m_rootPart = SceneObjectPart.FromXml(reader); 401 SetRootPart(SceneObjectPart.FromXml(reader));
402 int linkNum = m_rootPart.LinkNum;
403 AddPart(m_rootPart);
404 m_rootPart.LinkNum = linkNum;
405 402
406 reader.ReadEndElement(); 403 reader.ReadEndElement();
407 404
@@ -414,7 +411,9 @@ namespace OpenSim.Region.Environment.Scenes
414 { 411 {
415 reader.Read(); 412 reader.Read();
416 SceneObjectPart part = SceneObjectPart.FromXml(reader); 413 SceneObjectPart part = SceneObjectPart.FromXml(reader);
417 linkNum = part.LinkNum; 414
415 // We reset the link number in order to make sure that the persisted linkset order is
416 int linkNum = part.LinkNum;
418 AddPart(part); 417 AddPart(part);
419 part.LinkNum = linkNum; 418 part.LinkNum = linkNum;
420 419
@@ -428,11 +427,9 @@ namespace OpenSim.Region.Environment.Scenes
428 } 427 }
429 } 428 }
430 } 429 }
431 catch (XmlException) 430 catch (XmlException e)
432 { 431 {
433 m_log.ErrorFormat("[SCENE OBJECT GROUP]: Deserialization of following xml failed, {0}", xmlData); 432 m_log.ErrorFormat("[SCENE]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData);
434
435 // Let's see if carrying on does anything for us
436 } 433 }
437 434
438 reader.Close(); 435 reader.Close();
@@ -885,6 +882,9 @@ namespace OpenSim.Region.Environment.Scenes
885 part.ParentID = 0; 882 part.ParentID = 0;
886 part.LinkNum = 0; 883 part.LinkNum = 0;
887 m_rootPart = part; 884 m_rootPart = part;
885
886 // No locking required since the SOG should not be in the scene yet - one can't change root parts after
887 // the scene object has been attached to the scene
888 m_parts.Add(m_rootPart.UUID, m_rootPart); 888 m_parts.Add(m_rootPart.UUID, m_rootPart);
889 } 889 }
890 890
@@ -1460,6 +1460,12 @@ namespace OpenSim.Region.Environment.Scenes
1460 } 1460 }
1461 } 1461 }
1462 1462
1463 /// <summary>
1464 /// Set the owner of the root part.
1465 /// </summary>
1466 /// <param name="part"></param>
1467 /// <param name="cAgentID"></param>
1468 /// <param name="cGroupID"></param>
1463 public void SetRootPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID) 1469 public void SetRootPartOwner(SceneObjectPart part, UUID cAgentID, UUID cGroupID)
1464 { 1470 {
1465 part.LastOwnerID = part.OwnerID; 1471 part.LastOwnerID = part.OwnerID;