diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index fd04722a61..8f217cc372 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -64,6 +64,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
///
public bool WaitForAgentArrivedAtDestination { get; set; }
+ ///
+ /// If true then we ask the viewer to disable teleport cancellation and ignore teleport requests.
+ ///
+ ///
+ /// This is useful in situations where teleport is very likely to always succeed and we want to avoid a
+ /// situation where avatars can be come 'stuck' due to a failed teleport cancellation. Unfortunately, the
+ /// nature of the teleport protocol makes it extremely difficult (maybe impossible) to make teleport
+ /// cancellation consistently suceed.
+ ///
+ public bool DisableInterRegionTeleportCancellation { get; set; }
+
protected bool m_Enabled = false;
public Scene Scene { get; private set; }
@@ -114,6 +125,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
IConfig transferConfig = source.Configs["EntityTransfer"];
if (transferConfig != null)
{
+ DisableInterRegionTeleportCancellation
+ = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false);
+
WaitForAgentArrivedAtDestination
= transferConfig.GetBoolean("wait_for_callback", WaitForAgentArrivedAtDestinationDefault);
@@ -146,9 +160,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
protected virtual void OnNewClient(IClientAPI client)
{
- client.OnTeleportCancel += OnClientCancelTeleport;
client.OnTeleportHomeRequest += TeleportHome;
client.OnTeleportLandmarkRequest += RequestTeleportLandmark;
+
+ if (!DisableInterRegionTeleportCancellation)
+ client.OnTeleportCancel += OnClientCancelTeleport;
}
public virtual void Close() {}
@@ -511,6 +527,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (sp.ParentID != (uint)0)
sp.StandUp();
+ if (DisableInterRegionTeleportCancellation)
+ teleportFlags |= (uint)TeleportFlags.DisableCancel;
+
// At least on LL 3.3.4, this is not strictly necessary - a teleport will succeed without sending this to
// the viewer. However, it might mean that the viewer does not see the black teleport screen (untested).
sp.ControllingClient.SendTeleportStart(teleportFlags);
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 472d6b41d2..8b82752742 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -464,6 +464,13 @@
; shout_distance = 100
+[EntityTransfer]
+ ;# {DisableInterRegionTeleportCancellation} {} {Determine whether the cancel button is shown at all during teleports.} {false true} false
+ ;; This option exists because cancelling at certain points can result in an unuseable session (frozen avatar, etc.)
+ ;; Disabling cancellation can be okay in small closed grids where all teleports are highly likely to suceed.
+ ;DisableInterRegionTeleportCancellation = false
+
+
[Messaging]
;# {OfflineMessageModule} {} {Module to use for offline message storage} {OfflineMessageModule *}
;; Module to handle offline messaging. The core module requires an external
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini
index c2fbd17e0a..4384c22b23 100644
--- a/bin/OpenSimDefaults.ini
+++ b/bin/OpenSimDefaults.ini
@@ -639,6 +639,11 @@
; Minimum user level required for HyperGrid teleports
LevelHGTeleport = 0
+ ; Determine whether the cancel button is shown at all during teleports.
+ ; This option exists because cancelling at certain points can result in an unuseable session (frozen avatar, etc.)
+ ; Disabling cancellation can be okay in small closed grids where all teleports are highly likely to suceed.
+ DisableInterRegionTeleportCancellation = false
+
[Messaging]
; Control which region module is used for instant messaging.