Merge branch 'master' into careminster
commit
a15a58a7c1
|
@ -695,9 +695,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
|
Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
|
||||||
Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
|
Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
|
||||||
|
|
||||||
// distance to edge that will trigger crossing
|
|
||||||
|
|
||||||
|
|
||||||
// distance into new region to place avatar
|
// distance into new region to place avatar
|
||||||
const float enterDistance = 0.5f;
|
const float enterDistance = 0.5f;
|
||||||
|
|
||||||
|
@ -980,28 +977,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
|
"[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
|
||||||
agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
|
agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
|
||||||
|
|
||||||
pos = pos + (agent.Velocity);
|
pos = pos + agent.Velocity;
|
||||||
|
Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
|
||||||
|
|
||||||
|
agent.RemoveFromPhysicalScene();
|
||||||
SetInTransit(agent.UUID);
|
SetInTransit(agent.UUID);
|
||||||
|
|
||||||
AgentData cAgent = new AgentData();
|
AgentData cAgent = new AgentData();
|
||||||
agent.CopyTo(cAgent);
|
agent.CopyTo(cAgent);
|
||||||
cAgent.Position = pos;
|
cAgent.Position = pos;
|
||||||
if (isFlying)
|
if (isFlying)
|
||||||
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
|
||||||
cAgent.CallbackURI = m_scene.RegionInfo.ServerURI +
|
|
||||||
"agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
|
// We don't need the callback anymnore
|
||||||
|
cAgent.CallbackURI = String.Empty;
|
||||||
|
|
||||||
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
|
if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
|
||||||
{
|
{
|
||||||
// region doesn't take it
|
// region doesn't take it
|
||||||
ReInstantiateScripts(agent);
|
ReInstantiateScripts(agent);
|
||||||
|
agent.AddToPhysicalScene(isFlying);
|
||||||
ResetFromTransit(agent.UUID);
|
ResetFromTransit(agent.UUID);
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Next, let's close the child agent connections that are too far away.
|
|
||||||
agent.CloseChildAgents(neighbourx, neighboury);
|
|
||||||
|
|
||||||
//AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
|
//AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
|
||||||
agent.ControllingClient.RequestClientInfo();
|
agent.ControllingClient.RequestClientInfo();
|
||||||
|
|
||||||
|
@ -1022,7 +1021,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
|
IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
|
||||||
if (eq != null)
|
if (eq != null)
|
||||||
{
|
{
|
||||||
eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
|
eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
|
||||||
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
capsPath, agent.UUID, agent.ControllingClient.SessionId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1031,32 +1030,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
capsPath);
|
capsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!WaitForCallback(agent.UUID))
|
// SUCCESS!
|
||||||
{
|
|
||||||
m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
|
|
||||||
ReInstantiateScripts(agent);
|
|
||||||
ResetFromTransit(agent.UUID);
|
|
||||||
|
|
||||||
// Yikes! We should just have a ref to scene here.
|
|
||||||
//agent.Scene.InformClientOfNeighbours(agent);
|
|
||||||
EnableChildAgents(agent);
|
|
||||||
|
|
||||||
return agent;
|
|
||||||
}
|
|
||||||
|
|
||||||
agent.MakeChildAgent();
|
agent.MakeChildAgent();
|
||||||
|
ResetFromTransit(agent.UUID);
|
||||||
|
|
||||||
// now we have a child agent in this region. Request all interesting data about other (root) agents
|
// now we have a child agent in this region. Request all interesting data about other (root) agents
|
||||||
agent.SendOtherAgentsAvatarDataToMe();
|
agent.SendOtherAgentsAvatarDataToMe();
|
||||||
agent.SendOtherAgentsAppearanceToMe();
|
agent.SendOtherAgentsAppearanceToMe();
|
||||||
|
|
||||||
// Backwards compatibility
|
// Backwards compatibility. Best effort
|
||||||
if (version == "Unknown" || version == string.Empty)
|
if (version == "Unknown" || version == string.Empty)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one...");
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
|
||||||
|
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
|
||||||
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Next, let's close the child agent connections that are too far away.
|
||||||
|
agent.CloseChildAgents(neighbourx, neighboury);
|
||||||
|
|
||||||
AgentHasMovedAway(agent, false);
|
AgentHasMovedAway(agent, false);
|
||||||
|
|
||||||
// the user may change their profile information in other region,
|
// the user may change their profile information in other region,
|
||||||
|
@ -1088,16 +1081,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||||
CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
|
CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
|
||||||
ScenePresence agent = icon.EndInvoke(iar);
|
ScenePresence agent = icon.EndInvoke(iar);
|
||||||
|
|
||||||
// If the cross was successful, this agent is a child agent
|
//// If the cross was successful, this agent is a child agent
|
||||||
if (agent.IsChildAgent)
|
//if (agent.IsChildAgent)
|
||||||
agent.Reset();
|
// agent.Reset();
|
||||||
else // Not successful
|
//else // Not successful
|
||||||
agent.RestoreInCurrentScene();
|
// agent.RestoreInCurrentScene();
|
||||||
|
|
||||||
// In any case
|
// In any case
|
||||||
agent.IsInTransit = false;
|
agent.IsInTransit = false;
|
||||||
|
|
||||||
//m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
|
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in New Issue