minor: add some method doc to ScenePresence fields used for entity transfer, add minor details to some log messages, rename a misleading local variable name.

No functional changes.
TeleportWork
Justin Clark-Casey (justincc) 2013-08-07 23:17:31 +01:00
parent a33a1ac958
commit b10710d4a5
4 changed files with 48 additions and 25 deletions

View File

@ -287,6 +287,12 @@ namespace OpenSim.Framework
public Vector3 AtAxis; public Vector3 AtAxis;
public Vector3 LeftAxis; public Vector3 LeftAxis;
public Vector3 UpAxis; public Vector3 UpAxis;
/// <summary>
/// Signal on a V2 teleport that Scene.IncomingChildAgentDataUpdate(AgentData ad) should wait for the
/// scene presence to become root (triggered when the viewer sends a CompleteAgentMovement UDP packet after
/// establishing the connection triggered by it's receipt of a TeleportFinish EQ message).
/// </summary>
public bool SenderWantsToWaitForRoot; public bool SenderWantsToWaitForRoot;
public float Far; public float Far;

View File

@ -689,7 +689,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
else else
TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason);
} }
private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
@ -698,7 +697,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
ulong destinationHandle = finalDestination.RegionHandle; ulong destinationHandle = finalDestination.RegionHandle;
AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Using TP V1"); m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}",
sp.Name, Scene.Name, finalDestination.RegionName);
// Let's create an agent there if one doesn't exist yet. // Let's create an agent there if one doesn't exist yet.
// NOTE: logout will always be false for a non-HG teleport. // NOTE: logout will always be false for a non-HG teleport.
bool logout = false; bool logout = false;
@ -1079,21 +1081,23 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (!sp.DoNotCloseAfterTeleport) if (!sp.DoNotCloseAfterTeleport)
{ {
// OK, it got this agent. Let's close everything // OK, it got this agent. Let's close everything
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.RegionInfo.RegionName); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name);
sp.CloseChildAgents(newRegionX, newRegionY); sp.CloseChildAgents(newRegionX, newRegionY);
sp.Scene.IncomingCloseAgent(sp.UUID, false); sp.Scene.IncomingCloseAgent(sp.UUID, false);
} }
else else
{ {
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.RegionInfo.RegionName); m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.Name);
sp.DoNotCloseAfterTeleport = false; sp.DoNotCloseAfterTeleport = false;
} }
} }
else else
{
// now we have a child agent in this region. // now we have a child agent in this region.
sp.Reset(); sp.Reset();
} }
}
/// <summary> /// <summary>
/// Clean up an inter-region teleport that did not complete, either because of simulator failure or cancellation. /// Clean up an inter-region teleport that did not complete, either because of simulator failure or cancellation.

View File

@ -4222,36 +4222,42 @@ namespace OpenSim.Region.Framework.Scenes
} }
// We have to wait until the viewer contacts this region // We have to wait until the viewer contacts this region
// after receiving the EnableSimulator HTTP Event Queue message. This triggers the viewer to send // after receiving the EnableSimulator HTTP Event Queue message (for the v1 teleport protocol)
// or TeleportFinish (for the v2 teleport protocol). This triggers the viewer to send
// a UseCircuitCode packet which in turn calls AddNewClient which finally creates the ScenePresence. // a UseCircuitCode packet which in turn calls AddNewClient which finally creates the ScenePresence.
ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); ScenePresence sp = WaitGetScenePresence(cAgentData.AgentID);
if (childAgentUpdate != null) if (sp != null)
{ {
if (cAgentData.SessionID != childAgentUpdate.ControllingClient.SessionId) if (cAgentData.SessionID != sp.ControllingClient.SessionId)
{ {
m_log.WarnFormat("[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).", childAgentUpdate.UUID, cAgentData.SessionID); m_log.WarnFormat(
"[SCENE]: Attempt to update agent {0} with invalid session id {1} (possibly from simulator in older version; tell them to update).",
sp.UUID, cAgentData.SessionID);
Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}", Console.WriteLine(String.Format("[SCENE]: Attempt to update agent {0} ({1}) with invalid session id {2}",
childAgentUpdate.UUID, childAgentUpdate.ControllingClient.SessionId, cAgentData.SessionID)); sp.UUID, sp.ControllingClient.SessionId, cAgentData.SessionID));
} }
childAgentUpdate.ChildAgentDataUpdate(cAgentData); sp.ChildAgentDataUpdate(cAgentData);
int ntimes = 20; int ntimes = 20;
if (cAgentData.SenderWantsToWaitForRoot) if (cAgentData.SenderWantsToWaitForRoot)
{ {
while (childAgentUpdate.IsChildAgent && ntimes-- > 0) while (sp.IsChildAgent && ntimes-- > 0)
Thread.Sleep(1000); Thread.Sleep(1000);
m_log.DebugFormat( m_log.DebugFormat(
"[SCENE]: Found presence {0} {1} {2} in {3} after {4} waits", "[SCENE]: Found presence {0} {1} {2} in {3} after {4} waits",
childAgentUpdate.Name, childAgentUpdate.UUID, childAgentUpdate.IsChildAgent ? "child" : "root", RegionInfo.RegionName, 20 - ntimes); sp.Name, sp.UUID, sp.IsChildAgent ? "child" : "root", Name, 20 - ntimes);
if (childAgentUpdate.IsChildAgent) if (sp.IsChildAgent)
return false; return false;
} }
return true; return true;
} }
return false; return false;
} }

View File

@ -285,10 +285,24 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
private Vector3 posLastSignificantMove; private Vector3 posLastSignificantMove;
// For teleports and crossings callbacks #region For teleports and crossings callbacks
/// <summary>
/// In the V1 teleport protocol, the destination simulator sends ReleaseAgent to this address.
/// </summary>
string m_callbackURI; string m_callbackURI;
UUID m_originRegionID; UUID m_originRegionID;
/// <summary>
/// Used by the entity transfer module to signal when the presence should not be closed because a subsequent
/// teleport is reusing the connection.
/// </summary>
/// <remarks>May be refactored or move somewhere else soon.</remarks>
public bool DoNotCloseAfterTeleport { get; set; }
#endregion
/// <value> /// <value>
/// Script engines present in the scene /// Script engines present in the scene
/// </value> /// </value>
@ -717,13 +731,6 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
/// <summary>
/// Used by the entity transfer module to signal when the presence should not be closed because a subsequent
/// teleport is reusing the connection.
/// </summary>
/// <remarks>May be refactored or move somewhere else soon.</remarks>
public bool DoNotCloseAfterTeleport { get; set; }
private float m_speedModifier = 1.0f; private float m_speedModifier = 1.0f;
public float SpeedModifier public float SpeedModifier
@ -1325,14 +1332,14 @@ namespace OpenSim.Region.Framework.Scenes
int count = 20; int count = 20;
while (m_originRegionID.Equals(UUID.Zero) && count-- > 0) while (m_originRegionID.Equals(UUID.Zero) && count-- > 0)
{ {
m_log.DebugFormat("[SCENE PRESENCE]: Agent {0} waiting for update in {1}", client.Name, Scene.RegionInfo.RegionName); m_log.DebugFormat("[SCENE PRESENCE]: Agent {0} waiting for update in {1}", client.Name, Scene.Name);
Thread.Sleep(200); Thread.Sleep(200);
} }
if (m_originRegionID.Equals(UUID.Zero)) if (m_originRegionID.Equals(UUID.Zero))
{ {
// Movement into region will fail // Movement into region will fail
m_log.WarnFormat("[SCENE PRESENCE]: Update agent {0} never arrived", client.Name); m_log.WarnFormat("[SCENE PRESENCE]: Update agent {0} never arrived in {1}", client.Name, Scene.Name);
return false; return false;
} }