aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs46
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
2 files changed, 31 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index a33f5c5..5d50a83 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -396,7 +396,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
396 agent.Position = position; 396 agent.Position = position;
397 SetCallbackURL(agent, sp.Scene.RegionInfo); 397 SetCallbackURL(agent, sp.Scene.RegionInfo);
398 398
399 UpdateAgent(reg, finalDestination, agent); 399 if (!UpdateAgent(reg, finalDestination, agent))
400 {
401 // Region doesn't take it
402 Fail(sp, finalDestination);
403 return;
404 }
400 405
401 m_log.DebugFormat( 406 m_log.DebugFormat(
402 "[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);
@@ -421,21 +426,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
421 // 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.
422 if (!WaitForCallback(sp.UUID)) 427 if (!WaitForCallback(sp.UUID))
423 { 428 {
424 // Client never contacted destination. Let's restore everything back 429 Fail(sp, finalDestination);
425 sp.ControllingClient.SendTeleportFailed("Problems connecting to destination.");
426
427 // Fail. Reset it back
428 sp.IsChildAgent = false;
429
430 ResetFromTransit(sp.UUID);
431
432 // Yikes! We should just have a ref to scene here.
433 //sp.Scene.InformClientOfNeighbours(sp);
434 EnableChildAgents(sp);
435
436 // Finally, kill the agent we just created at the destination.
437 m_aScene.SimulationService.CloseAgent(finalDestination, sp.UUID);
438
439 return; 430 return;
440 } 431 }
441 432
@@ -475,6 +466,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
475 } 466 }
476 } 467 }
477 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 }
478 485
479 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)
480 { 487 {
@@ -813,7 +820,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
813 cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort + 820 cAgent.CallbackURI = "http://" + m_scene.RegionInfo.ExternalHostName + ":" + m_scene.RegionInfo.HttpPort +
814 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/"; 821 "/agent/" + agent.UUID.ToString() + "/" + m_scene.RegionInfo.RegionID.ToString() + "/release/";
815 822
816 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 }
817 829
818 // 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.
819 agent.CloseChildAgents(neighbourx, neighboury); 831 agent.CloseChildAgents(neighbourx, neighboury);
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a89060c..55060c3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3903,6 +3903,8 @@ namespace OpenSim.Region.Framework.Scenes
3903 m_log.DebugFormat( 3903 m_log.DebugFormat(
3904 "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName); 3904 "[SCENE]: Incoming child agent update for {0} in {1}", cAgentData.AgentID, RegionInfo.RegionName);
3905 3905
3906 // XPTO: if this agent is not allowed here as root, always return false
3907
3906 // We have to wait until the viewer contacts this region after receiving EAC. 3908 // We have to wait until the viewer contacts this region after receiving EAC.
3907 // That calls AddNewClient, which finally creates the ScenePresence 3909 // That calls AddNewClient, which finally creates the ScenePresence
3908 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID); 3910 ScenePresence childAgentUpdate = WaitGetScenePresence(cAgentData.AgentID);