diff options
author | Melanie | 2011-12-22 17:33:31 +0000 |
---|---|---|
committer | Melanie | 2011-12-22 17:33:31 +0000 |
commit | a15a58a7c172cc35cd6e04da1da65da8f33677c4 (patch) | |
tree | b271b26415d252d1c6e2fc443b65a73c5fc2969a | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Region crossings redone: (1) removed WaitForCallback. Now that we are passing... (diff) | |
download | opensim-SC-a15a58a7c172cc35cd6e04da1da65da8f33677c4.zip opensim-SC-a15a58a7c172cc35cd6e04da1da65da8f33677c4.tar.gz opensim-SC-a15a58a7c172cc35cd6e04da1da65da8f33677c4.tar.bz2 opensim-SC-a15a58a7c172cc35cd6e04da1da65da8f33677c4.tar.xz |
Merge branch 'master' into careminster
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 71 |
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 810c3b4..e5906f3 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -695,9 +695,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
695 | Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); | 695 | Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); |
696 | Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); | 696 | Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0); |
697 | 697 | ||
698 | // distance to edge that will trigger crossing | ||
699 | |||
700 | |||
701 | // distance into new region to place avatar | 698 | // distance into new region to place avatar |
702 | const float enterDistance = 0.5f; | 699 | const float enterDistance = 0.5f; |
703 | 700 | ||
@@ -979,29 +976,31 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
979 | m_log.DebugFormat( | 976 | m_log.DebugFormat( |
980 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", | 977 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for region crossing of {0} from {1} to {2}. Continuing.", |
981 | agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); | 978 | agent.Name, agent.Scene.RegionInfo.RegionName, neighbourRegion.RegionName); |
982 | 979 | ||
983 | pos = pos + (agent.Velocity); | 980 | pos = pos + agent.Velocity; |
984 | 981 | Vector3 vel2 = new Vector3(agent.Velocity.X, agent.Velocity.Y, 0); | |
982 | |||
983 | agent.RemoveFromPhysicalScene(); | ||
985 | SetInTransit(agent.UUID); | 984 | SetInTransit(agent.UUID); |
986 | AgentData cAgent = new AgentData(); | 985 | |
986 | AgentData cAgent = new AgentData(); | ||
987 | agent.CopyTo(cAgent); | 987 | agent.CopyTo(cAgent); |
988 | cAgent.Position = pos; | 988 | cAgent.Position = pos; |
989 | if (isFlying) | 989 | if (isFlying) |
990 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 990 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
991 | cAgent.CallbackURI = m_scene.RegionInfo.ServerURI + | 991 | |
992 | "agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 992 | // We don't need the callback anymnore |
993 | 993 | cAgent.CallbackURI = String.Empty; | |
994 | |||
994 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) | 995 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
995 | { | 996 | { |
996 | // region doesn't take it | 997 | // region doesn't take it |
997 | ReInstantiateScripts(agent); | 998 | ReInstantiateScripts(agent); |
999 | agent.AddToPhysicalScene(isFlying); | ||
998 | ResetFromTransit(agent.UUID); | 1000 | ResetFromTransit(agent.UUID); |
999 | return agent; | 1001 | return agent; |
1000 | } | 1002 | } |
1001 | 1003 | ||
1002 | // Next, let's close the child agent connections that are too far away. | ||
1003 | agent.CloseChildAgents(neighbourx, neighboury); | ||
1004 | |||
1005 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1004 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); |
1006 | agent.ControllingClient.RequestClientInfo(); | 1005 | agent.ControllingClient.RequestClientInfo(); |
1007 | 1006 | ||
@@ -1018,11 +1017,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1018 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); | 1017 | string capsPath = neighbourRegion.ServerURI + CapsUtil.GetCapsSeedPath(agentcaps); |
1019 | 1018 | ||
1020 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 1019 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
1021 | 1020 | ||
1022 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); | 1021 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); |
1023 | if (eq != null) | 1022 | if (eq != null) |
1024 | { | 1023 | { |
1025 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 1024 | eq.CrossRegion(neighbourHandle, pos, vel2 /* agent.Velocity */, neighbourRegion.ExternalEndPoint, |
1026 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | 1025 | capsPath, agent.UUID, agent.ControllingClient.SessionId); |
1027 | } | 1026 | } |
1028 | else | 1027 | else |
@@ -1030,32 +1029,26 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1030 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | 1029 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, |
1031 | capsPath); | 1030 | capsPath); |
1032 | } | 1031 | } |
1033 | 1032 | ||
1034 | if (!WaitForCallback(agent.UUID)) | 1033 | // SUCCESS! |
1035 | { | ||
1036 | m_log.Debug("[ENTITY TRANSFER MODULE]: Callback never came in crossing agent"); | ||
1037 | ReInstantiateScripts(agent); | ||
1038 | ResetFromTransit(agent.UUID); | ||
1039 | |||
1040 | // Yikes! We should just have a ref to scene here. | ||
1041 | //agent.Scene.InformClientOfNeighbours(agent); | ||
1042 | EnableChildAgents(agent); | ||
1043 | |||
1044 | return agent; | ||
1045 | } | ||
1046 | |||
1047 | agent.MakeChildAgent(); | 1034 | agent.MakeChildAgent(); |
1048 | 1035 | ResetFromTransit(agent.UUID); | |
1036 | |||
1049 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 1037 | // now we have a child agent in this region. Request all interesting data about other (root) agents |
1050 | agent.SendOtherAgentsAvatarDataToMe(); | 1038 | agent.SendOtherAgentsAvatarDataToMe(); |
1051 | agent.SendOtherAgentsAppearanceToMe(); | 1039 | agent.SendOtherAgentsAppearanceToMe(); |
1052 | 1040 | ||
1053 | // Backwards compatibility | 1041 | // Backwards compatibility. Best effort |
1054 | if (version == "Unknown" || version == string.Empty) | 1042 | if (version == "Unknown" || version == string.Empty) |
1055 | { | 1043 | { |
1056 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old neighbor, passing attachments one by one..."); | 1044 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); |
1045 | Thread.Sleep(3000); // wait a little now that we're not waiting for the callback | ||
1057 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); | 1046 | CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true); |
1058 | } | 1047 | } |
1048 | |||
1049 | |||
1050 | // Next, let's close the child agent connections that are too far away. | ||
1051 | agent.CloseChildAgents(neighbourx, neighboury); | ||
1059 | 1052 | ||
1060 | AgentHasMovedAway(agent, false); | 1053 | AgentHasMovedAway(agent, false); |
1061 | 1054 | ||
@@ -1088,16 +1081,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1088 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; | 1081 | CrossAgentToNewRegionDelegate icon = (CrossAgentToNewRegionDelegate)iar.AsyncState; |
1089 | ScenePresence agent = icon.EndInvoke(iar); | 1082 | ScenePresence agent = icon.EndInvoke(iar); |
1090 | 1083 | ||
1091 | // If the cross was successful, this agent is a child agent | 1084 | //// If the cross was successful, this agent is a child agent |
1092 | if (agent.IsChildAgent) | 1085 | //if (agent.IsChildAgent) |
1093 | agent.Reset(); | 1086 | // agent.Reset(); |
1094 | else // Not successful | 1087 | //else // Not successful |
1095 | agent.RestoreInCurrentScene(); | 1088 | // agent.RestoreInCurrentScene(); |
1096 | 1089 | ||
1097 | // In any case | 1090 | // In any case |
1098 | agent.IsInTransit = false; | 1091 | agent.IsInTransit = false; |
1099 | 1092 | ||
1100 | //m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); | 1093 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Crossing agent {0} {1} completed.", agent.Firstname, agent.Lastname); |
1101 | } | 1094 | } |
1102 | 1095 | ||
1103 | #endregion | 1096 | #endregion |