aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-06-21 19:56:19 +0000
committerJustin Clarke Casey2008-06-21 19:56:19 +0000
commitb290ce405f01ae4b52ba5d5ec1661a2ae44ba2d6 (patch)
treebbc2b33cc84ba305709e325e580d64a5e07798ff /OpenSim/Region/Environment/Scenes
parent* minor: start saving current prims xml to an objects/ directory in the archive (diff)
downloadopensim-SC-b290ce405f01ae4b52ba5d5ec1661a2ae44ba2d6.zip
opensim-SC-b290ce405f01ae4b52ba5d5ec1661a2ae44ba2d6.tar.gz
opensim-SC-b290ce405f01ae4b52ba5d5ec1661a2ae44ba2d6.tar.bz2
opensim-SC-b290ce405f01ae4b52ba5d5ec1661a2ae44ba2d6.tar.xz
* Remove a bug I created in r5171 where taking an object would terminate the client session
* change code to use an explicit state variable instead of using SOG.Name = null to signal deletion
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-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
4 files changed, 24 insertions, 14 deletions
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)