aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2013-03-21 23:37:23 +0000
committerJustin Clark-Casey (justincc)2013-03-21 23:37:23 +0000
commite23a0dcc5dd5f2869fe0da39452e075cec34199b (patch)
treee4bdecda353db41f0cf5635b733a16e6c221aca4 /OpenSim/Region
parentOn a teleport, lock m_agentsInTransit whilst we grab the value to check for c... (diff)
downloadopensim-SC-e23a0dcc5dd5f2869fe0da39452e075cec34199b.zip
opensim-SC-e23a0dcc5dd5f2869fe0da39452e075cec34199b.tar.gz
opensim-SC-e23a0dcc5dd5f2869fe0da39452e075cec34199b.tar.bz2
opensim-SC-e23a0dcc5dd5f2869fe0da39452e075cec34199b.tar.xz
minor: On teleport, signal a child agent before we send the viewer TeleportFinish in order to avoid a theoretical race condition when teleporting to a neighbour.
If we do this after TeleportFinish, then it's possible for a neighbour destination to request the source to create a child agent whilst its still treated as root. This closes the original presence which we don't really want to do. This is probably okay (albeit with warnings on the console) but afaics there's no reason not to move the child agent signal.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs10
1 files changed, 5 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 58a6654..82358d8 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -686,6 +686,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
686 "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", 686 "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}",
687 capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); 687 capsPath, sp.Scene.RegionInfo.RegionName, sp.Name);
688 688
689 // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator,
690 // where that neighbour simulator could otherwise request a child agent create on the source which then
691 // closes our existing agent which is still signalled as root.
692 sp.IsChildAgent = true;
693
689 if (m_eqModule != null) 694 if (m_eqModule != null)
690 { 695 {
691 m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); 696 m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID);
@@ -696,9 +701,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
696 teleportFlags, capsPath); 701 teleportFlags, capsPath);
697 } 702 }
698 703
699 // Let's set this to true tentatively. This does not trigger OnChildAgent
700 sp.IsChildAgent = true;
701
702 // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which 704 // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
703 // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation 705 // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation
704 // that the client contacted the destination before we close things here. 706 // that the client contacted the destination before we close things here.
@@ -731,8 +733,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
731 // Now let's make it officially a child agent 733 // Now let's make it officially a child agent
732 sp.MakeChildAgent(); 734 sp.MakeChildAgent();
733 735
734// sp.Scene.CleanDroppedAttachments();
735
736 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone 736 // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone
737 737
738 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) 738 if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg))