diff options
author | Justin Clarke Casey | 2008-06-21 20:12:01 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-06-21 20:12:01 +0000 |
commit | e19a76377c561df939df512fdaeb6d4e830eb68a (patch) | |
tree | 34498d3a36542a1c286e729481a429422893e0ba /OpenSim | |
parent | * Remove a bug I created in r5171 where taking an object would terminate the ... (diff) | |
download | opensim-SC-e19a76377c561df939df512fdaeb6d4e830eb68a.zip opensim-SC-e19a76377c561df939df512fdaeb6d4e830eb68a.tar.gz opensim-SC-e19a76377c561df939df512fdaeb6d4e830eb68a.tar.bz2 opensim-SC-e19a76377c561df939df512fdaeb6d4e830eb68a.tar.xz |
* Refactor: Fold sog.DeleteParts() functionality into existing sog.DeleteGroup()
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 28 |
2 files changed, 9 insertions, 22 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index aa74072..4cf1ea4 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -1670,7 +1670,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1670 | /// <param name="group"></param> | 1670 | /// <param name="group"></param> |
1671 | public void DeleteSceneObject(SceneObjectGroup group) | 1671 | public void DeleteSceneObject(SceneObjectGroup group) |
1672 | { | 1672 | { |
1673 | SceneObjectPart rootPart = (group).GetChildPart(group.UUID); | 1673 | SceneObjectPart rootPart = group.GetChildPart(group.UUID); |
1674 | 1674 | ||
1675 | if (rootPart.PhysActor != null) | 1675 | if (rootPart.PhysActor != null) |
1676 | { | 1676 | { |
@@ -1685,7 +1685,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
1685 | } | 1685 | } |
1686 | 1686 | ||
1687 | group.DeleteGroup(); | 1687 | group.DeleteGroup(); |
1688 | group.DeleteParts(); | ||
1689 | } | 1688 | } |
1690 | 1689 | ||
1691 | /// <summary> | 1690 | /// <summary> |
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 814db05..202e3b8 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -931,12 +931,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
931 | // code needs a redesign. | 931 | // code needs a redesign. |
932 | m_isDeleted = true; | 932 | m_isDeleted = true; |
933 | 933 | ||
934 | DetachFromBackup(this); | 934 | DetachFromBackup(this); |
935 | 935 | ||
936 | lock (m_parts) | 936 | lock (m_parts) |
937 | { | 937 | { |
938 | foreach (SceneObjectPart part in m_parts.Values) | 938 | foreach (SceneObjectPart part in m_parts.Values) |
939 | { | 939 | { |
940 | part.StopScripts(); | ||
941 | |||
940 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 942 | List<ScenePresence> avatars = Scene.GetScenePresences(); |
941 | for (int i = 0; i < avatars.Count; i++) | 943 | for (int i = 0; i < avatars.Count; i++) |
942 | { | 944 | { |
@@ -948,6 +950,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
948 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 950 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); |
949 | } | 951 | } |
950 | } | 952 | } |
953 | |||
954 | m_rootPart = null; | ||
955 | m_parts.Clear(); | ||
951 | } | 956 | } |
952 | } | 957 | } |
953 | 958 | ||
@@ -968,23 +973,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
968 | } | 973 | } |
969 | } | 974 | } |
970 | 975 | ||
971 | /// <summary> | ||
972 | /// Delete all the parts in this group. | ||
973 | /// </summary> | ||
974 | public void DeleteParts() | ||
975 | { | ||
976 | lock (m_parts) | ||
977 | { | ||
978 | foreach (SceneObjectPart part in m_parts.Values) | ||
979 | { | ||
980 | part.StopScripts(); | ||
981 | } | ||
982 | |||
983 | m_rootPart = null; | ||
984 | m_parts.Clear(); | ||
985 | } | ||
986 | } | ||
987 | |||
988 | public void AddScriptLPS(int count) | 976 | public void AddScriptLPS(int count) |
989 | { | 977 | { |
990 | if (scriptScore + count >= float.MaxValue - count) | 978 | if (scriptScore + count >= float.MaxValue - count) |
@@ -1793,11 +1781,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
1793 | 1781 | ||
1794 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); | 1782 | m_scene.UnlinkSceneObject(objectGroup.UUID, true); |
1795 | 1783 | ||
1796 | // TODO Deleting the parts may cause problems later on if they have already | 1784 | // TODO Deleting the original group object may cause problems later on if they have already |
1797 | // made it into the update queue. However, sending out updates for those parts is now | 1785 | // made it into the update queue. However, sending out updates for those parts is now |
1798 | // spurious, so it would be good not to send them at some point. | 1786 | // spurious, so it would be good not to send them at some point. |
1799 | // The traffic caused is always going to be pretty minor, so it's not high priority | 1787 | // The traffic caused is always going to be pretty minor, so it's not high priority |
1800 | //objectGroup.DeleteParts(); | 1788 | //objectGroup.DeleteGroup(); |
1801 | 1789 | ||
1802 | ScheduleGroupForFullUpdate(); | 1790 | ScheduleGroupForFullUpdate(); |
1803 | } | 1791 | } |