aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie2011-12-08 03:24:25 +0000
committerMelanie2011-12-08 03:24:25 +0000
commit50aa89dae66246395e9aac4d7d31f010e55473e8 (patch)
treeb2d23662cc5a51e13f582728bf7064077f9edc32 /OpenSim/Region/Framework/Scenes/Scene.cs
parentFix intersim object give messages (diff)
parentRemove unused SceneManager.TryGetAvatarsScene() (diff)
downloadopensim-SC-50aa89dae66246395e9aac4d7d31f010e55473e8.zip
opensim-SC-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.gz
opensim-SC-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.bz2
opensim-SC-50aa89dae66246395e9aac4d7d31f010e55473e8.tar.xz
Merge commit 'eda770e978c09c756d15ba62dbbf6ee34a61b2f5' into bigmerge
Conflicts: OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs61
1 files changed, 31 insertions, 30 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 171443e..f9ae39c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3241,37 +3241,38 @@ namespace OpenSim.Region.Framework.Scenes
3241 // Avatar is already disposed :/ 3241 // Avatar is already disposed :/
3242 } 3242 }
3243 3243
3244 m_log.Debug("[Scene] Beginning OnRemovePresence"); 3244 try
3245 m_eventManager.TriggerOnRemovePresence(agentID); 3245 {
3246 m_log.Debug("[Scene] Finished OnRemovePresence"); 3246 m_eventManager.TriggerOnRemovePresence(agentID);
3247 3247
3248 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) 3248 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc)
3249 AttachmentsModule.SaveChangedAttachments(avatar); 3249 AttachmentsModule.SaveChangedAttachments(avatar);
3250 3250
3251 if (AttachmentsModule != null && !avatar.IsChildAgent && avatar.PresenceType != PresenceType.Npc) 3251 ForEachClient(
3252 AttachmentsModule.SaveChangedAttachments(avatar); 3252 delegate(IClientAPI client)
3253 3253 {
3254 ForEachClient( 3254 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway
3255 delegate(IClientAPI client) 3255 try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); }
3256 catch (NullReferenceException) { }
3257 });
3258
3259 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
3260 if (agentTransactions != null)
3256 { 3261 {
3257 //We can safely ignore null reference exceptions. It means the avatar is dead and cleaned up anyway 3262 agentTransactions.RemoveAgentAssetTransactions(agentID);
3258 try { client.SendKillObject(avatar.RegionHandle, new List<uint> { avatar.LocalId }); } 3263 }
3259 catch (NullReferenceException) { } 3264 }
3260 }); 3265 finally
3261
3262 IAgentAssetTransactions agentTransactions = this.RequestModuleInterface<IAgentAssetTransactions>();
3263 if (agentTransactions != null)
3264 { 3266 {
3265 agentTransactions.RemoveAgentAssetTransactions(agentID); 3267 // Always clean these structures up so that any failure above doesn't cause them to remain in the
3268 // scene with possibly bad effects (e.g. continually timing out on unacked packets and triggering
3269 // the same cleanup exception continually.
3270 // TODO: This should probably extend to the whole method, but we don't want to also catch the NRE
3271 // since this would hide the underlying failure and other associated problems.
3272 m_sceneGraph.RemoveScenePresence(agentID);
3273 m_clientManager.Remove(agentID);
3266 } 3274 }
3267 3275
3268 // Remove the avatar from the scene
3269 m_log.Debug("[Scene] Begin RemoveScenePresence");
3270 m_sceneGraph.RemoveScenePresence(agentID);
3271 m_log.Debug("[Scene] Finished RemoveScenePresence. Removing the client manager");
3272 m_clientManager.Remove(agentID);
3273 m_log.Debug("[Scene] Removed the client manager. Firing avatar.close");
3274
3275 try 3276 try
3276 { 3277 {
3277 avatar.Close(); 3278 avatar.Close();
@@ -4390,7 +4391,7 @@ namespace OpenSim.Region.Framework.Scenes
4390 /// <param name="action"></param> 4391 /// <param name="action"></param>
4391 public void ForEachRootScenePresence(Action<ScenePresence> action) 4392 public void ForEachRootScenePresence(Action<ScenePresence> action)
4392 { 4393 {
4393 if(m_sceneGraph != null) 4394 if (m_sceneGraph != null)
4394 { 4395 {
4395 m_sceneGraph.ForEachAvatar(action); 4396 m_sceneGraph.ForEachAvatar(action);
4396 } 4397 }
@@ -4470,9 +4471,9 @@ namespace OpenSim.Region.Framework.Scenes
4470 return m_sceneGraph.GetGroupByPrim(localID); 4471 return m_sceneGraph.GetGroupByPrim(localID);
4471 } 4472 }
4472 4473
4473 public override bool TryGetScenePresence(UUID avatarId, out ScenePresence avatar) 4474 public override bool TryGetScenePresence(UUID agentID, out ScenePresence sp)
4474 { 4475 {
4475 return m_sceneGraph.TryGetScenePresence(avatarId, out avatar); 4476 return m_sceneGraph.TryGetScenePresence(agentID, out sp);
4476 } 4477 }
4477 4478
4478 public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar) 4479 public bool TryGetAvatarByName(string avatarName, out ScenePresence avatar)