diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 0707119..5d50a83 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -180,6 +180,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
180 | 180 | ||
181 | sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); | 181 | sp.ControllingClient.SendLocalTeleport(position, lookAt, teleportFlags); |
182 | sp.Teleport(position); | 182 | sp.Teleport(position); |
183 | |||
184 | foreach (SceneObjectGroup grp in sp.Attachments) | ||
185 | sp.Scene.EventManager.TriggerOnScriptChangedEvent(grp.LocalId, (uint)Changed.TELEPORT); | ||
183 | } | 186 | } |
184 | else // Another region possibly in another simulator | 187 | else // Another region possibly in another simulator |
185 | { | 188 | { |
@@ -393,7 +396,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
393 | agent.Position = position; | 396 | agent.Position = position; |
394 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 397 | SetCallbackURL(agent, sp.Scene.RegionInfo); |
395 | 398 | ||
396 | UpdateAgent(reg, finalDestination, agent); | 399 | if (!UpdateAgent(reg, finalDestination, agent)) |
400 | { | ||
401 | // Region doesn't take it | ||
402 | Fail(sp, finalDestination); | ||
403 | return; | ||
404 | } | ||
397 | 405 | ||
398 | m_log.DebugFormat( | 406 | m_log.DebugFormat( |
399 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); | 407 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} to client {1}", capsPath, sp.UUID); |
@@ -418,21 +426,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
418 | // that the client contacted the destination before we send the attachments and close things here. | 426 | // that the client contacted the destination before we send the attachments and close things here. |
419 | if (!WaitForCallback(sp.UUID)) | 427 | if (!WaitForCallback(sp.UUID)) |
420 | { | 428 | { |
421 | // Client never contacted destination. Let's restore everything back | 429 | Fail(sp, finalDestination); |
422 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); | ||
423 | |||
424 | // Fail. Reset it back | ||
425 | sp.IsChildAgent = false; | ||
426 | |||
427 | ResetFromTransit(sp.UUID); | ||
428 | |||
429 | // Yikes! We should just have a ref to scene here. | ||
430 | //sp.Scene.InformClientOfNeighbours(sp); | ||
431 | EnableChildAgents(sp); | ||
432 | |||
433 | // Finally, kill the agent we just created at the destination. | ||
434 | m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); | ||
435 | |||
436 | return; | 430 | return; |
437 | } | 431 | } |
438 | 432 | ||
@@ -472,6 +466,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
472 | } | 466 | } |
473 | } | 467 | } |
474 | 468 | ||
469 | private void Fail(ScenePresence sp, GridRegion finalDestination) | ||
470 | { | ||
471 | // Client never contacted destination. Let's restore everything back | ||
472 | sp.ControllingClient.SendTeleportFailed("Problems connecting to destination."); | ||
473 | |||
474 | // Fail. Reset it back | ||
475 | sp.IsChildAgent = false; | ||
476 | |||
477 | ResetFromTransit(sp.UUID); | ||
478 | |||
479 | EnableChildAgents(sp); | ||
480 | |||
481 | // Finally, kill the agent we just created at the destination. | ||
482 | m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID); | ||
483 | |||
484 | } | ||
475 | 485 | ||
476 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) | 486 | protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) |
477 | { | 487 | { |
@@ -810,7 +820,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
810 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + | 820 | cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + |
811 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; | 821 | "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; |
812 | 822 | ||
813 | m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent); | 823 | if (!m_scene.SimulationService.UpdateAgent(neighbourRegion, cAgent)) |
824 | { | ||
825 | // region doesn't take it | ||
826 | ResetFromTransit(agent.UUID); | ||
827 | return agent; | ||
828 | } | ||
814 | 829 | ||
815 | // Next, let's close the child agent connections that are too far away. | 830 | // Next, let's close the child agent connections that are too far away. |
816 | agent.CloseChildAgents(neighbourx, neighboury); | 831 | agent.CloseChildAgents(neighbourx, neighboury); |
@@ -1120,7 +1135,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1120 | string reason = String.Empty; | 1135 | string reason = String.Empty; |
1121 | 1136 | ||
1122 | 1137 | ||
1123 | bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, 0, out reason); // m_interregionCommsOut.SendCreateChildAgent(reg.RegionHandle, a, 0, out reason); | 1138 | bool regionAccepted = m_scene.SimulationService.CreateAgent(reg, a, (uint)TeleportFlags.Default, out reason); |
1124 | 1139 | ||
1125 | if (regionAccepted && newAgent) | 1140 | if (regionAccepted && newAgent) |
1126 | { | 1141 | { |