Added a SendChildAgentDataUpdate call on Teleports, so that the agent at the destination will have all the necessary information.

This commit is contained in:
diva
2008-12-31 00:18:24 +00:00
parent f08f11fe60
commit 5de40aaf46
3 changed files with 111 additions and 43 deletions

View File

@@ -791,33 +791,34 @@ namespace OpenSim.Region.Environment.Scenes
//avatar.Scene.RemoveCapsHandler(avatar.UUID);
// Let's close some agents
avatar.CloseChildAgents(newRegionX, newRegionY);
string capsPath = String.Empty;
AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo();
agent.BaseFolder = UUID.Zero;
agent.InventoryFolder = UUID.Zero;
agent.startpos = position;
agent.child = true;
AgentCircuitData agentCircuit = avatar.ControllingClient.RequestClientInfo();
agentCircuit.BaseFolder = UUID.Zero;
agentCircuit.InventoryFolder = UUID.Zero;
agentCircuit.startpos = position;
agentCircuit.child = true;
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
{
// brand new agent, let's create a new caps seed
agent.CapsPath = Util.GetRandomCapsPath();
agentCircuit.CapsPath = Util.GetRandomCapsPath();
}
if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent))
// Let's create an agent there if one doesn't exist yet.
if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
{
avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports.");
return;
}
// OK, it got this agent. Let's close some child agents
avatar.CloseChildAgents(newRegionX, newRegionY);
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
{
// TODO Should construct this behind a method
capsPath =
"http://" + reg.ExternalHostName + ":" + reg.HttpPort
+ "/CAPS/" + agent.CapsPath + "0000/";
+ "/CAPS/" + agentCircuit.CapsPath + "0000/";
if (eq != null)
{
@@ -839,9 +840,9 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
agent.CapsPath = avatar.Scene.GetChildSeed(avatar.UUID, reg.RegionHandle);
agentCircuit.CapsPath = avatar.Scene.GetChildSeed(avatar.UUID, reg.RegionHandle);
capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort
+ "/CAPS/" + agent.CapsPath + "0000/";
+ "/CAPS/" + agentCircuit.CapsPath + "0000/";
}
// Expect avatar crossing is a heavy-duty function at the destination.
@@ -859,6 +860,13 @@ namespace OpenSim.Region.Environment.Scenes
// return;
//}
// Let's send a full update of the agent. This is a synchronous call.
AgentData agent = new AgentData();
avatar.CopyTo(agent);
agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!!
m_interregionCommsOut.SendChildAgentUpdate(reg.RegionHandle, agent);
avatar.MakeChildAgent();
m_log.DebugFormat(
@@ -885,7 +893,9 @@ namespace OpenSim.Region.Environment.Scenes
// TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
// trigers a whole shebang of things there, including MakeRoot. So let's wait plenty before
// we send the attachments and close things here.
Thread.Sleep(3000);
// We need to change this part of the protocol. The receiving region should tell this region
// when it's ok to continue.
Thread.Sleep(4000);
// CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true);
@@ -894,7 +904,7 @@ namespace OpenSim.Region.Environment.Scenes
if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
{
Thread.Sleep(5000);
Thread.Sleep(8000);
avatar.Close();
CloseConnection(avatar.UUID);
}