diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index df95bf0..4286eef 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -693,8 +693,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
693 | if (version.Equals("SIMULATION/0.2")) | 693 | if (version.Equals("SIMULATION/0.2")) |
694 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 694 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
695 | else | 695 | else |
696 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 696 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
697 | |||
698 | } | 697 | } |
699 | 698 | ||
700 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 699 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
@@ -703,7 +702,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
703 | ulong destinationHandle = finalDestination.RegionHandle; | 702 | ulong destinationHandle = finalDestination.RegionHandle; |
704 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 703 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
705 | 704 | ||
706 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Using TP V1"); | 705 | m_log.DebugFormat( |
706 | "[ENTITY TRANSFER MODULE]: Using TP V1 for {0} going from {1} to {2}", | ||
707 | sp.Name, Scene.Name, finalDestination.RegionName); | ||
708 | |||
707 | // Let's create an agent there if one doesn't exist yet. | 709 | // Let's create an agent there if one doesn't exist yet. |
708 | // NOTE: logout will always be false for a non-HG teleport. | 710 | // NOTE: logout will always be false for a non-HG teleport. |
709 | bool logout = false; | 711 | bool logout = false; |
@@ -961,6 +963,27 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
961 | return; | 963 | return; |
962 | } | 964 | } |
963 | 965 | ||
966 | if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Cancelling) | ||
967 | { | ||
968 | m_interRegionTeleportCancels.Value++; | ||
969 | |||
970 | m_log.DebugFormat( | ||
971 | "[ENTITY TRANSFER MODULE]: Cancelled teleport of {0} to {1} from {2} after CreateAgent on client request", | ||
972 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | ||
973 | |||
974 | return; | ||
975 | } | ||
976 | else if (m_entityTransferStateMachine.GetAgentTransferState(sp.UUID) == AgentTransferState.Aborting) | ||
977 | { | ||
978 | m_interRegionTeleportAborts.Value++; | ||
979 | |||
980 | m_log.DebugFormat( | ||
981 | "[ENTITY TRANSFER MODULE]: Aborted teleport of {0} to {1} from {2} after CreateAgent due to previous client close.", | ||
982 | sp.Name, finalDestination.RegionName, sp.Scene.Name); | ||
983 | |||
984 | return; | ||
985 | } | ||
986 | |||
964 | // Past this point we have to attempt clean up if the teleport fails, so update transfer state. | 987 | // Past this point we have to attempt clean up if the teleport fails, so update transfer state. |
965 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); | 988 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.Transferring); |
966 | 989 | ||
@@ -1063,20 +1086,22 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1063 | if (!sp.DoNotCloseAfterTeleport) | 1086 | if (!sp.DoNotCloseAfterTeleport) |
1064 | { | 1087 | { |
1065 | // OK, it got this agent. Let's close everything | 1088 | // OK, it got this agent. Let's close everything |
1066 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.RegionInfo.RegionName); | 1089 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Closing in agent {0} in region {1}", sp.Name, Scene.Name); |
1067 | sp.CloseChildAgents(newRegionX, newRegionY); | 1090 | sp.CloseChildAgents(newRegionX, newRegionY); |
1068 | sp.Scene.IncomingCloseAgent(sp.UUID, false); | 1091 | sp.Scene.IncomingCloseAgent(sp.UUID, false); |
1069 | 1092 | ||
1070 | } | 1093 | } |
1071 | else | 1094 | else |
1072 | { | 1095 | { |
1073 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.RegionInfo.RegionName); | 1096 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Not closing agent {0}, user is back in {0}", sp.Name, Scene.Name); |
1074 | sp.DoNotCloseAfterTeleport = false; | 1097 | sp.DoNotCloseAfterTeleport = false; |
1075 | } | 1098 | } |
1076 | } | 1099 | } |
1077 | else | 1100 | else |
1101 | { | ||
1078 | // now we have a child agent in this region. | 1102 | // now we have a child agent in this region. |
1079 | sp.Reset(); | 1103 | sp.Reset(); |
1104 | } | ||
1080 | } | 1105 | } |
1081 | 1106 | ||
1082 | /// <summary> | 1107 | /// <summary> |