mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
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.
This commit is contained in:
@@ -2911,7 +2911,9 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
|
||||
|
||||
ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
|
||||
// We have to wait until the viewer contacts this region after receiving EAC.
|
||||
// That calls AddNewClient, which finally creates the ScenePresence
|
||||
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);
|
||||
if (childAgentUpdate != null)
|
||||
{
|
||||
childAgentUpdate.ChildAgentDataUpdate(cAgentData);
|
||||
@@ -2947,6 +2949,16 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
return false;
|
||||
}
|
||||
|
||||
protected virtual ScenePresence WaitGetScenePresence(UUID agentID)
|
||||
{
|
||||
int ntimes = 10;
|
||||
ScenePresence childAgentUpdate = null;
|
||||
while ((childAgentUpdate = GetScenePresence(agentID)) == null && (ntimes-- > 0))
|
||||
Thread.Sleep(1000);
|
||||
return childAgentUpdate;
|
||||
|
||||
}
|
||||
|
||||
public virtual bool IncomingReleaseAgent(UUID id)
|
||||
{
|
||||
return m_sceneGridService.ReleaseAgent(id);
|
||||
|
||||
@@ -1000,7 +1000,6 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
/// </summary>
|
||||
public void CompleteMovement()
|
||||
{
|
||||
//Console.WriteLine("\n CompleteMovement \n");
|
||||
Vector3 look = Velocity;
|
||||
if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
|
||||
{
|
||||
@@ -1017,7 +1016,7 @@ namespace OpenSim.Region.Environment.Scenes
|
||||
|
||||
if ((m_callbackURI != null) && !m_callbackURI.Equals(""))
|
||||
{
|
||||
//m_log.DebugFormat("Found callback URI {0}", m_callbackURI);
|
||||
m_log.DebugFormat("[SCENE PRESENCE]: Releasing agent in URI {0}", m_callbackURI);
|
||||
Scene.SendReleaseAgent(m_rootRegionHandle, UUID, m_callbackURI);
|
||||
m_callbackURI = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user