aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2014-10-17 03:08:41 +0100
committerUbitUmarov2014-10-17 03:08:41 +0100
commite99fea339823af6e903c6f44f39faa28016a39c1 (patch)
tree1a553fb0490c16751fa47d9c60cf255505c01a52 /OpenSim
parentMerge branch 'master' into ubitworkmaster (diff)
downloadopensim-SC_OLD-e99fea339823af6e903c6f44f39faa28016a39c1.zip
opensim-SC_OLD-e99fea339823af6e903c6f44f39faa28016a39c1.tar.gz
opensim-SC_OLD-e99fea339823af6e903c6f44f39faa28016a39c1.tar.bz2
opensim-SC_OLD-e99fea339823af6e903c6f44f39faa28016a39c1.tar.xz
send correct caps seed on CreateAgent to a nearby region
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs68
1 files changed, 23 insertions, 45 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b735f36..56229df 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -740,11 +740,29 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
740 agentCircuit.Id0 = currentAgentCircuit.Id0; 740 agentCircuit.Id0 = currentAgentCircuit.Id0;
741 } 741 }
742 742
743 IClientIPEndpoint ipepClient;
743 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) 744 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
744 { 745 {
745 // brand new agent, let's create a new caps seed 746 m_log.DebugFormat(
747 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}",
748 finalDestination.RegionName, newRegionX, newRegionY, sp.Name, Scene.Name);
749
750 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
751 #region IP Translation for NAT
752 // Uses ipepClient above
753 if (sp.ClientView.TryGet(out ipepClient))
754 {
755 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
756 }
757 #endregion
746 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 758 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
747 } 759 }
760 else
761 {
762 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
763 if (agentCircuit.CapsPath == null)
764 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
765 }
748 766
749 // We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing 767 // We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing
750 // use of the earlier protocol 768 // use of the earlier protocol
@@ -769,6 +787,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
769 "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", 787 "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}",
770 sp.Name, Scene.Name, finalDestination.RegionName); 788 sp.Name, Scene.Name, finalDestination.RegionName);
771 789
790 string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
791
772 // Let's create an agent there if one doesn't exist yet. 792 // Let's create an agent there if one doesn't exist yet.
773 // NOTE: logout will always be false for a non-HG teleport. 793 // NOTE: logout will always be false for a non-HG teleport.
774 bool logout = false; 794 bool logout = false;
@@ -812,24 +832,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
812 // OK, it got this agent. Let's close some child agents 832 // OK, it got this agent. Let's close some child agents
813 sp.CloseChildAgents(newRegionX, newRegionY); 833 sp.CloseChildAgents(newRegionX, newRegionY);
814 834
815 IClientIPEndpoint ipepClient;
816 string capsPath = String.Empty;
817 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY)) 835 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
818 { 836 {
819 m_log.DebugFormat(
820 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for incoming agent {3} from {4}",
821 finalDestination.RegionName, newRegionX, newRegionY, sp.Name, Scene.Name);
822
823 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
824 #region IP Translation for NAT
825 // Uses ipepClient above
826 if (sp.ClientView.TryGet(out ipepClient))
827 {
828 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
829 }
830 #endregion
831 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
832
833 if (m_eqModule != null) 837 if (m_eqModule != null)
834 { 838 {
835 // The EnableSimulator message makes the client establish a connection with the destination 839 // The EnableSimulator message makes the client establish a connection with the destination
@@ -859,11 +863,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
859 sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint); 863 sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint);
860 } 864 }
861 } 865 }
862 else
863 {
864 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
865 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
866 }
867 866
868 // Let's send a full update of the agent. This is a synchronous call. 867 // Let's send a full update of the agent. This is a synchronous call.
869 AgentData agent = new AgentData(); 868 AgentData agent = new AgentData();
@@ -1028,6 +1027,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1028 ulong destinationHandle = finalDestination.RegionHandle; 1027 ulong destinationHandle = finalDestination.RegionHandle;
1029 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 1028 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
1030 1029
1030 string capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);;
1031
1031 // Let's create an agent there if one doesn't exist yet. 1032 // Let's create an agent there if one doesn't exist yet.
1032 // NOTE: logout will always be false for a non-HG teleport. 1033 // NOTE: logout will always be false for a non-HG teleport.
1033 bool logout = false; 1034 bool logout = false;
@@ -1068,29 +1069,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1068 // Past this point we have to attempt clean up if the teleport fails, so update transfer state. 1069 // Past this point we have to attempt clean up if the teleport fails, so update transfer state.
1069 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); 1070 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring);
1070 1071
1071 IClientIPEndpoint ipepClient;
1072 string capsPath = String.Empty;
1073 if (NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY))
1074 {
1075 m_log.DebugFormat(
1076 "[ENTITY TRANSFER MODULE]: Determined that region {0} at {1},{2} needs new child agent for agent {3} from {4}",
1077 finalDestination.RegionName, newRegionX, newRegionY, sp.Name, Scene.Name);
1078
1079 //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Creating agent...");
1080 #region IP Translation for NAT
1081 // Uses ipepClient above
1082 if (sp.ClientView.TryGet(out ipepClient))
1083 {
1084 endPoint.Address = NetworkUtil.GetIPFor(ipepClient.EndPoint, endPoint.Address);
1085 }
1086 #endregion
1087 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
1088 }
1089 else
1090 {
1091 agentCircuit.CapsPath = sp.Scene.CapsModule.GetChildSeed(sp.UUID, reg.RegionHandle);
1092 capsPath = finalDestination.ServerURI + CapsUtil.GetCapsSeedPath(agentCircuit.CapsPath);
1093 }
1094 1072
1095 // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, 1073 // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator,
1096 // where that neighbour simulator could otherwise request a child agent create on the source which then 1074 // where that neighbour simulator could otherwise request a child agent create on the source which then