aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs15
-rw-r--r--OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs1
-rw-r--r--OpenSim/Region/Environment/Scenes/EntityBase.cs9
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs11
6 files changed, 40 insertions, 14 deletions
diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
index 6e53f28..d2b8018 100644
--- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
+++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveReadRequest.cs
@@ -31,6 +31,7 @@ using OpenSim.Region.Environment.Modules.World.Serialiser;
31using System; 31using System;
32using System.IO; 32using System.IO;
33using System.Reflection; 33using System.Reflection;
34using System.Xml;
34using libsecondlife; 35using libsecondlife;
35using log4net; 36using log4net;
36 37
@@ -101,6 +102,20 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver
101 m_log.InfoFormat("[ARCHIVER]: Loading prim data"); 102 m_log.InfoFormat("[ARCHIVER]: Loading prim data");
102 103
103 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>(); 104 IRegionSerialiser serialiser = m_scene.RequestModuleInterface<IRegionSerialiser>();
105
106 // Temporary code to read each sog in the file separately, pending actually having these in separate files
107// XmlTextReader xtr = new XmlTextReader(new StringReader(serializedPrims));
108// XmlDocument doc = new XmlDocument();
109// reader.WhitespaceHandling = WhitespaceHandling.None;
110// doc.Load(xtr);
111// xtr.Close();
112// XmlNode sceneNode = doc.FirstChild;
113//
114// foreach (XmlNode objectNode in sceneNode.ChildNodes)
115// {
116// CreatePrimFromXml2(m_scene, objectNode.OuterXml);
117// }
118
104 serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims)); 119 serialiser.LoadPrimsFromXml2(m_scene, new StringReader(serializedPrims));
105 } 120 }
106 } 121 }
diff --git a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
index db16601..94161f0 100644
--- a/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
+++ b/OpenSim/Region/Environment/Modules/World/Serialiser/SceneXmlLoader.cs
@@ -114,6 +114,7 @@ namespace OpenSim.Region.Environment.Scenes
114 doc.Load(reader); 114 doc.Load(reader);
115 reader.Close(); 115 reader.Close();
116 rootNode = doc.FirstChild; 116 rootNode = doc.FirstChild;
117
117 foreach (XmlNode aPrimNode in rootNode.ChildNodes) 118 foreach (XmlNode aPrimNode in rootNode.ChildNodes)
118 { 119 {
119 CreatePrimFromXml2(scene, aPrimNode.OuterXml); 120 CreatePrimFromXml2(scene, aPrimNode.OuterXml);
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs
index 1970896..bc3e06c 100644
--- a/OpenSim/Region/Environment/Scenes/EntityBase.cs
+++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs
@@ -63,6 +63,15 @@ namespace OpenSim.Region.Environment.Scenes
63 get { return m_name; } 63 get { return m_name; }
64 set { m_name = value; } 64 set { m_name = value; }
65 } 65 }
66
67 /// <summary>
68 /// Signals whether this group was in a scene but has since been deleted from it.
69 /// </summary>
70 public bool IsDeleted
71 {
72 get { return m_isDeleted; }
73 }
74 protected bool m_isDeleted;
66 75
67 protected LLVector3 m_pos; 76 protected LLVector3 m_pos;
68 77
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index e803122..7529d77 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -293,21 +293,23 @@ namespace OpenSim.Region.Environment.Scenes
293 // Don't abort the whole update if one entity happens to give us an exception. 293 // Don't abort the whole update if one entity happens to give us an exception.
294 try 294 try
295 { 295 {
296 // A null name signals that this group was deleted before the scheduled update 296 // Check that the group was not deleted before the scheduled update
297 // FIXME: This is merely a temporary measure to reduce the incidence of failure, when 297 // FIXME: This is merely a temporary measure to reduce the incidence of failure, when
298 // an object has been deleted from a scene before update was processed. 298 // an object has been deleted from a scene before update was processed.
299 // A more fundamental overhaul of the update mechanism is required to eliminate all 299 // A more fundamental overhaul of the update mechanism is required to eliminate all
300 // the race conditions. 300 // the race conditions.
301 if (entity.Name != null) 301 if (!entity.IsDeleted)
302 { 302 {
303 m_updateList[i].Update(); 303 m_updateList[i].Update();
304 } 304 }
305 } 305 }
306 catch (Exception e) 306 catch (Exception e)
307 { 307 {
308 m_log.ErrorFormat("[INNER SCENE]: Failed to update {0}, - {1}", entity.Name, e);//entity.m_uuid 308 m_log.ErrorFormat(
309 "[INNER SCENE]: Failed to update {0}, {1} - {2}", entity.Name, entity.UUID, e);
309 } 310 }
310 } 311 }
312
311 m_updateList.Clear(); 313 m_updateList.Clear();
312 } 314 }
313 } 315 }
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 73b3a49..aa74072 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -1665,7 +1665,7 @@ namespace OpenSim.Region.Environment.Scenes
1665 } 1665 }
1666 1666
1667 /// <summary> 1667 /// <summary>
1668 /// Delete this object from the scene. 1668 /// Delete the given object from the scene.
1669 /// </summary> 1669 /// </summary>
1670 /// <param name="group"></param> 1670 /// <param name="group"></param>
1671 public void DeleteSceneObject(SceneObjectGroup group) 1671 public void DeleteSceneObject(SceneObjectGroup group)
@@ -1686,14 +1686,6 @@ namespace OpenSim.Region.Environment.Scenes
1686 1686
1687 group.DeleteGroup(); 1687 group.DeleteGroup();
1688 group.DeleteParts(); 1688 group.DeleteParts();
1689
1690 // In case anybody else retains a reference to this group, signal deletion by changing the name
1691 // to null. We can't zero out the UUID because this is taken from the root part, which has already
1692 // been removed.
1693 // FIXME: This is a really poor temporary solution, since it still leaves plenty of scope for race
1694 // conditions where a user deletes an entity while it is being stored. Really, the update
1695 // code needs a redesign.
1696 group.Name = null;
1697 } 1689 }
1698 1690
1699 /// <summary> 1691 /// <summary>
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 0d759cf..814db05 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes
124 { 124 {
125 get { return RootPart.Name; } 125 get { return RootPart.Name; }
126 set { RootPart.Name = value; } 126 set { RootPart.Name = value; }
127 } 127 }
128 128
129 /// <summary> 129 /// <summary>
130 /// Added because the Parcel code seems to use it 130 /// Added because the Parcel code seems to use it
@@ -921,10 +921,16 @@ namespace OpenSim.Region.Environment.Scenes
921 } 921 }
922 922
923 /// <summary> 923 /// <summary>
924 /// Completely delete this group and tell all the scene presences about that deletion. 924 /// Delete this group from its scene and tell all the scene presences about that deletion.
925 /// </summary> 925 /// </summary>
926 public void DeleteGroup() 926 public void DeleteGroup()
927 { 927 {
928 // We need to keep track of this state in case this group is still queued for backup.
929 // FIXME: This is a poor temporary solution, since it still leaves plenty of scope for race
930 // conditions where a user deletes an entity while it is being stored. Really, the update
931 // code needs a redesign.
932 m_isDeleted = true;
933
928 DetachFromBackup(this); 934 DetachFromBackup(this);
929 935
930 lock (m_parts) 936 lock (m_parts)
@@ -944,6 +950,7 @@ namespace OpenSim.Region.Environment.Scenes
944 } 950 }
945 } 951 }
946 } 952 }
953
947 public void FakeDeleteGroup() 954 public void FakeDeleteGroup()
948 { 955 {
949 foreach (SceneObjectPart part in m_parts.Values) 956 foreach (SceneObjectPart part in m_parts.Values)