diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
5 files changed, 42 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 3044017..11754ea 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -256,7 +256,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
256 | 256 | ||
257 | if (isScriptRunning) | 257 | if (isScriptRunning) |
258 | { | 258 | { |
259 | part.Inventory.RemoveScriptInstance(item.ItemID); | 259 | part.Inventory.RemoveScriptInstance(item.ItemID, false); |
260 | } | 260 | } |
261 | 261 | ||
262 | // Update item with new asset | 262 | // Update item with new asset |
@@ -855,8 +855,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
855 | 855 | ||
856 | if (item.Type == 10) | 856 | if (item.Type == 10) |
857 | { | 857 | { |
858 | part.RemoveScriptEvents(itemID); | ||
858 | EventManager.TriggerRemoveScript(localID, itemID); | 859 | EventManager.TriggerRemoveScript(localID, itemID); |
859 | } | 860 | } |
861 | |||
860 | group.RemoveInventoryItem(localID, itemID); | 862 | group.RemoveInventoryItem(localID, itemID); |
861 | part.GetProperties(remoteClient); | 863 | part.GetProperties(remoteClient); |
862 | } | 864 | } |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 234554e..4da05cf 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1009,7 +1009,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1009 | { | 1009 | { |
1010 | if (ent is SceneObjectGroup) | 1010 | if (ent is SceneObjectGroup) |
1011 | { | 1011 | { |
1012 | ((SceneObjectGroup) ent).RemoveScriptInstances(); | 1012 | ((SceneObjectGroup) ent).RemoveScriptInstances(false); |
1013 | } | 1013 | } |
1014 | } | 1014 | } |
1015 | } | 1015 | } |
@@ -1884,13 +1884,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
1884 | /// <param name="silent">Suppress broadcasting changes to other clients.</param> | 1884 | /// <param name="silent">Suppress broadcasting changes to other clients.</param> |
1885 | public void DeleteSceneObject(SceneObjectGroup group, bool silent) | 1885 | public void DeleteSceneObject(SceneObjectGroup group, bool silent) |
1886 | { | 1886 | { |
1887 | // m_log.DebugFormat("[SCENE]: Deleting scene object {0} {1}", group.Name, group.UUID); | ||
1888 | |||
1887 | //SceneObjectPart rootPart = group.GetChildPart(group.UUID); | 1889 | //SceneObjectPart rootPart = group.GetChildPart(group.UUID); |
1888 | 1890 | ||
1889 | // Serialise calls to RemoveScriptInstances to avoid | 1891 | // Serialise calls to RemoveScriptInstances to avoid |
1890 | // deadlocking on m_parts inside SceneObjectGroup | 1892 | // deadlocking on m_parts inside SceneObjectGroup |
1891 | lock (m_deleting_scene_object) | 1893 | lock (m_deleting_scene_object) |
1892 | { | 1894 | { |
1893 | group.RemoveScriptInstances(); | 1895 | group.RemoveScriptInstances(true); |
1894 | } | 1896 | } |
1895 | 1897 | ||
1896 | foreach (SceneObjectPart part in group.Children.Values) | 1898 | foreach (SceneObjectPart part in group.Children.Values) |
@@ -1918,6 +1920,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1918 | } | 1920 | } |
1919 | 1921 | ||
1920 | group.DeleteGroup(silent); | 1922 | group.DeleteGroup(silent); |
1923 | |||
1924 | // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); | ||
1921 | } | 1925 | } |
1922 | 1926 | ||
1923 | /// <summary> | 1927 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 5a06bdb..71354b4 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs | |||
@@ -74,13 +74,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
74 | /// <summary> | 74 | /// <summary> |
75 | /// Stop the scripts contained in all the prims in this group | 75 | /// Stop the scripts contained in all the prims in this group |
76 | /// </summary> | 76 | /// </summary> |
77 | public void RemoveScriptInstances() | 77 | /// <param name="sceneObjectBeingDeleted"> |
78 | /// Should be true if these scripts are being removed because the scene | ||
79 | /// object is being deleted. This will prevent spurious updates to the client. | ||
80 | /// </param> | ||
81 | public void RemoveScriptInstances(bool sceneObjectBeingDeleted) | ||
78 | { | 82 | { |
79 | lock (m_parts) | 83 | lock (m_parts) |
80 | { | 84 | { |
81 | foreach (SceneObjectPart part in m_parts.Values) | 85 | foreach (SceneObjectPart part in m_parts.Values) |
82 | { | 86 | { |
83 | part.Inventory.RemoveScriptInstances(); | 87 | part.Inventory.RemoveScriptInstances(sceneObjectBeingDeleted); |
84 | } | 88 | } |
85 | } | 89 | } |
86 | } | 90 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 56b2f13..a5296eb 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -2479,7 +2479,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2479 | //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); | 2479 | //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); |
2480 | //ScheduleFullUpdate(); | 2480 | //ScheduleFullUpdate(); |
2481 | } | 2481 | } |
2482 | 2482 | ||
2483 | public void RemoveScriptEvents(UUID scriptid) | 2483 | public void RemoveScriptEvents(UUID scriptid) |
2484 | { | 2484 | { |
2485 | lock (m_scriptEvents) | 2485 | lock (m_scriptEvents) |
@@ -2533,6 +2533,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2533 | /// </summary> | 2533 | /// </summary> |
2534 | public void ScheduleFullUpdate() | 2534 | public void ScheduleFullUpdate() |
2535 | { | 2535 | { |
2536 | // m_log.DebugFormat("[SCENE OBJECT PART]: Scheduling full update for {0} {1}", Name, LocalId); | ||
2537 | |||
2536 | if (m_parentGroup != null) | 2538 | if (m_parentGroup != null) |
2537 | { | 2539 | { |
2538 | m_parentGroup.QueueForUpdateCheck(); | 2540 | m_parentGroup.QueueForUpdateCheck(); |
@@ -4042,6 +4044,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4042 | 4044 | ||
4043 | if (m_parentGroup == null) | 4045 | if (m_parentGroup == null) |
4044 | { | 4046 | { |
4047 | // m_log.DebugFormat( | ||
4048 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents() since m_parentGroup == null", Name, LocalId); | ||
4045 | ScheduleFullUpdate(); | 4049 | ScheduleFullUpdate(); |
4046 | return; | 4050 | return; |
4047 | } | 4051 | } |
@@ -4058,9 +4062,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
4058 | LocalFlags=(PrimFlags)objectflagupdate; | 4062 | LocalFlags=(PrimFlags)objectflagupdate; |
4059 | 4063 | ||
4060 | if (m_parentGroup != null && m_parentGroup.RootPart == this) | 4064 | if (m_parentGroup != null && m_parentGroup.RootPart == this) |
4065 | { | ||
4061 | m_parentGroup.aggregateScriptEvents(); | 4066 | m_parentGroup.aggregateScriptEvents(); |
4067 | } | ||
4062 | else | 4068 | else |
4069 | { | ||
4070 | // m_log.DebugFormat( | ||
4071 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); | ||
4063 | ScheduleFullUpdate(); | 4072 | ScheduleFullUpdate(); |
4073 | } | ||
4064 | } | 4074 | } |
4065 | 4075 | ||
4066 | public int registerTargetWaypoint(Vector3 target, float tolerance) | 4076 | public int registerTargetWaypoint(Vector3 target, float tolerance) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index eb7f5ff..5f13278 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -230,7 +230,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
230 | /// <summary> | 230 | /// <summary> |
231 | /// Stop all the scripts in this prim. | 231 | /// Stop all the scripts in this prim. |
232 | /// </summary> | 232 | /// </summary> |
233 | public void RemoveScriptInstances() | 233 | /// <param name="sceneObjectBeingDeleted"> |
234 | /// Should be true if these scripts are being removed because the scene | ||
235 | /// object is being deleted. This will prevent spurious updates to the client. | ||
236 | /// </param> | ||
237 | public void RemoveScriptInstances(bool sceneObjectBeingDeleted) | ||
234 | { | 238 | { |
235 | lock (Items) | 239 | lock (Items) |
236 | { | 240 | { |
@@ -238,8 +242,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
238 | { | 242 | { |
239 | if ((int)InventoryType.LSL == item.InvType) | 243 | if ((int)InventoryType.LSL == item.InvType) |
240 | { | 244 | { |
241 | RemoveScriptInstance(item.ItemID); | 245 | RemoveScriptInstance(item.ItemID, sceneObjectBeingDeleted); |
242 | m_part.RemoveScriptEvents(item.ItemID); | ||
243 | } | 246 | } |
244 | } | 247 | } |
245 | } | 248 | } |
@@ -388,10 +391,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
388 | /// Stop a script which is in this prim's inventory. | 391 | /// Stop a script which is in this prim's inventory. |
389 | /// </summary> | 392 | /// </summary> |
390 | /// <param name="itemId"></param> | 393 | /// <param name="itemId"></param> |
391 | public void RemoveScriptInstance(UUID itemId) | 394 | /// <param name="sceneObjectBeingDeleted"> |
395 | /// Should be true if this script is being removed because the scene | ||
396 | /// object is being deleted. This will prevent spurious updates to the client. | ||
397 | /// </param> | ||
398 | public void RemoveScriptInstance(UUID itemId, bool sceneObjectBeingDeleted) | ||
392 | { | 399 | { |
393 | if (m_items.ContainsKey(itemId)) | 400 | if (m_items.ContainsKey(itemId)) |
394 | { | 401 | { |
402 | if (!sceneObjectBeingDeleted) | ||
403 | m_part.RemoveScriptEvents(itemId); | ||
404 | |||
395 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId); | 405 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemId); |
396 | m_part.ParentGroup.AddActiveScriptCount(-1); | 406 | m_part.ParentGroup.AddActiveScriptCount(-1); |
397 | } | 407 | } |
@@ -465,7 +475,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
465 | if (i.Name == item.Name) | 475 | if (i.Name == item.Name) |
466 | { | 476 | { |
467 | if (i.InvType == (int)InventoryType.LSL) | 477 | if (i.InvType == (int)InventoryType.LSL) |
468 | RemoveScriptInstance(i.ItemID); | 478 | RemoveScriptInstance(i.ItemID, false); |
469 | 479 | ||
470 | RemoveInventoryItem(i.ItemID); | 480 | RemoveInventoryItem(i.ItemID); |
471 | break; | 481 | break; |
@@ -613,6 +623,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
613 | int type = m_items[itemID].InvType; | 623 | int type = m_items[itemID].InvType; |
614 | if (type == 10) // Script | 624 | if (type == 10) // Script |
615 | { | 625 | { |
626 | m_part.RemoveScriptEvents(itemID); | ||
616 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); | 627 | m_part.ParentGroup.Scene.EventManager.TriggerRemoveScript(m_part.LocalId, itemID); |
617 | } | 628 | } |
618 | m_items.Remove(itemID); | 629 | m_items.Remove(itemID); |