diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Hypergrid')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | 53 |
1 files changed, 30 insertions, 23 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs index 363a93f..bcd378f 100644 --- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs | |||
@@ -180,40 +180,40 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
180 | // once we reach here... | 180 | // once we reach here... |
181 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); | 181 | //avatar.Scene.RemoveCapsHandler(avatar.UUID); |
182 | 182 | ||
183 | // Let's close some agents | ||
184 | if (isHyperLink) // close them all except this one | ||
185 | { | ||
186 | List<ulong> regions = new List<ulong>(avatar.KnownChildRegionHandles); | ||
187 | regions.Remove(avatar.Scene.RegionInfo.RegionHandle); | ||
188 | SendCloseChildAgentConnections(avatar.UUID, regions); | ||
189 | } | ||
190 | else // close just a few | ||
191 | avatar.CloseChildAgents(newRegionX, newRegionY); | ||
192 | |||
193 | string capsPath = String.Empty; | 183 | string capsPath = String.Empty; |
194 | AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); | 184 | AgentCircuitData agentCircuit = avatar.ControllingClient.RequestClientInfo(); |
195 | agent.BaseFolder = UUID.Zero; | 185 | agentCircuit.BaseFolder = UUID.Zero; |
196 | agent.InventoryFolder = UUID.Zero; | 186 | agentCircuit.InventoryFolder = UUID.Zero; |
197 | agent.startpos = position; | 187 | agentCircuit.startpos = position; |
198 | agent.child = true; | 188 | agentCircuit.child = true; |
199 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) | 189 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) |
200 | { | 190 | { |
201 | // brand new agent, let's create a new caps seed | 191 | // brand new agent, let's create a new caps seed |
202 | agent.CapsPath = Util.GetRandomCapsPath(); | 192 | agentCircuit.CapsPath = Util.GetRandomCapsPath(); |
203 | } | 193 | } |
204 | 194 | ||
205 | if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent)) | 195 | if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit)) |
206 | { | 196 | { |
207 | avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports."); | 197 | avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports."); |
208 | return; | 198 | return; |
209 | } | 199 | } |
210 | 200 | ||
201 | // Let's close some agents | ||
202 | if (isHyperLink) // close them all except this one | ||
203 | { | ||
204 | List<ulong> regions = new List<ulong>(avatar.KnownChildRegionHandles); | ||
205 | regions.Remove(avatar.Scene.RegionInfo.RegionHandle); | ||
206 | SendCloseChildAgentConnections(avatar.UUID, regions); | ||
207 | } | ||
208 | else // close just a few | ||
209 | avatar.CloseChildAgents(newRegionX, newRegionY); | ||
210 | |||
211 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) | 211 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) |
212 | { | 212 | { |
213 | // TODO Should construct this behind a method | 213 | // TODO Should construct this behind a method |
214 | capsPath = | 214 | capsPath = |
215 | "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 215 | "http://" + reg.ExternalHostName + ":" + reg.HttpPort |
216 | + "/CAPS/" + agent.CapsPath + "0000/"; | 216 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; |
217 | 217 | ||
218 | if (eq != null) | 218 | if (eq != null) |
219 | { | 219 | { |
@@ -237,9 +237,9 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
237 | else | 237 | else |
238 | { | 238 | { |
239 | // child agent already there | 239 | // child agent already there |
240 | agent.CapsPath = avatar.Scene.GetChildSeed(avatar.UUID, reg.RegionHandle); | 240 | agentCircuit.CapsPath = avatar.Scene.GetChildSeed(avatar.UUID, reg.RegionHandle); |
241 | capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort | 241 | capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort |
242 | + "/CAPS/" + agent.CapsPath + "0000/"; | 242 | + "/CAPS/" + agentCircuit.CapsPath + "0000/"; |
243 | } | 243 | } |
244 | 244 | ||
245 | //m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, | 245 | //m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId, |
@@ -256,10 +256,17 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
256 | // return; | 256 | // return; |
257 | //} | 257 | //} |
258 | 258 | ||
259 | // Let's send a full update of the agent. This is a synchronous call. | ||
260 | AgentData agent = new AgentData(); | ||
261 | avatar.CopyTo(agent); | ||
262 | agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!! | ||
263 | |||
264 | m_interregionCommsOut.SendChildAgentUpdate(reg.RegionHandle, agent); | ||
265 | |||
259 | avatar.MakeChildAgent(); | 266 | avatar.MakeChildAgent(); |
260 | 267 | ||
261 | m_log.DebugFormat( | 268 | m_log.DebugFormat( |
262 | "[CAPS]: Sending new CAPS seed url {0} to client {1}", agent.CapsPath, avatar.UUID); | 269 | "[CAPS]: Sending new CAPS seed url {0} to client {1}", agentCircuit.CapsPath, avatar.UUID); |
263 | 270 | ||
264 | 271 | ||
265 | /// | 272 | /// |
@@ -291,7 +298,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
291 | // we send the attachments and close things here. | 298 | // we send the attachments and close things here. |
292 | // It would be nice if the client would tell us when that whole thing is done, so we wouldn't have | 299 | // It would be nice if the client would tell us when that whole thing is done, so we wouldn't have |
293 | // to use this Thread.Sleep voodoo | 300 | // to use this Thread.Sleep voodoo |
294 | Thread.Sleep(3000); | 301 | Thread.Sleep(4000); |
295 | 302 | ||
296 | // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it | 303 | // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it |
297 | avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true); | 304 | avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true); |
@@ -303,7 +310,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid | |||
303 | /// | 310 | /// |
304 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) | 311 | if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY) || isHyperLink) |
305 | { | 312 | { |
306 | Thread.Sleep(5000); | 313 | Thread.Sleep(8000); |
307 | avatar.Close(); | 314 | avatar.Close(); |
308 | CloseConnection(avatar.UUID); | 315 | CloseConnection(avatar.UUID); |
309 | } | 316 | } |