diff options
author | Diva Canto | 2013-07-21 20:22:13 -0700 |
---|---|---|
committer | Diva Canto | 2013-07-24 14:27:37 -0700 |
commit | aae29c0ee2467a7978df53dba6f8461d1f566c59 (patch) | |
tree | 9e53c07e1f619956da2c2470a90b43b559a47168 /OpenSim/Region/CoreModules | |
parent | EXPERIMENTAL: yet another variation of ES/EAC/TPFinish (diff) | |
download | opensim-SC-aae29c0ee2467a7978df53dba6f8461d1f566c59.zip opensim-SC-aae29c0ee2467a7978df53dba6f8461d1f566c59.tar.gz opensim-SC-aae29c0ee2467a7978df53dba6f8461d1f566c59.tar.bz2 opensim-SC-aae29c0ee2467a7978df53dba6f8461d1f566c59.tar.xz |
Further tweaks on TPs: not sending the callback URL and instead waiting 15sec before closing the agent. This seems to be working fairly well. The viewer seems to have an 8 sec delay between UseCircuitCode and CompleteMovement.
Also added back the position on UpdateAgent, because it's needed for TPing between neighboring regions.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 59 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | 2 |
2 files changed, 34 insertions, 27 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 3e7575b..5124aed 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -684,6 +684,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
684 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); | 684 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); |
685 | } | 685 | } |
686 | 686 | ||
687 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Contacting destination..."); | ||
688 | |||
687 | // Let's create an agent there if one doesn't exist yet. | 689 | // Let's create an agent there if one doesn't exist yet. |
688 | // NOTE: logout will always be false for a non-HG teleport. | 690 | // NOTE: logout will always be false for a non-HG teleport. |
689 | bool logout = false; | 691 | bool logout = false; |
@@ -724,8 +726,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
724 | // Past this point we have to attempt clean up if the teleport fails, so update transfer state. | 726 | // Past this point we have to attempt clean up if the teleport fails, so update transfer state. |
725 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); | 727 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); |
726 | 728 | ||
727 | // OK, it got this agent. Let's close some child agents | 729 | #region old protocol |
728 | sp.CloseChildAgents(newRegionX, newRegionY); | ||
729 | 730 | ||
730 | IClientIPEndpoint ipepClient; | 731 | IClientIPEndpoint ipepClient; |
731 | if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) | 732 | if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) |
@@ -775,11 +776,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
775 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); | 776 | capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath); |
776 | } | 777 | } |
777 | 778 | ||
779 | #endregion old protocol | ||
780 | |||
778 | // Let's send a full update of the agent. This is a synchronous call. | 781 | // Let's send a full update of the agent. This is a synchronous call. |
779 | AgentData agent = new AgentData(); | 782 | AgentData agent = new AgentData(); |
780 | sp.CopyTo(agent); | 783 | sp.CopyTo(agent); |
781 | agent.Position = position; | 784 | agent.Position = position; |
782 | SetCallbackURL(agent, sp.Scene.RegionInfo); | 785 | //SetCallbackURL(agent, sp.Scene.RegionInfo); |
783 | 786 | ||
784 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); | 787 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); |
785 | 788 | ||
@@ -801,6 +804,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
801 | // closes our existing agent which is still signalled as root. | 804 | // closes our existing agent which is still signalled as root. |
802 | sp.IsChildAgent = true; | 805 | sp.IsChildAgent = true; |
803 | 806 | ||
807 | // New protocol: send TP Finish directly, without prior ES or EAC. That's what happens in the Linden grid | ||
804 | if (m_eqModule != null) | 808 | if (m_eqModule != null) |
805 | { | 809 | { |
806 | m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); | 810 | m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); |
@@ -853,30 +857,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
853 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", | 857 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", |
854 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | 858 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); |
855 | 859 | ||
856 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which | 860 | //// TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which |
857 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation | 861 | //// trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation |
858 | // that the client contacted the destination before we close things here. | 862 | //// that the client contacted the destination before we close things here. |
859 | if (!m_entityTransferStateMachine.WaitForAgentArrivedAtDestination(sp.UUID)) | 863 | //if (!m_entityTransferStateMachine.WaitForAgentArrivedAtDestination(sp.UUID)) |
860 | { | 864 | //{ |
861 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | 865 | // if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) |
862 | { | 866 | // { |
863 | m_interRegionTeleportAborts.Value++; | 867 | // m_interRegionTeleportAborts.Value++; |
864 | 868 | ||
865 | m_log.DebugFormat( | 869 | // m_log.DebugFormat( |
866 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", | 870 | // "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after WaitForAgentArrivedAtDestination due to previous client close.", |
867 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | 871 | // sp.Name, finalDestination.RegionName, sp.Scene.Name); |
868 | 872 | ||
869 | return; | 873 | // return; |
870 | } | 874 | // } |
871 | 875 | ||
872 | m_log.WarnFormat( | 876 | // m_log.WarnFormat( |
873 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", | 877 | // "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", |
874 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 878 | // sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
875 | 879 | ||
876 | Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Destination region did not signal teleport completion."); | 880 | // Fail(sp, finalDestination, logout, currentAgentCircuit.SessionID.ToString(), "Destination region did not signal teleport completion."); |
877 | 881 | ||
878 | return; | 882 | // return; |
879 | } | 883 | //} |
880 | 884 | ||
881 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); | 885 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); |
882 | 886 | ||
@@ -897,6 +901,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
897 | // Now let's make it officially a child agent | 901 | // Now let's make it officially a child agent |
898 | sp.MakeChildAgent(); | 902 | sp.MakeChildAgent(); |
899 | 903 | ||
904 | // OK, it got this agent. Let's close some child agents | ||
905 | sp.CloseChildAgents(newRegionX, newRegionY); | ||
906 | |||
900 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 907 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
901 | 908 | ||
902 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 909 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
@@ -907,7 +914,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
907 | // | 914 | // |
908 | // This sleep can be increased if necessary. However, whilst it's active, | 915 | // This sleep can be increased if necessary. However, whilst it's active, |
909 | // an agent cannot teleport back to this region if it has teleported away. | 916 | // an agent cannot teleport back to this region if it has teleported away. |
910 | Thread.Sleep(2000); | 917 | Thread.Sleep(15000); |
911 | 918 | ||
912 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 919 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
913 | } | 920 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs index 172bea1..516ad40 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Presence/PresenceDetector.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence | |||
79 | 79 | ||
80 | public void OnConnectionClose(IClientAPI client) | 80 | public void OnConnectionClose(IClientAPI client) |
81 | { | 81 | { |
82 | if (!client.SceneAgent.IsChildAgent) | 82 | if (client != null && client.SceneAgent != null && !client.SceneAgent.IsChildAgent) |
83 | { | 83 | { |
84 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); | 84 | // m_log.DebugFormat("[PRESENCE DETECTOR]: Detected client logout {0} in {1}", client.AgentId, client.Scene.RegionInfo.RegionName); |
85 | m_PresenceService.LogoutAgent(client.SessionId); | 85 | m_PresenceService.LogoutAgent(client.SessionId); |