From 5d29c0ec9d917c9edd251f8bf171c44e6922c4cf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 15 Aug 2010 18:10:54 -0700 Subject: Addresses mantis #4929. Agent was being logged off the grid too soon -- things may still fail. --- .../Framework/EntityTransfer/EntityTransferModule.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs') 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 string reason = String.Empty; // Let's create an agent there if one doesn't exist yet. - if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason)) + bool logout = false; + if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) { sp.ControllingClient.SendTeleportFailed(String.Format("Destination refused: {0}", reason)); @@ -434,8 +435,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it CrossAttachmentsIntoNewRegion(finalDestination, sp, true); + // Well, this is it. The agent is over there. + KillEntity(sp.Scene, sp.LocalId); + // May need to logout or other cleanup + AgentHasMovedAway(sp.ControllingClient.SessionId, logout); + // Now let's make it officially a child agent sp.MakeChildAgent(); @@ -483,8 +489,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } - protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason) + protected virtual bool CreateAgent(ScenePresence sp, GridRegion reg, GridRegion finalDestination, AgentCircuitData agentCircuit, uint teleportFlags, out string reason, out bool logout) { + logout = false; return m_aScene.SimulationService.CreateAgent(finalDestination, agentCircuit, teleportFlags, out reason); } @@ -500,6 +507,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } + protected virtual void AgentHasMovedAway(UUID sessionID, bool logout) + { + } + protected void KillEntity(Scene scene, uint localID) { scene.SendKillObject(localID); -- cgit v1.1