diff options
author | Melanie Thielker | 2008-09-03 19:28:46 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-03 19:28:46 +0000 |
commit | eee9c114cbcfdefba2b2edc94d4d174689c5d546 (patch) | |
tree | 9bfe5c6268cbbbb805f97c8013f1a641add6867e /OpenSim | |
parent | Mantis #2112 (diff) | |
download | opensim-SC_OLD-eee9c114cbcfdefba2b2edc94d4d174689c5d546.zip opensim-SC_OLD-eee9c114cbcfdefba2b2edc94d4d174689c5d546.tar.gz opensim-SC_OLD-eee9c114cbcfdefba2b2edc94d4d174689c5d546.tar.bz2 opensim-SC_OLD-eee9c114cbcfdefba2b2edc94d4d174689c5d546.tar.xz |
Mantis #2111
Eliminate gretuitious KillObject packets. KillObject is sent to the
viewer for the root part only.
Also prevents the full update on deselect that makes a deleted object
reappear and stay visible until the background deleter got around to it.
We still send 2 KillObject packets for the root prim, that could be
avoided only at a cost in reliability. One packet seems an acceptable
price to pay for consistency.
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Scene.cs | 9 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | 19 |
2 files changed, 26 insertions, 2 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2b242fc..45062eb 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2496,6 +2496,15 @@ namespace OpenSim.Region.Environment.Scenes | |||
2496 | 2496 | ||
2497 | public void SendKillObject(uint localID) | 2497 | public void SendKillObject(uint localID) |
2498 | { | 2498 | { |
2499 | SceneObjectPart part = GetSceneObjectPart(localID); | ||
2500 | if (part != null) // It is a prim | ||
2501 | { | ||
2502 | if (part.ParentGroup != null && part.ParentGroup.RootPart != null) // Valid | ||
2503 | { | ||
2504 | if (part.ParentGroup.RootPart != part) // Child part | ||
2505 | return; | ||
2506 | } | ||
2507 | } | ||
2499 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); | 2508 | Broadcast(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); |
2500 | } | 2509 | } |
2501 | 2510 | ||
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 9c3d6a7..a86beae 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs | |||
@@ -105,6 +105,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
105 | /// </summary> | 105 | /// </summary> |
106 | protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>(); | 106 | protected Dictionary<LLUUID, SceneObjectPart> m_parts = new Dictionary<LLUUID, SceneObjectPart>(); |
107 | 107 | ||
108 | private bool m_deleted = false; | ||
108 | protected ulong m_regionHandle; | 109 | protected ulong m_regionHandle; |
109 | protected SceneObjectPart m_rootPart; | 110 | protected SceneObjectPart m_rootPart; |
110 | // private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); | 111 | // private Dictionary<LLUUID, scriptEvents> m_scriptEvents = new Dictionary<LLUUID, scriptEvents>(); |
@@ -948,7 +949,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
948 | avatars[i].StandUp(); | 949 | avatars[i].StandUp(); |
949 | } | 950 | } |
950 | 951 | ||
951 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 952 | if (m_rootPart != null && part == m_rootPart) |
953 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | ||
952 | } | 954 | } |
953 | } | 955 | } |
954 | 956 | ||
@@ -959,6 +961,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
959 | 961 | ||
960 | public void FakeDeleteGroup() | 962 | public void FakeDeleteGroup() |
961 | { | 963 | { |
964 | m_deleted = true; | ||
965 | |||
962 | foreach (SceneObjectPart part in m_parts.Values) | 966 | foreach (SceneObjectPart part in m_parts.Values) |
963 | { | 967 | { |
964 | List<ScenePresence> avatars = Scene.GetScenePresences(); | 968 | List<ScenePresence> avatars = Scene.GetScenePresences(); |
@@ -969,7 +973,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
969 | avatars[i].StandUp(); | 973 | avatars[i].StandUp(); |
970 | } | 974 | } |
971 | 975 | ||
972 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | 976 | if (m_rootPart != null && part == m_rootPart) |
977 | avatars[i].ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | ||
973 | } | 978 | } |
974 | } | 979 | } |
975 | } | 980 | } |
@@ -1543,6 +1548,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1543 | /// </summary> | 1548 | /// </summary> |
1544 | public void ScheduleGroupForFullUpdate() | 1549 | public void ScheduleGroupForFullUpdate() |
1545 | { | 1550 | { |
1551 | // If we wre in the delete queue, this will be set | ||
1552 | // A full update now would make the prim reappear | ||
1553 | // after KillObject was sent via FakeDeleteGroup | ||
1554 | // causing flickering and delays in deletion. | ||
1555 | // This leads to users clicking delete multiple times | ||
1556 | // which can crash the session. So, avoid it. | ||
1557 | // | ||
1558 | if (m_deleted) | ||
1559 | return; | ||
1560 | |||
1546 | checkAtTargets(); | 1561 | checkAtTargets(); |
1547 | lock (m_parts) | 1562 | lock (m_parts) |
1548 | { | 1563 | { |