aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 364d340..607219e 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -307,7 +307,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
307 string reason = String.Empty; 307 string reason = String.Empty;
308 308
309 // Let's create an agent there if one doesn't exist yet. 309 // Let's create an agent there if one doesn't exist yet.
310 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason)) 310 bool logout = false;
311 if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
311 { 312 {
312 sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", 313 sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}",
313 reason)); 314 reason));
@@ -434,8 +435,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
434 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 435 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
435 CrossAttachmentsIntoNewRegion(finalDestination, sp, true); 436 CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
436 437
438 // Well, this is it. The agent is over there.
439
437 KillEntity(sp.Scene, sp.LocalId); 440 KillEntity(sp.Scene, sp.LocalId);
438 441
442 // May need to logout or other cleanup
443 AgentHasMovedAway(sp.ControllingClient.SessionId, logout);
444
439 // Now let's make it officially a child agent 445 // Now let's make it officially a child agent
440 sp.MakeChildAgent(); 446 sp.MakeChildAgent();
441 447
@@ -483,8 +489,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
483 489
484 } 490 }
485 491
486 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) 492 protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout)
487 { 493 {
494 logout = false;
488 return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); 495 return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason);
489 } 496 }
490 497
@@ -500,6 +507,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
500 507
501 } 508 }
502 509
510 protected virtual void AgentHasMovedAway(UUID sessionID, bool logout)
511 {
512 }
513
503 protected void KillEntity(Scene scene, uint localID) 514 protected void KillEntity(Scene scene, uint localID)
504 { 515 {
505 scene.SendKillObject(localID); 516 scene.SendKillObject(localID);