diff options
author | Melanie | 2010-10-08 11:31:52 +0200 |
---|---|---|
committer | Melanie | 2010-10-08 11:31:52 +0200 |
commit | 52dd547863c0cdd22f53f0efcaef11ae096855a0 (patch) | |
tree | e1b545832530f02b3485a39826555e444423aad3 /OpenSim/Region/Framework | |
parent | Implement rezzing coalesced objects (diff) | |
download | opensim-SC_OLD-52dd547863c0cdd22f53f0efcaef11ae096855a0.zip opensim-SC_OLD-52dd547863c0cdd22f53f0efcaef11ae096855a0.tar.gz opensim-SC_OLD-52dd547863c0cdd22f53f0efcaef11ae096855a0.tar.bz2 opensim-SC_OLD-52dd547863c0cdd22f53f0efcaef11ae096855a0.tar.xz |
Make SendKillObject send multiple localIDs in one packet. This avoids the
halting visual behavior of large group deletes and eliminates the packet flood
Diffstat (limited to '')
5 files changed, 29 insertions, 22 deletions
diff --git a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs index 8feb022..a8d24fd 100644 --- a/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs +++ b/OpenSim/Region/Framework/Scenes/AsyncSceneObjectGroupDeleter.cs | |||
@@ -104,8 +104,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
104 | // better than losing the object for now. | 104 | // better than losing the object for now. |
105 | if (permissionToDelete) | 105 | if (permissionToDelete) |
106 | { | 106 | { |
107 | List<uint> killIDs = new List<uint>(); | ||
108 | |||
107 | foreach (SceneObjectGroup g in objectGroups) | 109 | foreach (SceneObjectGroup g in objectGroups) |
110 | { | ||
111 | killIDs.Add(g.LocalId); | ||
108 | g.DeleteGroupFromScene(false); | 112 | g.DeleteGroupFromScene(false); |
113 | } | ||
114 | |||
115 | m_scene.SendKillObject(killIDs); | ||
109 | } | 116 | } |
110 | } | 117 | } |
111 | 118 | ||
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs index 8b5316a..6d7f984 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs | |||
@@ -1709,7 +1709,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1709 | if (part == null) | 1709 | if (part == null) |
1710 | { | 1710 | { |
1711 | //Client still thinks the object exists, kill it | 1711 | //Client still thinks the object exists, kill it |
1712 | SendKillObject(localID); | 1712 | deleteIDs.Add(localID); |
1713 | continue; | 1713 | continue; |
1714 | } | 1714 | } |
1715 | 1715 | ||
@@ -1717,7 +1717,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1717 | if (part.ParentGroup == null || part.ParentGroup.IsDeleted) | 1717 | if (part.ParentGroup == null || part.ParentGroup.IsDeleted) |
1718 | { | 1718 | { |
1719 | //Client still thinks the object exists, kill it | 1719 | //Client still thinks the object exists, kill it |
1720 | SendKillObject(localID); | 1720 | deleteIDs.Add(localID); |
1721 | continue; | 1721 | continue; |
1722 | } | 1722 | } |
1723 | 1723 | ||
@@ -1727,8 +1727,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1727 | 1727 | ||
1728 | SceneObjectGroup grp = part.ParentGroup; | 1728 | SceneObjectGroup grp = part.ParentGroup; |
1729 | 1729 | ||
1730 | deleteIDs.Add(localID); | ||
1731 | deleteGroups.Add(grp); | 1730 | deleteGroups.Add(grp); |
1731 | deleteIDs.Add(grp.LocalId); | ||
1732 | 1732 | ||
1733 | if (remoteClient == null) | 1733 | if (remoteClient == null) |
1734 | { | 1734 | { |
@@ -1811,6 +1811,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
1811 | } | 1811 | } |
1812 | } | 1812 | } |
1813 | 1813 | ||
1814 | SendKillObject(deleteIDs); | ||
1815 | |||
1814 | if (permissionToTake) | 1816 | if (permissionToTake) |
1815 | { | 1817 | { |
1816 | m_asyncSceneObjectDeleter.DeleteToInventory( | 1818 | m_asyncSceneObjectDeleter.DeleteToInventory( |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 76e160d..48ae4ca 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2188,6 +2188,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2188 | } | 2188 | } |
2189 | 2189 | ||
2190 | group.DeleteGroupFromScene(silent); | 2190 | group.DeleteGroupFromScene(silent); |
2191 | if (!silent) | ||
2192 | SendKillObject(new List<uint>() { group.LocalId }); | ||
2191 | 2193 | ||
2192 | // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); | 2194 | // m_log.DebugFormat("[SCENE]: Exit DeleteSceneObject() for {0} {1}", group.Name, group.UUID); |
2193 | } | 2195 | } |
@@ -3273,7 +3275,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3273 | delegate(IClientAPI client) | 3275 | delegate(IClientAPI client) |
3274 | { | 3276 | { |
3275 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway | 3277 | //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway |
3276 | try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } | 3278 | try { client.SendKillObject(avatar.RegionHandle, new List<uint>() { avatar.LocalId}); } |
3277 | catch (NullReferenceException) { } | 3279 | catch (NullReferenceException) { } |
3278 | }); | 3280 | }); |
3279 | 3281 | ||
@@ -3336,18 +3338,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
3336 | 3338 | ||
3337 | #region Entities | 3339 | #region Entities |
3338 | 3340 | ||
3339 | public void SendKillObject(uint localID) | 3341 | public void SendKillObject(List<uint> localIDs) |
3340 | { | 3342 | { |
3341 | SceneObjectPart part = GetSceneObjectPart(localID); | 3343 | List<uint> deleteIDs = new List<uint>(); |
3342 | if (part != null) // It is a prim | 3344 | |
3345 | foreach (uint localID in localIDs) | ||
3343 | { | 3346 | { |
3344 | if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid | 3347 | SceneObjectPart part = GetSceneObjectPart(localID); |
3348 | if (part != null) // It is a prim | ||
3345 | { | 3349 | { |
3346 | if (part.ParentGroup.RootPart != part) // Child part | 3350 | if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid |
3347 | return; | 3351 | { |
3352 | if (part.ParentGroup.RootPart != part) // Child part | ||
3353 | continue; | ||
3354 | } | ||
3348 | } | 3355 | } |
3356 | deleteIDs.Add(localID); | ||
3349 | } | 3357 | } |
3350 | ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, localID); }); | 3358 | ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, deleteIDs); }); |
3351 | } | 3359 | } |
3352 | 3360 | ||
3353 | #endregion | 3361 | #endregion |
@@ -3365,7 +3373,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3365 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; | 3373 | //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; |
3366 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; | 3374 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; |
3367 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; | 3375 | m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; |
3368 | m_sceneGridService.KiPrimitive += SendKillObject; | ||
3369 | m_sceneGridService.OnGetLandData += GetLandData; | 3376 | m_sceneGridService.OnGetLandData += GetLandData; |
3370 | } | 3377 | } |
3371 | 3378 | ||
@@ -3374,7 +3381,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3374 | /// </summary> | 3381 | /// </summary> |
3375 | public void UnRegisterRegionWithComms() | 3382 | public void UnRegisterRegionWithComms() |
3376 | { | 3383 | { |
3377 | m_sceneGridService.KiPrimitive -= SendKillObject; | ||
3378 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; | 3384 | m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; |
3379 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; | 3385 | //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; |
3380 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; | 3386 | //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; |
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 1293d5d..632646d 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -44,8 +44,6 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
44 | 44 | ||
45 | namespace OpenSim.Region.Framework.Scenes | 45 | namespace OpenSim.Region.Framework.Scenes |
46 | { | 46 | { |
47 | public delegate void KiPrimitiveDelegate(uint localID); | ||
48 | |||
49 | public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); | 47 | public delegate void RemoveKnownRegionsFromAvatarList(UUID avatarID, List<ulong> regionlst); |
50 | 48 | ||
51 | /// <summary> | 49 | /// <summary> |
@@ -113,8 +111,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
113 | // private LogOffUser handlerLogOffUser = null; | 111 | // private LogOffUser handlerLogOffUser = null; |
114 | // private GetLandData handlerGetLandData = null; // OnGetLandData | 112 | // private GetLandData handlerGetLandData = null; // OnGetLandData |
115 | 113 | ||
116 | public KiPrimitiveDelegate KiPrimitive; | ||
117 | |||
118 | public SceneCommunicationService() | 114 | public SceneCommunicationService() |
119 | { | 115 | { |
120 | } | 116 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 9a7d560..c870797 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1151,7 +1151,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1151 | // | 1151 | // |
1152 | if (IsSelected) | 1152 | if (IsSelected) |
1153 | { | 1153 | { |
1154 | m_scene.SendKillObject(m_rootPart.LocalId); | 1154 | m_scene.SendKillObject(new List<uint> { m_rootPart.LocalId }); |
1155 | } | 1155 | } |
1156 | 1156 | ||
1157 | IsSelected = false; // fudge.... | 1157 | IsSelected = false; // fudge.... |
@@ -1415,11 +1415,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1415 | avatar.StandUp(); | 1415 | avatar.StandUp(); |
1416 | 1416 | ||
1417 | if (!silent) | 1417 | if (!silent) |
1418 | { | ||
1419 | part.UpdateFlag = 0; | 1418 | part.UpdateFlag = 0; |
1420 | if (part == m_rootPart) | ||
1421 | avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); | ||
1422 | } | ||
1423 | }); | 1419 | }); |
1424 | } | 1420 | } |
1425 | 1421 | ||