From e2ab576572a3ca7ab1f29fc142624ae257f5289d Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Wed, 12 Nov 2008 18:12:18 +0000
Subject: * Stop locking the scene presences dictionary for the entire agent
crossing part of the login sequence * This may alleviate a little the
freezing experienced by existing avatars when a new client logs in * Race
condition risks look minimal since one wouldn't expect another thread to
start fiddling with that presence
---
OpenSim/Region/Environment/Scenes/Scene.cs | 32 +++++++++++++++++++-----------
1 file changed, 20 insertions(+), 12 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 326380b..ceadf7a 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2863,7 +2863,7 @@ namespace OpenSim.Region.Environment.Scenes
}
///
- ///
+ /// Triggered when an agent crosses into this sim. Also happens on initial login.
///
///
///
@@ -2873,22 +2873,30 @@ namespace OpenSim.Region.Environment.Scenes
{
if (regionHandle == m_regInfo.RegionHandle)
{
+ ScenePresence presence;
+
lock (m_scenePresences)
{
- if (m_scenePresences.ContainsKey(agentID))
+ m_scenePresences.TryGetValue(agentID, out presence);
+ }
+
+ if (presence != null)
+ {
+ try
{
- try
- {
- m_scenePresences[agentID].MakeRootAgent(position, isFlying);
- }
- catch (Exception e)
- {
- m_log.Info("[SCENE]: Unable to do Agent Crossing.");
- m_log.Debug("[SCENE]: " + e.ToString());
- }
- //m_innerScene.SwapRootChildAgent(false);
+ presence.MakeRootAgent(position, isFlying);
+ }
+ catch (Exception e)
+ {
+ m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e);
}
}
+ else
+ {
+ m_log.ErrorFormat(
+ "[SCENE]: Could not find presence for agent {0} crossing into scene {1}",
+ agentID, RegionInfo.RegionName);
+ }
}
}
--
cgit v1.1