aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2011-11-06 20:38:07 +0000
committerMelanie2011-11-06 20:38:07 +0000
commitc7dd7b13a2058fa6855e2e78f1dbb83e9a806f95 (patch)
tree2208d841ddd01013d590845f306d2719ecf96503 /OpenSim/Region/Framework/Scenes
parentMerge branch 'master' of melanie@opensimulator.org:/var/git/opensim (diff)
downloadopensim-SC_OLD-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.zip
opensim-SC_OLD-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.tar.gz
opensim-SC_OLD-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.tar.bz2
opensim-SC_OLD-c7dd7b13a2058fa6855e2e78f1dbb83e9a806f95.tar.xz
Convert SendKillObject to take a list of uint rather than sending one
packet per prim. More to come as we change to make use of this.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs32
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
3 files changed, 14 insertions, 24 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5465ca4..3b90c16 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3102,7 +3102,7 @@ namespace OpenSim.Region.Framework.Scenes
3102 delegate(IClientAPI client) 3102 delegate(IClientAPI client)
3103 { 3103 {
3104 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway 3104 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
3105 try { client.SendKillObject(avatar.RegionHandle, avatar.LocalId); } 3105 try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); }
3106 catch (NullReferenceException) { } 3106 catch (NullReferenceException) { }
3107 }); 3107 });
3108 3108
@@ -3161,28 +3161,24 @@ namespace OpenSim.Region.Framework.Scenes
3161 3161
3162 #region Entities 3162 #region Entities
3163 3163
3164 public void SendKillObject(uint localID) 3164 public void SendKillObject(List<uint> localIDs)
3165 { 3165 {
3166 SceneObjectPart part = GetSceneObjectPart(localID); 3166 List<uint> deleteIDs = new List<uint>();
3167 UUID attachedAvatar = UUID.Zero;
3168 3167
3169 if (part != null) // It is a prim 3168 foreach (uint localID in localIDs)
3170 { 3169 {
3171 if (!part.ParentGroup.IsDeleted) // Valid 3170 SceneObjectPart part = GetSceneObjectPart(localID);
3171 if (part != null) // It is a prim
3172 { 3172 {
3173 if (part.ParentGroup.RootPart != part) // Child part 3173 if (part.ParentGroup != null && !part.ParentGroup.IsDeleted) // Valid
3174 return; 3174 {
3175 3175 if (part.ParentGroup.RootPart != part) // Child part
3176 if (part.ParentGroup.IsAttachment && part.ParentGroup.AttachmentPoint >= 31 && part.ParentGroup.AttachmentPoint <= 38) 3176 continue;
3177 attachedAvatar = part.ParentGroup.AttachedAvatar; 3177 }
3178 } 3178 }
3179 deleteIDs.Add(localID);
3179 } 3180 }
3180 3181 ForEachClient(delegate(IClientAPI client) { client.SendKillObject(m_regionHandle, deleteIDs); });
3181 ForEachClient(delegate(IClientAPI client)
3182 {
3183 if (attachedAvatar == UUID.Zero || attachedAvatar == client.AgentId)
3184 client.SendKillObject(m_regionHandle, localID);
3185 });
3186 } 3182 }
3187 3183
3188 #endregion 3184 #endregion
@@ -3200,7 +3196,6 @@ namespace OpenSim.Region.Framework.Scenes
3200 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate; 3196 //m_sceneGridService.OnChildAgentUpdate += IncomingChildAgentDataUpdate;
3201 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar; 3197 //m_sceneGridService.OnRemoveKnownRegionFromAvatar += HandleRemoveKnownRegionsFromAvatar;
3202 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid; 3198 m_sceneGridService.OnLogOffUser += HandleLogOffUserFromGrid;
3203 m_sceneGridService.KiPrimitive += SendKillObject;
3204 m_sceneGridService.OnGetLandData += GetLandData; 3199 m_sceneGridService.OnGetLandData += GetLandData;
3205 } 3200 }
3206 3201
@@ -3209,7 +3204,6 @@ namespace OpenSim.Region.Framework.Scenes
3209 /// </summary> 3204 /// </summary>
3210 public void UnRegisterRegionWithComms() 3205 public void UnRegisterRegionWithComms()
3211 { 3206 {
3212 m_sceneGridService.KiPrimitive -= SendKillObject;
3213 m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid; 3207 m_sceneGridService.OnLogOffUser -= HandleLogOffUserFromGrid;
3214 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar; 3208 //m_sceneGridService.OnRemoveKnownRegionFromAvatar -= HandleRemoveKnownRegionsFromAvatar;
3215 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate; 3209 //m_sceneGridService.OnChildAgentUpdate -= IncomingChildAgentDataUpdate;
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 7cffa70..eccce89 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
45namespace OpenSim.Region.Framework.Scenes 45namespace 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 3f4e112..339cf0f 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1162,7 +1162,7 @@ namespace OpenSim.Region.Framework.Scenes
1162 { 1162 {
1163 if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) || 1163 if (!IsAttachment || (AttachedAvatar == avatar.ControllingClient.AgentId) ||
1164 (AttachmentPoint < 31) || (AttachmentPoint > 38)) 1164 (AttachmentPoint < 31) || (AttachmentPoint > 38))
1165 avatar.ControllingClient.SendKillObject(m_regionHandle, part.LocalId); 1165 avatar.ControllingClient.SendKillObject(m_regionHandle, new List<uint> { part.LocalId });
1166 } 1166 }
1167 } 1167 }
1168 }); 1168 });