aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs71
1 files changed, 32 insertions, 39 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 87f292c..b9d5d32 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -676,9 +676,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
676 Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); 676 Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
677 Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); 677 Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
678 678
679 // distance to edge that will trigger crossing
680
681
682 // distance into new region to place avatar 679 // distance into new region to place avatar
683 const float enterDistance = 0.5f; 680 const float enterDistance = 0.5f;
684 681
@@ -960,29 +957,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
960 m_log.DebugFormat( 957 m_log.DebugFormat(
961 "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", 958 "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.",
962 agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); 959 agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName);
963 960
964 pos = pos + (agent.Velocity); 961 pos = pos + agent.Velocity;
965 962 Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0);
963
964 agent.RemoveFromPhysicalScene();
966 SetInTransit(agent.UUID); 965 SetInTransit(agent.UUID);
967 AgentData cAgent = new AgentData(); 966
967 AgentData cAgent = new AgentData();
968 agent.CopyTo(cAgent); 968 agent.CopyTo(cAgent);
969 cAgent.Position = pos; 969 cAgent.Position = pos;
970 if (isFlying) 970 if (isFlying)
971 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; 971 cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY;
972 cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + 972
973 "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 973 // We don't need the callback anymnore
974 974 cAgent.CallbackURI = String.Empty;
975
975 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) 976 if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent))
976 { 977 {
977 // region doesn't take it 978 // region doesn't take it
978 ReInstantiateScripts(agent); 979 ReInstantiateScripts(agent);
980 agent.AddToPhysicalScene(isFlying);
979 ResetFromTransit(agent.UUID); 981 ResetFromTransit(agent.UUID);
980 return agent; 982 return agent;
981 } 983 }
982 984
983 // Next, let's close the child agent connections that are too far away.
984 agent.CloseChildAgents(neighbourx, neighboury);
985
986 //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); 985 //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo();
987 agent.ControllingClient.RequestClientInfo(); 986 agent.ControllingClient.RequestClientInfo();
988 987
@@ -999,11 +998,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
999 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); 998 string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps);
1000 999
1001 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); 1000 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID);
1002 1001
1003 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); 1002 IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>();
1004 if (eq != null) 1003 if (eq != null)
1005 { 1004 {
1006 eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, 1005 eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint,
1007 capsPath, agent.UUID, agent.ControllingClient.SessionId); 1006 capsPath, agent.UUID, agent.ControllingClient.SessionId);
1008 } 1007 }
1009 else 1008 else
@@ -1011,32 +1010,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1011 agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, 1010 agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint,
1012 capsPath); 1011 capsPath);
1013 } 1012 }
1014 1013
1015 if (!WaitForCallback(agent.UUID)) 1014 // SUCCESS!
1016 {
1017 m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent");
1018 ReInstantiateScripts(agent);
1019 ResetFromTransit(agent.UUID);
1020
1021 // Yikes! We should just have a ref to scene here.
1022 //agent.Scene.InformClientOfNeighbours(agent);
1023 EnableChildAgents(agent);
1024
1025 return agent;
1026 }
1027
1028 agent.MakeChildAgent(); 1015 agent.MakeChildAgent();
1029 1016 ResetFromTransit(agent.UUID);
1017
1030 // now we have a child agent in this region. Request all interesting data about other (root) agents 1018 // now we have a child agent in this region. Request all interesting data about other (root) agents
1031 agent.SendOtherAgentsAvatarDataToMe(); 1019 agent.SendOtherAgentsAvatarDataToMe();
1032 agent.SendOtherAgentsAppearanceToMe(); 1020 agent.SendOtherAgentsAppearanceToMe();
1033 1021
1034 // Backwards compatibility 1022 // Backwards compatibility. Best effort
1035 if (version == "Unknown" || version == string.Empty) 1023 if (version == "Unknown" || version == string.Empty)
1036 { 1024 {
1037 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one..."); 1025 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
1026 Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
1038 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); 1027 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1039 } 1028 }
1029
1030
1031 // Next, let's close the child agent connections that are too far away.
1032 agent.CloseChildAgents(neighbourx, neighboury);
1040 1033
1041 AgentHasMovedAway(agent, false); 1034 AgentHasMovedAway(agent, false);
1042 1035
@@ -1069,16 +1062,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1069 CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; 1062 CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState;
1070 ScenePresence agent = icon.EndInvoke(iar); 1063 ScenePresence agent = icon.EndInvoke(iar);
1071 1064
1072 // If the cross was successful, this agent is a child agent 1065 //// If the cross was successful, this agent is a child agent
1073 if (agent.IsChildAgent) 1066 //if (agent.IsChildAgent)
1074 agent.Reset(); 1067 // agent.Reset();
1075 else // Not successful 1068 //else // Not successful
1076 agent.RestoreInCurrentScene(); 1069 // agent.RestoreInCurrentScene();
1077 1070
1078 // In any case 1071 // In any case
1079 agent.IsInTransit = false; 1072 agent.IsInTransit = false;
1080 1073
1081 //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); 1074 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname);
1082 } 1075 }
1083 1076
1084 #endregion 1077 #endregion