diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 120 |
1 files changed, 66 insertions, 54 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 85b5da0..2f0bbb2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | |||
@@ -1085,70 +1085,82 @@ namespace OpenSim.Region.Framework.Scenes | |||
1085 | agent.Name, agent.UUID, agent.Scene.RegionInfo.RegionName); | 1085 | agent.Name, agent.UUID, agent.Scene.RegionInfo.RegionName); |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | bool crossingSuccessful = | 1088 | //bool crossingSuccessful = |
1089 | CrossToNeighbouringRegion(neighbourHandle, agent.ControllingClient.AgentId, pos, | 1089 | // CrossToNeighbouringRegion(neighbourHandle, agent.ControllingClient.AgentId, pos, |
1090 | isFlying); | 1090 | //isFlying); |
1091 | if (crossingSuccessful) | 1091 | |
1092 | SetInTransit(agent.UUID); | ||
1093 | AgentData cAgent = new AgentData(); | ||
1094 | agent.CopyTo(cAgent); | ||
1095 | cAgent.Position = pos; | ||
1096 | if (isFlying) | ||
1097 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | ||
1098 | cAgent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + | ||
1099 | "/agent/" + agent.UUID.ToString() + "/" + agent.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; | ||
1100 | |||
1101 | m_interregionCommsOut.SendChildAgentUpdate(neighbourHandle, cAgent); | ||
1102 | |||
1103 | // Next, let's close the child agent connections that are too far away. | ||
1104 | agent.CloseChildAgents(neighbourx, neighboury); | ||
1105 | |||
1106 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | ||
1107 | agent.ControllingClient.RequestClientInfo(); | ||
1108 | |||
1109 | //Console.WriteLine("BEFORE CROSS"); | ||
1110 | //Scene.DumpChildrenSeeds(UUID); | ||
1111 | //DumpKnownRegions(); | ||
1112 | string agentcaps; | ||
1113 | if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps)) | ||
1092 | { | 1114 | { |
1093 | // Next, let's close the child agent connections that are too far away. | 1115 | m_log.ErrorFormat("[SCENE COMM]: No CAPS information for region handle {0}, exiting CrossToNewRegion.", |
1094 | agent.CloseChildAgents(neighbourx, neighboury); | 1116 | neighbourRegion.RegionHandle); |
1117 | return agent; | ||
1118 | } | ||
1119 | // TODO Should construct this behind a method | ||
1120 | string capsPath = | ||
1121 | "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort | ||
1122 | + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; | ||
1095 | 1123 | ||
1096 | //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); | 1124 | m_log.DebugFormat("[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); |
1097 | agent.ControllingClient.RequestClientInfo(); | ||
1098 | 1125 | ||
1099 | //Console.WriteLine("BEFORE CROSS"); | 1126 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); |
1100 | //Scene.DumpChildrenSeeds(UUID); | 1127 | if (eq != null) |
1101 | //DumpKnownRegions(); | 1128 | { |
1102 | string agentcaps; | 1129 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, |
1103 | if (!agent.KnownRegions.TryGetValue(neighbourRegion.RegionHandle, out agentcaps)) | 1130 | capsPath, agent.UUID, agent.ControllingClient.SessionId); |
1104 | { | 1131 | } |
1105 | m_log.ErrorFormat("[SCENE COMM]: No CAPS information for region handle {0}, exiting CrossToNewRegion.", | 1132 | else |
1106 | neighbourRegion.RegionHandle); | 1133 | { |
1107 | return agent; | 1134 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, |
1108 | } | 1135 | capsPath); |
1109 | // TODO Should construct this behind a method | 1136 | } |
1110 | string capsPath = | ||
1111 | "http://" + neighbourRegion.ExternalHostName + ":" + neighbourRegion.HttpPort | ||
1112 | + "/CAPS/" + agentcaps /*circuitdata.CapsPath*/ + "0000/"; | ||
1113 | 1137 | ||
1114 | m_log.DebugFormat("[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, agent.UUID); | 1138 | if (!WaitForCallback(agent.UUID)) |
1139 | { | ||
1140 | ResetFromTransit(agent.UUID); | ||
1115 | 1141 | ||
1116 | IEventQueue eq = agent.Scene.RequestModuleInterface<IEventQueue>(); | 1142 | // Yikes! We should just have a ref to scene here. |
1117 | if (eq != null) | 1143 | agent.Scene.InformClientOfNeighbours(agent); |
1118 | { | ||
1119 | eq.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | ||
1120 | capsPath, agent.UUID, agent.ControllingClient.SessionId); | ||
1121 | } | ||
1122 | else | ||
1123 | { | ||
1124 | agent.ControllingClient.CrossRegion(neighbourHandle, pos, agent.Velocity, neighbourRegion.ExternalEndPoint, | ||
1125 | capsPath); | ||
1126 | } | ||
1127 | 1144 | ||
1128 | agent.MakeChildAgent(); | 1145 | return agent; |
1129 | // now we have a child agent in this region. Request all interesting data about other (root) agents | 1146 | } |
1130 | agent.SendInitialFullUpdateToAllClients(); | ||
1131 | 1147 | ||
1132 | agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); | 1148 | agent.MakeChildAgent(); |
1149 | // now we have a child agent in this region. Request all interesting data about other (root) agents | ||
1150 | agent.SendInitialFullUpdateToAllClients(); | ||
1133 | 1151 | ||
1134 | // m_scene.SendKillObject(m_localId); | 1152 | agent.CrossAttachmentsIntoNewRegion(neighbourHandle, true); |
1135 | 1153 | ||
1136 | agent.Scene.NotifyMyCoarseLocationChange(); | 1154 | // m_scene.SendKillObject(m_localId); |
1137 | // the user may change their profile information in other region, | 1155 | |
1138 | // so the userinfo in UserProfileCache is not reliable any more, delete it | 1156 | agent.Scene.NotifyMyCoarseLocationChange(); |
1139 | if (agent.Scene.NeedSceneCacheClear(agent.UUID)) | 1157 | // the user may change their profile information in other region, |
1140 | { | 1158 | // so the userinfo in UserProfileCache is not reliable any more, delete it |
1141 | agent.Scene.CommsManager.UserProfileCacheService.RemoveUser(agent.UUID); | 1159 | if (agent.Scene.NeedSceneCacheClear(agent.UUID)) |
1142 | m_log.DebugFormat( | ||
1143 | "[SCENE COMM]: User {0} is going to another region, profile cache removed", agent.UUID); | ||
1144 | } | ||
1145 | } | ||
1146 | else | ||
1147 | { | 1160 | { |
1148 | //// Restore the user structures that we needed to delete before asking the receiving region | 1161 | agent.Scene.CommsManager.UserProfileCacheService.RemoveUser(agent.UUID); |
1149 | //// to complete the crossing | 1162 | m_log.DebugFormat( |
1150 | //userInfo.FetchInventory(); | 1163 | "[SCENE COMM]: User {0} is going to another region, profile cache removed", agent.UUID); |
1151 | //agent.Scene.CapsModule.AddCapsHandler(agent.UUID); | ||
1152 | } | 1164 | } |
1153 | } | 1165 | } |
1154 | 1166 | ||