aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authordiva2009-02-04 16:31:48 +0000
committerdiva2009-02-04 16:31:48 +0000
commitbe3e676d33dc44c67bd427022badd73395ca5174 (patch)
tree97ebfb2839456bc2dab0595fa4867ec26b024093 /OpenSim/Region/Environment/Scenes/Scene.cs
parentAdded a ForceSceneObjectBackup method to Scene, which as it says forces a dat... (diff)
downloadopensim-SC_OLD-be3e676d33dc44c67bd427022badd73395ca5174.zip
opensim-SC_OLD-be3e676d33dc44c67bd427022badd73395ca5174.tar.gz
opensim-SC_OLD-be3e676d33dc44c67bd427022badd73395ca5174.tar.bz2
opensim-SC_OLD-be3e676d33dc44c67bd427022badd73395ca5174.tar.xz
Addresses a race condition that happened between the viewer and the departing region wrt the creation of the child agent in the receiving region, and that resulted in failed TPs.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 194d782..8d3792c 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2911,7 +2911,9 @@ namespace OpenSim.Region.Environment.Scenes
2911// m_log.DebugFormat( 2911// m_log.DebugFormat(
2912// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); 2912// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
2913 2913
2914 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 2914 // We have to wait until the viewer contacts this region after receiving EAC.
2915 // That calls AddNewClient, which finally creates the ScenePresence
2916 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
2915 if (childAgentUpdate != null) 2917 if (childAgentUpdate != null)
2916 { 2918 {
2917 childAgentUpdate.ChildAgentDataUpdate(cAgentData); 2919 childAgentUpdate.ChildAgentDataUpdate(cAgentData);
@@ -2947,6 +2949,16 @@ namespace OpenSim.Region.Environment.Scenes
2947 return false; 2949 return false;
2948 } 2950 }
2949 2951
2952 protected virtual ScenePresence WaitGetScenePresence(UUID agentID)
2953 {
2954 int ntimes = 10;
2955 ScenePresence childAgentUpdate = null;
2956 while ((childAgentUpdate = GetScenePresence(agentID)) == null && (ntimes-- > 0))
2957 Thread.Sleep(1000);
2958 return childAgentUpdate;
2959
2960 }
2961
2950 public virtual bool IncomingReleaseAgent(UUID id) 2962 public virtual bool IncomingReleaseAgent(UUID id)
2951 { 2963 {
2952 return m_sceneGridService.ReleaseAgent(id); 2964 return m_sceneGridService.ReleaseAgent(id);