diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 34f0924..9b1b69a 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -66,6 +66,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
66 | /// </summary> | 66 | /// </summary> |
67 | public bool WaitForAgentArrivedAtDestination { get; set; } | 67 | public bool WaitForAgentArrivedAtDestination { get; set; } |
68 | 68 | ||
69 | /// <summary> | ||
70 | /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests. | ||
71 | /// </summary> | ||
72 | /// <remarks> | ||
73 | /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a | ||
74 | /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the | ||
75 | /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport | ||
76 | /// cancellation consistently suceed. | ||
77 | /// </remarks> | ||
78 | public bool DisableInterRegionTeleportCancellation { get; set; } | ||
79 | |||
69 | protected bool m_Enabled = false; | 80 | protected bool m_Enabled = false; |
70 | 81 | ||
71 | public Scene Scene { get; private set; } | 82 | public Scene Scene { get; private set; } |
@@ -116,6 +127,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
116 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 127 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
117 | if (transferConfig != null) | 128 | if (transferConfig != null) |
118 | { | 129 | { |
130 | DisableInterRegionTeleportCancellation | ||
131 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); | ||
132 | |||
119 | WaitForAgentArrivedAtDestination | 133 | WaitForAgentArrivedAtDestination |
120 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); | 134 | = transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault); |
121 | 135 | ||
@@ -148,9 +162,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
148 | 162 | ||
149 | protected virtual void OnNewClient(IClientAPI client) | 163 | protected virtual void OnNewClient(IClientAPI client) |
150 | { | 164 | { |
151 | client.OnTeleportCancel += OnClientCancelTeleport; | ||
152 | client.OnTeleportHomeRequest += TeleportHome; | 165 | client.OnTeleportHomeRequest += TeleportHome; |
153 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; | 166 | client.OnTeleportLandmarkRequest += RequestTeleportLandmark; |
167 | |||
168 | if (!DisableInterRegionTeleportCancellation) | ||
169 | client.OnTeleportCancel += OnClientCancelTeleport; | ||
154 | } | 170 | } |
155 | 171 | ||
156 | public virtual void Close() {} | 172 | public virtual void Close() {} |
@@ -528,6 +544,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
528 | if (sp.ParentID != (uint)0) | 544 | if (sp.ParentID != (uint)0) |
529 | sp.StandUp(); | 545 | sp.StandUp(); |
530 | 546 | ||
547 | if (DisableInterRegionTeleportCancellation) | ||
548 | teleportFlags |= (uint)TeleportFlags.DisableCancel; | ||
549 | |||
531 | // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to | 550 | // At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to |
532 | // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). | 551 | // the viewer. However, it might mean that the viewer does not see the black teleport screen (untested). |
533 | sp.ControllingClient.SendTeleportStart(teleportFlags); | 552 | sp.ControllingClient.SendTeleportStart(teleportFlags); |